From 740065f0f9cd8f5add5520e6b3db6b02befee0a9 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 12 Aug 2013 09:49:25 +0200 Subject: tests/gem_caching: convert to use drmtest retval infrastructure Signed-off-by: Daniel Vetter --- tests/gem_caching.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/gem_caching.c b/tests/gem_caching.c index d67bbf6b..259662f5 100644 --- a/tests/gem_caching.c +++ b/tests/gem_caching.c @@ -110,7 +110,6 @@ int main(int argc, char **argv) int i, j; uint8_t *cpu_ptr; uint8_t *gtt_ptr; - bool skipped_all = true; drmtest_subtest_init(argc, argv); drmtest_skip_on_simulation(); @@ -145,9 +144,11 @@ int main(int argc, char **argv) drmtest_init_aperture_trashers(bufmgr); mappable_gtt_limit = gem_mappable_aperture_size(); - if (drmtest_run_subtest("reads") && (flags & TEST_READ)) { + drmtest_subtest_block("reads") { + if (!(flags & TEST_READ)) + drmtest_skip(); + printf("checking partial reads\n"); - skipped_all = false; for (i = 0; i < ROUNDS; i++) { uint8_t val0 = i; @@ -173,9 +174,11 @@ int main(int argc, char **argv) } } - if (drmtest_run_subtest("writes") && (flags & TEST_WRITE)) { + drmtest_subtest_block("writes") { + if (!(flags & TEST_WRITE)) + drmtest_skip(); + printf("checking partial writes\n"); - skipped_all = false; for (i = 0; i < ROUNDS; i++) { uint8_t val0 = i, val1; @@ -223,9 +226,11 @@ int main(int argc, char **argv) } } - if (drmtest_run_subtest("read-writes") && (flags & TEST_BOTH) == TEST_BOTH) { + drmtest_subtest_block("read-writes") { + if (!((flags & TEST_BOTH) == TEST_BOTH)) + drmtest_skip(); + printf("checking partial writes after partial reads\n"); - skipped_all = false; for (i = 0; i < ROUNDS; i++) { uint8_t val0 = i, val1, val2; @@ -299,5 +304,5 @@ int main(int argc, char **argv) close(fd); - return skipped_all ? 77 : 0; + return drmtest_retval(); } -- cgit v1.2.3