When boost-build automatically runs unit tests using either the unit-test or the testing/run jam rule, is it possible to have an environment variable automatically defined?

We have a cpu frequency calc calibration routine which bails out if we can't calibrate within a certain tolerance level.

This is acceptable behaviour in production, and in practice never happens. However we get intermittent failures on our build server due to box pressure, pressure which we just don't get on the production servers.

I'd like to put in a check for an environment variable which can prevent the calibration failure only during unit tests.

Something along the lines of:

char* testing = getenv("BJAM_UNIT_TEST");
if (!testing)
    throw std::runtime_exception("frequency calibration failure");