diff options
author | Thomas Wood <thomas.wood@intel.com> | 2015-02-18 16:19:59 +0000 |
---|---|---|
committer | Thomas Wood <thomas.wood@intel.com> | 2015-02-25 16:48:25 +0000 |
commit | 8fb19782f82f25249aaed0ff0e5fa6601dbb0e9d (patch) | |
tree | 803568509acd7bfc35f9596cf3db1a59937c2ed4 /lib/tests/igt_simulation.c | |
parent | 55cc132b3219fbbf8c5705c674ef0f9a9b53d593 (diff) |
lib: remove handled option arguments from argv
Remove options from argv that have been handled by getopt to allow
additional non-option parameters to be processed in the test application.
This fixes issues when using options such as --debug with tests that accept
additional non-option parameters.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'lib/tests/igt_simulation.c')
-rw-r--r-- | lib/tests/igt_simulation.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/tests/igt_simulation.c b/lib/tests/igt_simulation.c index e5889590..32830ba7 100644 --- a/lib/tests/igt_simulation.c +++ b/lib/tests/igt_simulation.c @@ -55,22 +55,27 @@ char *argv_run[] = { test }; static int do_fork(void) { int pid, status; + int argc; switch (pid = fork()) { case -1: internal_assert(0); case 0: if (simple) { - igt_simple_init(1, argv_run); + argc = 1; + igt_simple_init(argc, argv_run); igt_skip_on_simulation(); igt_exit(); } else { - if (list_subtests) - igt_subtest_init(2, argv_list); - else - igt_subtest_init(1, argv_run); + if (list_subtests) { + argc = 2; + igt_subtest_init(argc, argv_list); + } else { + argc = 1; + igt_subtest_init(argc, argv_run); + } if (in_fixture) { igt_fixture |