summaryrefslogtreecommitdiff
path: root/utests/utest_run.cpp
diff options
context:
space:
mode:
authorPan Xiuli <xiuli.pan@intel.com>2016-08-12 16:52:01 +0800
committerYang Rong <rong.r.yang@intel.com>2016-08-12 18:29:39 +0800
commit8bc5d2852eedf9613d58276ab06d7e58570b885f (patch)
treebabfc18444d1c197f9f128fc6199af2775c728a6 /utests/utest_run.cpp
parent116a365aefeb8eadf85fc787b9720caaafe30b2a (diff)
downloadbeignet-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.cpp18
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':