From 8b390fc142f785b1450689e686a73bb5283f9b9a Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Fri, 6 May 2016 15:37:12 -0700 Subject: [PATCH] t-runner: Add new arg. into t-runner: --tests --- tools/test-runner.c | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/tools/test-runner.c b/tools/test-runner.c index 6b16cd6f..060ce5ba 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -67,6 +67,7 @@ static bool verbose_out; static const char *qemu_binary; static const char *kernel_image; static const char *exec_home; +static const char *test_list; static const char * const qemu_table[] = { "qemu-system-x86_64", @@ -1503,20 +1504,21 @@ static void usage(void) "Usage:\n"); printf("\ttest-runner [options] [--] [args]\n"); printf("Options:\n" - "\t-a, --auto Find tests and run them\n" - "\t-q, --qemu QEMU binary\n" - "\t-k, --kernel Kernel image (bzImage)\n" - "\t-v, --verbose Enable verbose output\n" - "\t-h, --help Show help options\n"); + "\t-q, --qemu QEMU binary\n" + "\t-k, --kernel Kernel image (bzImage)\n" + "\t-t, --tests Comma separated list of the test " + "configuration\n\t\t\t\tdirectories to" + " run\n" + "\t-v, --verbose Enable verbose output\n" + "\t-h, --help Show help options\n"); } static const struct option main_options[] = { - { "all", no_argument, NULL, 'a' }, - { "auto", no_argument, NULL, 'a' }, - { "qemu", required_argument, NULL, 'q' }, - { "kernel", required_argument, NULL, 'k' }, - { "verbose", no_argument, NULL, 'v' }, - { "help", no_argument, NULL, 'h' }, + { "qemu", required_argument, NULL, 'q' }, + { "kernel", required_argument, NULL, 'k' }, + { "testdirs", required_argument, NULL, 't' }, + { "verbose", no_argument, NULL, 'v' }, + { "help", no_argument, NULL, 'h' }, { } }; @@ -1528,7 +1530,7 @@ int main(int argc, char *argv[]) run_tests(); sync(); - printf("Done running test. Rebooting..."); + l_info("Done running tests. Rebooting..."); reboot(RB_AUTOBOOT); return EXIT_SUCCESS; @@ -1537,7 +1539,7 @@ int main(int argc, char *argv[]) for (;;) { int opt; - opt = getopt_long(argc, argv, "aq:k:t:vh", main_options, NULL); + opt = getopt_long(argc, argv, "q:k:t:vh", main_options, NULL); if (opt < 0) break; @@ -1548,6 +1550,9 @@ int main(int argc, char *argv[]) case 'k': kernel_image = optarg; break; + case 't': + test_list = optarg; + break; case 'v': verbose_out = true; break; @@ -1559,16 +1564,9 @@ int main(int argc, char *argv[]) } } - if (run_auto) { - if (argc - optind > 0) { - fprintf(stderr, "Invalid command line parameters\n"); - return EXIT_FAILURE; - } - } else { - if (argc - optind < 1) { - fprintf(stderr, "Failed to specify test command\n"); - return EXIT_FAILURE; - } + if (argc - optind > 0) { + fprintf(stderr, "Invalid command line parameters\n"); + return EXIT_FAILURE; } own_binary = argv[0];