20 lines
433 B
C++
20 lines
433 B
C++
#include "is_unittest_environment.h"
|
|
#include <stdlib.h>
|
|
|
|
namespace bts {
|
|
namespace utils {
|
|
namespace internal {
|
|
|
|
static bool forced_unittest_environment = false;
|
|
|
|
void force_unittest_environment() { forced_unittest_environment = true; }
|
|
|
|
bool is_unittest_environment() {
|
|
return forced_unittest_environment ||
|
|
getenv("BTS_TEST_ENVIRONMENT") != nullptr;
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace utils
|
|
} // namespace bts
|