mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-11 16:32:58 +00:00
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>
This commit is contained in:
@@ -32,8 +32,9 @@ int main(int argc, char **argv)
|
||||
char prog[] = "igt_list_only";
|
||||
char arg[] = "--list-subtests";
|
||||
char *fake_argv[] = {prog, arg};
|
||||
int fake_argc = 2;
|
||||
|
||||
igt_subtest_init(2, fake_argv);
|
||||
igt_subtest_init(fake_argc, fake_argv);
|
||||
|
||||
igt_subtest("A")
|
||||
;
|
||||
|
||||
@@ -31,8 +31,9 @@ int main(int argc, char **argv)
|
||||
{
|
||||
char prog[] = "igt_no_exit";
|
||||
char *fake_argv[] = {prog};
|
||||
int fake_argc = 1;
|
||||
|
||||
igt_subtest_init(1, fake_argv);
|
||||
igt_subtest_init(fake_argc, fake_argv);
|
||||
|
||||
igt_subtest("A")
|
||||
;
|
||||
|
||||
@@ -32,8 +32,9 @@ int main(int argc, char **argv)
|
||||
char prog[] = "igt_list_only";
|
||||
char arg[] = "--list-subtests";
|
||||
char *fake_argv[] = {prog, arg};
|
||||
int fake_argc = 2;
|
||||
|
||||
igt_subtest_init(2, fake_argv);
|
||||
igt_subtest_init(fake_argc, fake_argv);
|
||||
|
||||
igt_subtest("A")
|
||||
;
|
||||
|
||||
@@ -31,8 +31,9 @@ int main(int argc, char **argv)
|
||||
{
|
||||
char prog[] = "igt_no_exit";
|
||||
char *fake_argv[] = {prog};
|
||||
int fake_argc = 1;
|
||||
|
||||
igt_subtest_init(1, fake_argv);
|
||||
igt_subtest_init(fake_argc, fake_argv);
|
||||
|
||||
igt_exit();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user