tests/gem_exec_reloc: Call igt_(dis)allow_hang inside subtest block
PATCH 1/1 tests/gem_exec_reloc: Call igt_(dis)allow_hang inside subtest block
gem_exec_reloc --list-subtests breaks otherwise.
--- tests/gem_exec_reloc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
tests/gem_exec_reloc.c +8 -7
@@ -550,19 +550,20 @@ igt_mainfor (f = flags; f->name; f++) {igt_hang_t hang; -if (f->flags &HANG ) - hang =igt_allow_hang (fd,0 ,0 ); -for (m = modes; m->name; m++) {igt_subtest_f ("%s%s%s" , f->basic ?"basic-" :"" , m->name, - f->name) + f->name) { +if (f->flags &HANG ) + hang =igt_allow_hang (fd,0 ,0 ); +basic_reloc (fd, m->before, m->after, f->flags); - } -if (f->flags &HANG ) -igt_disallow_hang (fd, hang); +if (f->flags &HANG ) +igt_disallow_hang (fd, hang); + } + } }igt_subtest ("basic-softpin" )
Signature · 6 lines
2.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 13 lines · Petri Latvala
gem_exec_reloc--list-subtests breaks otherwise.CC Chris Wilson <[email protected]>Signed-off-by Petri Latvala <[email protected]>--- tests/gem_exec_reloc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)tests/gem_exec_reloc.c +0
-0
tests/gem_exec_reloc.c igt_main · line 555
Quoted 6 lines
tests/gem_exec_reloc.c +0
-3@@ -550,19 +550,20 @@ igt_mainfor (f = flags; f->name; f++) {igt_hang_t hang; -if (f->flags &HANG ) - hang =igt_allow_hang (fd,0 ,0 ); -
I keep forgetting what can and can't be called outside of igt_subtest. Ok, I keep forgetting that we can't call everything outside of a fixture.
In this case, doing a
igt_subtest_group {
igt_fixture {
if (f->flags & HANG)
hang = igt_allow_hang(fd, 0, 0);
}
....
igt_fixture {
if (f->flags & HANG)
igt_disallow_hang(fd, hang);
}
}might allow for future expansion more easily, and the subtest grouping will help error recovery between different combinations. -Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 tests/gem_exec_reloc: Don't call igt_(dis)allow_hang outside fixtures
gem_exec_reloc --list-subtests breaks otherwise.
v2: use igt_subtest_group (Chris)
--- tests/gem_exec_reloc.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-)
tests/gem_exec_reloc.c +18 -12
@@ -550,19 +550,25 @@ igt_mainfor (f = flags; f->name; f++) {igt_hang_t hang; -if (f->flags &HANG ) - hang =igt_allow_hang (fd,0 ,0 ); - -for (m = modes; m->name; m++) { -igt_subtest_f ("%s%s%s" , - f->basic ?"basic-" :"" , - m->name, - f->name) -basic_reloc (fd, m->before, m->after, f->flags); + igt_subtest_group { + igt_fixture { +if (f->flags &HANG ) + hang =igt_allow_hang (fd,0 ,0 ); + } + +for (m = modes; m->name; m++) { +igt_subtest_f ("%s%s%s" , + f->basic ?"basic-" :"" , + m->name, + f->name) +basic_reloc (fd, m->before, m->after, f->flags); + } + + igt_fixture { +if (f->flags &HANG ) +igt_disallow_hang (fd, hang); + } } - -if (f->flags &HANG ) -igt_disallow_hang (fd, hang); }igt_subtest ("basic-softpin" )
Signature · 6 lines
2.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH i-g-t] tests/gem_exec_reloc: Don't call igt_(dis)allow_hang outside fixtures
Quoted 6 lines · Petri Latvala
gem_exec_reloc--list-subtests breaks otherwise.v2: use
igt_subtest_group(Chris)CC Chris Wilson <[email protected]>Signed-off-by Petri Latvala <[email protected]>
Lgtm, thanks.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx