TestSuite: Environmental variables support for controlling the test suite.
This includes the addition of FG_TEST_LOG_LEVEL, FG_TEST_LOG_CLASS, FG_TEST_LOG_SPLIT, FG_TEST_TIMINGS, and FG_TEST_DEBUG. These match the command line option naming.
This commit is contained in:
parent
c5dd4d3715
commit
4f5b0c8291
1 changed files with 21 additions and 0 deletions
|
@ -71,6 +71,13 @@ void helpPrintout(std::ostream &stream) {
|
||||||
stream << std::endl;
|
stream << std::endl;
|
||||||
stream << " FG options:" << std::endl;
|
stream << " FG options:" << std::endl;
|
||||||
stream << " --fg-root the path to FGData" << std::endl;
|
stream << " --fg-root the path to FGData" << std::endl;
|
||||||
|
stream << std::endl;
|
||||||
|
stream << "Environmental variables:" << std::endl;
|
||||||
|
stream << " FG_TEST_LOG_LEVEL equivalent to the --log-level option." << std::endl;
|
||||||
|
stream << " FG_TEST_LOG_CLASS equivalent to the --log-class option." << std::endl;
|
||||||
|
stream << " FG_TEST_LOG_SPLIT equivalent to the --log-split option." << std::endl;
|
||||||
|
stream << " FG_TEST_TIMINGS equivalent to the -t or --timings option." << std::endl;
|
||||||
|
stream << " FG_TEST_DEBUG equivalent to the -d or --debug option." << std::endl;
|
||||||
stream.flush();
|
stream.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,6 +281,20 @@ int main(int argc, char **argv)
|
||||||
sgDebugClass logClass=SG_ALL;
|
sgDebugClass logClass=SG_ALL;
|
||||||
sgDebugPriority logPriority=SG_INFO;
|
sgDebugPriority logPriority=SG_INFO;
|
||||||
|
|
||||||
|
// Process environmental variables before the command line options.
|
||||||
|
if (getenv("FG_TEST_LOG_LEVEL"))
|
||||||
|
logPriority = processLogPriority(getenv("FG_TEST_LOG_LEVEL"), failure);
|
||||||
|
if (getenv("FG_TEST_LOG_CLASS"))
|
||||||
|
logClass = processLogClass(getenv("FG_TEST_LOG_CLASS"), failure);
|
||||||
|
if (getenv("FG_TEST_LOG_SPLIT"))
|
||||||
|
logSplit = true;
|
||||||
|
if (getenv("FG_TEST_TIMINGS"))
|
||||||
|
timings = true;
|
||||||
|
if (getenv("FG_TEST_DEBUG"))
|
||||||
|
debug = true;
|
||||||
|
if (failure)
|
||||||
|
return 1;
|
||||||
|
|
||||||
// Argument parsing.
|
// Argument parsing.
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
firstchar = '\0';
|
firstchar = '\0';
|
||||||
|
|
Loading…
Reference in a new issue