mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 10:26:12 +00:00
lib/igt_core: fix igt_skip_on_simulation regression
I've forgotten that we might want to call this from within specific subtests (or special helpers like the autoresume one). Also props for being competent enough to write a testcase, but incompetent enough to botch the job up. Fix both things and remove a leftover debug printf while at it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
c819014752
commit
71c6f87eb3
@ -1132,7 +1132,7 @@ void igt_skip_on_simulation(void)
|
|||||||
if (igt_only_list_subtests())
|
if (igt_only_list_subtests())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!in_fixture) {
|
if (!in_fixture && !in_subtest) {
|
||||||
igt_fixture
|
igt_fixture
|
||||||
igt_require(!igt_run_in_simulation());
|
igt_require(!igt_run_in_simulation());
|
||||||
} else
|
} else
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
bool simple;
|
bool simple;
|
||||||
bool list_subtests;
|
bool list_subtests;
|
||||||
bool in_fixture;
|
bool in_fixture;
|
||||||
|
bool in_subtest;
|
||||||
|
|
||||||
char test[] = "test";
|
char test[] = "test";
|
||||||
char list[] = "--list-subtests";
|
char list[] = "--list-subtests";
|
||||||
@ -66,13 +67,16 @@ static int do_fork(void)
|
|||||||
if (in_fixture) {
|
if (in_fixture) {
|
||||||
igt_fixture
|
igt_fixture
|
||||||
igt_skip_on_simulation();
|
igt_skip_on_simulation();
|
||||||
|
} if (in_subtest) {
|
||||||
|
igt_subtest("sim")
|
||||||
|
igt_skip_on_simulation();
|
||||||
} else
|
} else
|
||||||
igt_skip_on_simulation();
|
igt_skip_on_simulation();
|
||||||
|
|
||||||
igt_subtest("foo")
|
if (!in_subtest)
|
||||||
;
|
igt_subtest("foo")
|
||||||
|
;
|
||||||
|
|
||||||
printf("baz\n");
|
|
||||||
igt_exit();
|
igt_exit();
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -104,7 +108,6 @@ int main(int argc, char **argv)
|
|||||||
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
|
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
|
||||||
assert(do_fork() == 0);
|
assert(do_fork() == 0);
|
||||||
|
|
||||||
in_fixture = false;
|
|
||||||
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
|
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
|
||||||
assert(do_fork() == 0);
|
assert(do_fork() == 0);
|
||||||
|
|
||||||
@ -112,7 +115,14 @@ int main(int argc, char **argv)
|
|||||||
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
|
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
|
||||||
assert(do_fork() == 0);
|
assert(do_fork() == 0);
|
||||||
|
|
||||||
in_fixture = true;
|
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
|
||||||
|
assert(do_fork() == 0);
|
||||||
|
|
||||||
|
in_fixture = false;
|
||||||
|
in_subtest = true;
|
||||||
|
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
|
||||||
|
assert(do_fork() == 0);
|
||||||
|
|
||||||
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
|
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
|
||||||
assert(do_fork() == 0);
|
assert(do_fork() == 0);
|
||||||
|
|
||||||
@ -124,7 +134,6 @@ int main(int argc, char **argv)
|
|||||||
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
|
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
|
||||||
assert(do_fork() == 77);
|
assert(do_fork() == 77);
|
||||||
|
|
||||||
in_fixture = false;
|
|
||||||
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
|
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
|
||||||
assert(do_fork() == 0);
|
assert(do_fork() == 0);
|
||||||
|
|
||||||
@ -132,10 +141,16 @@ int main(int argc, char **argv)
|
|||||||
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
|
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
|
||||||
assert(do_fork() == 77);
|
assert(do_fork() == 77);
|
||||||
|
|
||||||
in_fixture = true;
|
|
||||||
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
|
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
|
||||||
assert(do_fork() == 0);
|
assert(do_fork() == 0);
|
||||||
|
|
||||||
|
in_fixture = false;
|
||||||
|
in_subtest = true;
|
||||||
|
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
|
||||||
|
assert(do_fork() == 77);
|
||||||
|
|
||||||
|
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
|
||||||
|
assert(do_fork() == 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user