diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-08-14 18:02:46 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-08-14 18:02:46 +0200 |
commit | b3880d3a969656b78fe246e5ca4dd5a4a2c70ef5 (patch) | |
tree | 471f1d9f81ec5299615cf59cb1787afac09a5367 /tests/gem_cs_tlb.c | |
parent | c3dd8a8c85b3e1a4329282cbe82fd7f387cd2643 (diff) |
tests: roll out igt_fixture
Also sprinkle igt_assert and igt_require over the setup code to clean
up code while at it. To avoid gcc getting upset about unitialized
variables just move them out of main as global data (where they always
get initialized to 0) - gcc can't see through our igt_fixture and
igt_subtest maze properly.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gem_cs_tlb.c')
-rw-r--r-- | tests/gem_cs_tlb.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/gem_cs_tlb.c b/tests/gem_cs_tlb.c index d4fbabc3..45e8b724 100644 --- a/tests/gem_cs_tlb.c +++ b/tests/gem_cs_tlb.c @@ -145,16 +145,17 @@ static void run_on_ring(int fd, unsigned ring_id, const char *ring_name) } +int fd; + int main(int argc, char **argv) { - int fd; igt_subtest_init(argc, argv); igt_skip_on_simulation(); - fd = drm_open_any(); + igt_fixture { + fd = drm_open_any(); - if (!igt_only_list_subtests()) { /* This test is very sensitive to residual gtt_mm noise from previous * tests. Try to quiet thing down first. */ gem_quiescent_gpu(fd); @@ -173,7 +174,8 @@ int main(int argc, char **argv) igt_subtest("vebox") run_on_ring(fd, LOCAL_I915_EXEC_VEBOX, "vebox"); - close(fd); + igt_fixture + close(fd); igt_exit(); } |