| 49 | } |
| 50 | |
| 51 | bool CommandLineArguments::parse(TestPlugin* plugin) |
| 52 | { |
| 53 | bool correctParameters = true; |
| 54 | for (int i = 1; i < ac_; i++) { |
| 55 | SimpleString argument = av_[i]; |
| 56 | |
| 57 | if (argument == "-h") { |
| 58 | needHelp_ = true; |
| 59 | correctParameters = false; |
| 60 | } |
| 61 | else if (argument == "-v") verbose_ = true; |
| 62 | else if (argument == "-vv") veryVerbose_ = true; |
| 63 | else if (argument == "-c") color_ = true; |
| 64 | else if (argument == "-p") runTestsAsSeperateProcess_ = true; |
| 65 | else if (argument == "-b") reversing_ = true; |
| 66 | else if (argument == "-lg") listTestGroupNames_ = true; |
| 67 | else if (argument == "-ln") listTestGroupAndCaseNames_ = true; |
| 68 | else if (argument == "-ri") runIgnored_ = true; |
| 69 | else if (argument.startsWith("-r")) setRepeatCount(ac_, av_, i); |
| 70 | else if (argument.startsWith("-g")) addGroupFilter(ac_, av_, i); |
| 71 | else if (argument.startsWith("-t")) correctParameters = addGroupDotNameFilter(ac_, av_, i); |
| 72 | else if (argument.startsWith("-sg")) addStrictGroupFilter(ac_, av_, i); |
| 73 | else if (argument.startsWith("-xg")) addExcludeGroupFilter(ac_, av_, i); |
| 74 | else if (argument.startsWith("-xsg")) addExcludeStrictGroupFilter(ac_, av_, i); |
| 75 | else if (argument.startsWith("-n")) addNameFilter(ac_, av_, i); |
| 76 | else if (argument.startsWith("-sn")) addStrictNameFilter(ac_, av_, i); |
| 77 | else if (argument.startsWith("-xn")) addExcludeNameFilter(ac_, av_, i); |
| 78 | else if (argument.startsWith("-xsn")) addExcludeStrictNameFilter(ac_, av_, i); |
| 79 | else if (argument.startsWith("-s")) correctParameters = setShuffle(ac_, av_, i); |
| 80 | else if (argument.startsWith("TEST(")) addTestToRunBasedOnVerboseOutput(ac_, av_, i, "TEST("); |
| 81 | else if (argument.startsWith("IGNORE_TEST(")) addTestToRunBasedOnVerboseOutput(ac_, av_, i, "IGNORE_TEST("); |
| 82 | else if (argument.startsWith("-o")) correctParameters = setOutputType(ac_, av_, i); |
| 83 | else if (argument.startsWith("-p")) correctParameters = plugin->parseAllArguments(ac_, av_, i); |
| 84 | else if (argument.startsWith("-k")) setPackageName(ac_, av_, i); |
| 85 | else correctParameters = false; |
| 86 | |
| 87 | if (correctParameters == false) { |
| 88 | return false; |
| 89 | } |
| 90 | } |
| 91 | return true; |
| 92 | } |
| 93 | |
| 94 | const char* CommandLineArguments::usage() const |
| 95 | { |