28#if defined(_DEBUG) || defined(G_TEST_ENABLED)
33 bool spec_set = false ;
34 std::string spec(
bool set =
false ,
const std::string & s = std::string() ) ;
37std::string G::TestImp::spec(
bool set ,
const std::string & s_in )
39 static std::string s ;
43 s =
"," + s_in +
"," ;
50 TestImp::spec(
true , s ) ;
54 if( !TestImp::spec_set )
59 bool result = TestImp::spec().empty() ? false : ( TestImp::spec().find(
","+std::string(name)+
",") != std::string::npos ) ;
62 static std::set<std::string> warned ;
63 if( warned.find(name) == warned.end() )
65 warned.insert( name ) ;
66 G_WARNING(
"G::Test::enabled: test case enabled: [" << name <<
"]" ) ;
static std::string get(const std::string &name, const std::string &default_)
Returns the environment variable value or the given default.
static bool enabled() noexcept
Returns true if test features are enabled.
static void set(const std::string &)
Sets the test specification string.