add option to test main program to override the value of the INPUT_FOLDER variable

This commit is contained in:
Axel Kohlmeyer 2020-05-20 15:23:32 -04:00
parent 917b7dd4fa
commit 8bc2c4748c
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 9 additions and 0 deletions

View File

@ -39,6 +39,7 @@ void usage(std::ostream &out, const char *name)
out << "usage: " << name << " <testfile.yaml> [OPTIONS]\n\n"
<< "Available options:\n"
<< " -g <newfile.yaml> regenerate yaml file under a new name\n"
<< " -d <folder> set folder where to find input files\n"
<< " -u update the original yaml file\n"
<< " -v run tests with verbose output\n"
<< " -s run tests with error statistics output\n"
@ -89,6 +90,14 @@ int main(int argc, char **argv)
} else if (strcmp(argv[iarg],"-u") == 0) {
generate_yaml_file(argv[1], test_config);
return 0;
} else if (strcmp(argv[iarg],"-d") == 0) {
if (iarg+1 < argc) {
INPUT_FOLDER = argv[iarg+1];
iarg += 2;
} else {
usage(std::cerr,argv[0]);
return 1;
}
} else if (strcmp(argv[iarg],"-s") == 0) {
print_stats = true;
++iarg;