diff options
author | Pan Xiuli <xiuli.pan@intel.com> | 2016-08-12 16:52:01 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-08-12 18:29:39 +0800 |
commit | 8bc5d2852eedf9613d58276ab06d7e58570b885f (patch) | |
tree | babfc18444d1c197f9f128fc6199af2775c728a6 /utests/utest_run.cpp | |
parent | 116a365aefeb8eadf85fc787b9720caaafe30b2a (diff) | |
download | beignet-8bc5d2852eedf9613d58276ab06d7e58570b885f.tar.gz |
Utest: Refine utest_run -l option
Refine old -l to test cases that can run
-la for all test cases
-li for test cases with issue
Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'utests/utest_run.cpp')
-rw-r--r-- | utests/utest_run.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/utests/utest_run.cpp b/utests/utest_run.cpp index 380d738a..1866d9a3 100644 --- a/utests/utest_run.cpp +++ b/utests/utest_run.cpp @@ -26,13 +26,14 @@ #include "utest_helper.hpp" #include "utest_exception.hpp" #include <iostream> +#include <string.h> #include <getopt.h> -static const char *shortopts = "c:j:lanh"; +static const char *shortopts = "c:j:l::anh"; struct option longopts[] = { {"casename", required_argument, NULL, 'c'}, {"jobs", required_argument, NULL, 'j'}, -{"list", no_argument, NULL, 'l'}, +{"list", optional_argument, NULL, 'l'}, {"all", no_argument, NULL, 'a'}, {"allnoissue", no_argument, NULL, 'n'}, {"help", no_argument, NULL, 'h'}, @@ -48,7 +49,7 @@ Usage:\n\ option:\n\ -c <casename>: run sub-case named 'casename'\n\ -j <number> : specifies the 'number' of jobs (multi-thread)\n\ - -l : list all the available case name\n\ + -l <a/i> : list case name that can run(a for all case, i for case with issue)\n\ -a : run all test cases\n\ -n : run all test cases without known issue (default option)\n\ -h : display this usage\n\ @@ -103,7 +104,16 @@ int main(int argc, char *argv[]) break; case 'l': - UTest::listAllCases(); + if (optarg == NULL) + UTest::listCasesCanRun(); + else if (strcmp(optarg,"a") == 0) + UTest::listAllCases(); + else if (strcmp(optarg,"i") == 0) + UTest::listCasesWithIssue(); + else { + usage(); + exit(1); + } break; case 'a': |