30 ProgramName = argv[0];
31 const size_t size = ProgramName.size();
33 for(index = 0; index < size; index++) {
34 if (ProgramName[index] ==
'\\') {
35 ProgramName[index]=
'/';
45 if (strcmp(argv[1],
"--help") == 0 || strcmp(argv[1],
"-h") == 0) {
50 if (strcmp(argv[1],
"--run") == 0 || strcmp(argv[1],
"-r") == 0) {
57 if (strcmp(argv[1],
"--list") == 0 || strcmp(argv[1],
"-l") == 0) {
64 if (strcmp(argv[1],
"--dart") == 0 || strcmp(argv[1],
"-d") == 0) {
71 if (strcmp(argv[1],
"--numinstances") == 0 || strcmp(argv[1],
"-o") == 0) {
72 NumTestInstances = atoi(argv[2]);
78 if (strcmp(argv[1],
"--numiterations") == 0 || strcmp(argv[1],
"-i") == 0) {
79 NumTestIterations = atoi(argv[2]);
85 if (strcmp(argv[1],
"--testname") == 0 || strcmp(argv[1],
"-t") == 0) {
86 TestNames.push_back( argv[2] );
101 << programName <<
": Usage" << std::endl
102 <<
"-h, --help print this message" << std::endl
103 <<
"-l, --list print the available test instances" << std::endl
104 <<
"-d, --dart print CMake/ctest commands in DartTestfile.txt format" << std::endl
105 <<
"-r, --run run the available test instances" << std::endl
106 <<
"-t, --testname [name] add the specified test case or suite to the list" << std::endl
107 <<
"-o, --numinstances [n] specify the number of instances to create of each test" << std::endl
108 <<
"-i, --numiterations [n] specify the number of iterations for each test instance" << std::endl;
110 std::cerr << std::endl << std::endl;
112 <<
"If no names are specified, all tests are instantiated." << std::endl
113 <<
"Otherwise, the instantiated tests are those whose names or suite" << std::endl
114 <<
"were listed and which appear in the test registry." << std::endl
115 <<
"The number of instances and number of iterations is 1 by default" << std::endl;
static int PrintHelp(const char *programName)
void ParseCmdLine(int argc, char *argv[])