src/tests/main.cpp
// Return true if the given test or test case can be run. This is an additional
// check for selectively running tests depending on the runtime system
// information. For example, if the name of a test contains ROOT (a special
// name), but the test is run under a non-root user, this function will return
// false indicating that this test (contains special names) should not be run.
// Other tests without special names are not affected.
Return true if the given test or test case can be run. This is an additional
check for selectively running tests depending on the runtime system
information. For example, if the name of a test contains ROOT (a special
name), but the test is run under a non-root user, this function will return
false indicating that this test (contains special names) should not be run.
Other tests without special names are not affected.
Return true if the given test or test case can be run . This is an additional check for selectively running tests depending on the runtime system information . For example if the name of a test contains ROOT ( a special name ) but the test is run under a non - root user this function will return false indicating that this test ( contains special names ) should not be run . Other tests without special names are not affected .
static bool shouldRun(const std::string& name)
{
  if (strings::contains(name, "ROOT") &&
      os::user() != "root") {
    return false;
  }
  if (strings::contains(name, "CGROUPS") &&
      !os::exists("/proc/cgroups")) {
    return false;
  }
  return true;
}
static bool shouldRun ( const std :: string & name ) { if ( strings :: contains ( name , " " ) && os :: user ( ) != " " ) { return false ; } if ( strings :: contains ( name , " " ) && ! os :: exists ( " " ) ) { return false ; } return true ; }
Return true if the given test or test case can be run.
Return true if the given test or test case can be run .
// TODO(jieyu): Replace the cgroups check with cgroups::enabled() once the // cgroups module is checked in.