37 ofstream redirectstream;
41 cout <<
"Test output has been redirected to: " <<
redirect_output.getValue() << endl;
43 redirectbuf = redirectstream.rdbuf();
44 oldcoutbuf = cout.rdbuf();
45 cout.rdbuf(redirectbuf);
56 if (
remove(test_file) == 0) {
58 cout <<
"Removed already existing test output file " << test_file << endl;
61 cerr <<
"Warning: Failed to remove already existing output image " << test_file << endl;
PositionalArgs testcmd("testcmd", "The name of the test to run and optional arguments." " Displays a list of available tests if this argument is omitted" " and waits for the user to input the number of the test to run." " Exist with error if an invalid test was specified." " Note that if the -- option is not given before the test name," " labeled arguments following the test name will be considered" " to be options of the test driver if known by the test driver." " Otherwise, if the option is unknown to the test driver or the" " -- option has been given before the test name, the remaining" " arguments are passed on to the test.", false, "", "[--] [<test name> [<arg>...]]")
std::string getcwd()
Get absolute path of the (current) working directory.
bool emptydir(const std::string &path)
Remove files and directories from directory.
bool isfile(const std::string path)
Test whether a given path is the path of an existent file.
SwitchArg clean_cwd_before_test("", "clean-cwd-before", "Request the removal of all files and directories from the current" " working directory before the execution of the test. This option is" " in particular useful if the test writes any results to the current" " working directory.", false)
StringArg redirect_output("", "redirect-output", "Redirects the test output to the specified file.", false, "", "<file>")
MultiSwitchArg verbose("v", "verbose", "Increase verbosity of output messages.", false)
vector< RegressionTest > regression_tests
Container storing added regression tests.