summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-06-17 16:04:09 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-06-17 16:04:09 +0200
commitbe21fc064b6d9ded5ccae7205204c0d5a03cf9e5 (patch)
treec2d69d5b4d1704a4a2439f6a3708df6a419dfbf1
parente63a0681d95a7288faff19a624548f96dbc73341 (diff)
tests: Push igt_fork/stop_hang_detector into fixtures
It access hardware, hence why the simple igt_only_list_subtests() check from igt_fork/stop_signal_helper() isn't enough. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rw-r--r--lib/igt_aux.c6
-rw-r--r--tests/gem_concurrent_all.c6
-rw-r--r--tests/gem_ctx_create.c10
-rw-r--r--tests/gem_ctx_switch.c7
-rw-r--r--tests/gem_evict_everything.c4
-rw-r--r--tests/gem_exec_basic.c11
-rw-r--r--tests/gem_exec_create.c10
-rw-r--r--tests/gem_exec_flush.c10
-rw-r--r--tests/gem_exec_gttfill.c6
-rw-r--r--tests/gem_exec_nop.c7
-rw-r--r--tests/gem_exec_parallel.c11
-rw-r--r--tests/gem_exec_store.c11
-rw-r--r--tests/gem_exec_suspend.c11
-rw-r--r--tests/gem_exec_whisper.c11
-rw-r--r--tests/gem_sync.c11
15 files changed, 66 insertions, 66 deletions
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 27b74aec..e64b29cc 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -403,9 +403,6 @@ void igt_fork_hang_detector(int fd)
{
struct stat st;
- if (igt_only_list_subtests())
- return;
-
igt_assert(fstat(fd, &st) == 0);
signal(SIGRTMAX, sig_abort);
@@ -415,9 +412,6 @@ void igt_fork_hang_detector(int fd)
void igt_stop_hang_detector(void)
{
- if (igt_only_list_subtests())
- return;
-
igt_stop_helper(&hang_detector);
}
#else
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c
index 019628ed..9b19455b 100644
--- a/tests/gem_concurrent_all.c
+++ b/tests/gem_concurrent_all.c
@@ -1432,7 +1432,8 @@ run_mode(const char *prefix,
continue;
if (!*h->suffix)
- igt_fork_hang_detector(fd);
+ igt_fixture
+ igt_fork_hang_detector(fd);
for (p = all ? pipelines : pskip; p->prefix; p++) {
igt_fixture p->require();
@@ -1563,7 +1564,8 @@ run_mode(const char *prefix,
}
if (!*h->suffix)
- igt_stop_hang_detector();
+ igt_fixture
+ igt_stop_hang_detector();
}
igt_fixture
diff --git a/tests/gem_ctx_create.c b/tests/gem_ctx_create.c
index 0bdd4082..021cfa24 100644
--- a/tests/gem_ctx_create.c
+++ b/tests/gem_ctx_create.c
@@ -160,9 +160,9 @@ igt_main
}
} else
ppgtt_engines[ppgtt_nengine++] = 0;
- }
- igt_fork_hang_detector(fd);
+ igt_fork_hang_detector(fd);
+ }
igt_subtest("basic") {
memset(&create, 0, sizeof(create));
@@ -193,8 +193,8 @@ igt_main
active(fd, e->exec_id | e->flags, 20, ncpus);
}
- igt_stop_hang_detector();
-
- igt_fixture
+ igt_fixture {
+ igt_stop_hang_detector();
close(fd);
+ }
}
diff --git a/tests/gem_ctx_switch.c b/tests/gem_ctx_switch.c
index 7b273368..aa48a168 100644
--- a/tests/gem_ctx_switch.c
+++ b/tests/gem_ctx_switch.c
@@ -152,9 +152,9 @@ igt_main
fd = drm_open_driver(DRIVER_INTEL);
handle = gem_create(fd, 4096);
gem_write(fd, handle, 0, &bbe, sizeof(bbe));
- }
- igt_fork_hang_detector(fd);
+ igt_fork_hang_detector(fd);
+ }
for (e = intel_execution_engines; e->name; e++) {
igt_subtest_f("%s%s", e->exec_id == 0 ? "basic-" : "", e->name)
@@ -167,9 +167,8 @@ igt_main
single(fd, handle, e, INTERRUPTIBLE, ncpus);
}
- igt_stop_hang_detector();
-
igt_fixture {
+ igt_stop_hang_detector();
gem_close(fd, handle);
close(fd);
}
diff --git a/tests/gem_evict_everything.c b/tests/gem_evict_everything.c
index 61ee5479..51ed2931 100644
--- a/tests/gem_evict_everything.c
+++ b/tests/gem_evict_everything.c
@@ -266,10 +266,10 @@ igt_main
test_major_evictions(fd, size, count);
}
- igt_stop_hang_helper();
+ igt_stop_signal_helper();
igt_fixture {
- igt_stop_signal_helper();
+ igt_stop_hang_helper();
close(fd);
}
}
diff --git a/tests/gem_exec_basic.c b/tests/gem_exec_basic.c
index b0a4cda2..5f0f33b8 100644
--- a/tests/gem_exec_basic.c
+++ b/tests/gem_exec_basic.c
@@ -104,10 +104,11 @@ igt_main
const struct intel_execution_engine *e;
int fd = -1;
- igt_fixture
+ igt_fixture {
fd = drm_open_driver(DRIVER_INTEL);
- igt_fork_hang_detector(fd);
+ igt_fork_hang_detector(fd);
+ }
for (e = intel_execution_engines; e->name; e++) {
igt_subtest_f("basic-%s", e->name)
@@ -118,8 +119,8 @@ igt_main
gtt(fd, e->exec_id | e->flags);
}
- igt_stop_hang_detector();
-
- igt_fixture
+ igt_fixture {
+ igt_stop_hang_detector();
close(fd);
+ }
}
diff --git a/tests/gem_exec_create.c b/tests/gem_exec_create.c
index f5a61bac..6e01947c 100644
--- a/tests/gem_exec_create.c
+++ b/tests/gem_exec_create.c
@@ -150,10 +150,11 @@ igt_main
const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
int device = -1;
- igt_fixture
+ igt_fixture {
device = drm_open_driver(DRIVER_INTEL);
- igt_fork_hang_detector(device);
+ igt_fork_hang_detector(device);
+ }
igt_subtest("basic")
all(device, 0, 20, 1);
@@ -163,8 +164,9 @@ igt_main
igt_subtest("madvise")
all(device, LEAK, 20, 1);
- igt_stop_hang_detector();
- igt_fixture
+ igt_fixture {
+ igt_stop_hang_detector();
close(device);
+ }
}
diff --git a/tests/gem_exec_flush.c b/tests/gem_exec_flush.c
index e4207895..c16638b8 100644
--- a/tests/gem_exec_flush.c
+++ b/tests/gem_exec_flush.c
@@ -519,9 +519,9 @@ igt_main
gem_require_mmap_wc(fd);
gen = intel_gen(intel_get_drm_devid(fd));
igt_info("Has LLC? %s\n", yesno(gem_has_llc(fd)));
- }
- igt_fork_hang_detector(fd);
+ igt_fork_hang_detector(fd);
+ }
for (e = intel_execution_engines; e->name; e++) igt_subtest_group {
unsigned ring = e->exec_id | e->flags;
@@ -593,8 +593,8 @@ igt_main
}
}
- igt_stop_hang_detector();
-
- igt_fixture
+ igt_fixture {
+ igt_stop_hang_detector();
close(fd);
+ }
}
diff --git a/tests/gem_exec_gttfill.c b/tests/gem_exec_gttfill.c
index 5966125c..3ec43dcf 100644
--- a/tests/gem_exec_gttfill.c
+++ b/tests/gem_exec_gttfill.c
@@ -196,10 +196,9 @@ igt_main
igt_fixture {
device = drm_open_driver(DRIVER_INTEL);
+ igt_fork_hang_detector(device);
}
- igt_fork_hang_detector(device);
-
igt_subtest("basic")
fillgtt(device, 0, 1); /* just enough to run a single pass */
@@ -210,9 +209,8 @@ igt_main
igt_subtest("all")
fillgtt(device, 0, 150);
- igt_stop_hang_detector();
-
igt_fixture {
+ igt_stop_hang_detector();
close(device);
}
}
diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c
index e90d5eba..9e5aab50 100644
--- a/tests/gem_exec_nop.c
+++ b/tests/gem_exec_nop.c
@@ -208,9 +208,9 @@ igt_main
device = drm_open_driver(DRIVER_INTEL);
handle = gem_create(device, 4096);
gem_write(device, handle, 0, &bbe, sizeof(bbe));
- }
- igt_fork_hang_detector(device);
+ igt_fork_hang_detector(device);
+ }
igt_subtest("basic")
all(device, handle, 10);
@@ -222,9 +222,8 @@ igt_main
igt_subtest("all")
all(device, handle, 150);
- igt_stop_hang_detector();
-
igt_fixture {
+ igt_stop_hang_detector();
gem_close(device, handle);
close(device);
}
diff --git a/tests/gem_exec_parallel.c b/tests/gem_exec_parallel.c
index 2c04ca16..6532797a 100644
--- a/tests/gem_exec_parallel.c
+++ b/tests/gem_exec_parallel.c
@@ -267,10 +267,11 @@ igt_main
};
int fd;
- igt_fixture
+ igt_fixture {
fd = drm_open_driver_master(DRIVER_INTEL);
- igt_fork_hang_detector(fd);
+ igt_fork_hang_detector(fd);
+ }
for (const struct mode *m = modes; m->name; m++)
igt_subtest_f("%s", *m->name ? m->name : "basic")
@@ -286,8 +287,8 @@ igt_main
all(fd, e->exec_id | e->flags, m->flags);
}
- igt_stop_hang_detector();
-
- igt_fixture
+ igt_fixture {
+ igt_stop_hang_detector();
close(fd);
+ }
}
diff --git a/tests/gem_exec_store.c b/tests/gem_exec_store.c
index ae752425..cd852e60 100644
--- a/tests/gem_exec_store.c
+++ b/tests/gem_exec_store.c
@@ -213,10 +213,11 @@ igt_main
const struct intel_execution_engine *e;
int fd;
- igt_fixture
+ igt_fixture {
fd = drm_open_driver_master(DRIVER_INTEL);
- igt_fork_hang_detector(fd);
+ igt_fork_hang_detector(fd);
+ }
for (e = intel_execution_engines; e->name; e++)
igt_subtest_f("basic-%s", e->name)
@@ -225,8 +226,8 @@ igt_main
igt_subtest("basic-all")
store_all(fd);
- igt_stop_hang_detector();
-
- igt_fixture
+ igt_fixture {
+ igt_stop_hang_detector();
close(fd);
+ }
}
diff --git a/tests/gem_exec_suspend.c b/tests/gem_exec_suspend.c
index cd133cc5..a45082ea 100644
--- a/tests/gem_exec_suspend.c
+++ b/tests/gem_exec_suspend.c
@@ -238,10 +238,11 @@ igt_main
const struct intel_execution_engine *e;
int fd;
- igt_fixture
+ igt_fixture {
fd = drm_open_driver_master(DRIVER_INTEL);
- igt_fork_hang_detector(fd);
+ igt_fork_hang_detector(fd);
+ }
igt_subtest("basic")
run_test(fd, -1, NOSLEEP);
@@ -261,8 +262,8 @@ igt_main
}
}
- igt_stop_hang_detector();
-
- igt_fixture
+ igt_fixture {
+ igt_stop_hang_detector();
close(fd);
+ }
}
diff --git a/tests/gem_exec_whisper.c b/tests/gem_exec_whisper.c
index 0b309234..24c258f6 100644
--- a/tests/gem_exec_whisper.c
+++ b/tests/gem_exec_whisper.c
@@ -390,10 +390,11 @@ igt_main
};
int fd;
- igt_fixture
+ igt_fixture {
fd = drm_open_driver_master(DRIVER_INTEL);
- igt_fork_hang_detector(fd);
+ igt_fork_hang_detector(fd);
+ }
for (const struct mode *m = modes; m->name; m++)
igt_subtest_f("%s", m->name)
@@ -410,8 +411,8 @@ igt_main
}
}
- igt_stop_hang_detector();
-
- igt_fixture
+ igt_fixture {
+ igt_stop_hang_detector();
close(fd);
+ }
}
diff --git a/tests/gem_sync.c b/tests/gem_sync.c
index 320bce33..937c6eb2 100644
--- a/tests/gem_sync.c
+++ b/tests/gem_sync.c
@@ -209,10 +209,11 @@ igt_main
igt_skip_on_simulation();
- igt_fixture
+ igt_fixture {
fd = drm_open_driver(DRIVER_INTEL);
- igt_fork_hang_detector(fd);
+ igt_fork_hang_detector(fd);
+ }
for (e = intel_execution_engines; e->name; e++) {
igt_subtest_f("%s", e->name)
@@ -231,8 +232,8 @@ igt_main
igt_subtest("forked-all")
sync_all(fd, ncpus);
- igt_stop_hang_detector();
-
- igt_fixture
+ igt_fixture {
+ igt_stop_hang_detector();
close(fd);
+ }
}