3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

t-runner: Add new arg. into t-runner: --tests

This commit is contained in:
Tim Kourt 2016-05-06 15:37:12 -07:00 committed by Denis Kenzior
parent aa7f88a78c
commit 8b390fc142

View File

@ -67,6 +67,7 @@ static bool verbose_out;
static const char *qemu_binary; static const char *qemu_binary;
static const char *kernel_image; static const char *kernel_image;
static const char *exec_home; static const char *exec_home;
static const char *test_list;
static const char * const qemu_table[] = { static const char * const qemu_table[] = {
"qemu-system-x86_64", "qemu-system-x86_64",
@ -1503,20 +1504,21 @@ static void usage(void)
"Usage:\n"); "Usage:\n");
printf("\ttest-runner [options] [--] <command> [args]\n"); printf("\ttest-runner [options] [--] <command> [args]\n");
printf("Options:\n" printf("Options:\n"
"\t-a, --auto Find tests and run them\n" "\t-q, --qemu <path> QEMU binary\n"
"\t-q, --qemu <path> QEMU binary\n" "\t-k, --kernel <image> Kernel image (bzImage)\n"
"\t-k, --kernel <image> Kernel image (bzImage)\n" "\t-t, --tests <dirs> Comma separated list of the test "
"\t-v, --verbose Enable verbose output\n" "configuration\n\t\t\t\tdirectories to"
"\t-h, --help Show help options\n"); " run\n"
"\t-v, --verbose Enable verbose output\n"
"\t-h, --help Show help options\n");
} }
static const struct option main_options[] = { static const struct option main_options[] = {
{ "all", no_argument, NULL, 'a' }, { "qemu", required_argument, NULL, 'q' },
{ "auto", no_argument, NULL, 'a' }, { "kernel", required_argument, NULL, 'k' },
{ "qemu", required_argument, NULL, 'q' }, { "testdirs", required_argument, NULL, 't' },
{ "kernel", required_argument, NULL, 'k' }, { "verbose", no_argument, NULL, 'v' },
{ "verbose", no_argument, NULL, 'v' }, { "help", no_argument, NULL, 'h' },
{ "help", no_argument, NULL, 'h' },
{ } { }
}; };
@ -1528,7 +1530,7 @@ int main(int argc, char *argv[])
run_tests(); run_tests();
sync(); sync();
printf("Done running test. Rebooting..."); l_info("Done running tests. Rebooting...");
reboot(RB_AUTOBOOT); reboot(RB_AUTOBOOT);
return EXIT_SUCCESS; return EXIT_SUCCESS;
@ -1537,7 +1539,7 @@ int main(int argc, char *argv[])
for (;;) { for (;;) {
int opt; 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) if (opt < 0)
break; break;
@ -1548,6 +1550,9 @@ int main(int argc, char *argv[])
case 'k': case 'k':
kernel_image = optarg; kernel_image = optarg;
break; break;
case 't':
test_list = optarg;
break;
case 'v': case 'v':
verbose_out = true; verbose_out = true;
break; break;
@ -1559,16 +1564,9 @@ int main(int argc, char *argv[])
} }
} }
if (run_auto) { if (argc - optind > 0) {
if (argc - optind > 0) { fprintf(stderr, "Invalid command line parameters\n");
fprintf(stderr, "Invalid command line parameters\n"); return EXIT_FAILURE;
return EXIT_FAILURE;
}
} else {
if (argc - optind < 1) {
fprintf(stderr, "Failed to specify test command\n");
return EXIT_FAILURE;
}
} }
own_binary = argv[0]; own_binary = argv[0];