From 9360df4ab33697b6a64ed8ec05d84564c784d607 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 3 Jul 2013 08:47:34 +0200 Subject: [PATCH] tests/gem_linear|tiled_blits: convert to subtests Finer granularity for nightly runs and regression reporting is always nice. Signed-off-by: Daniel Vetter --- tests/Makefile.am | 4 ++-- tests/gem_linear_blits.c | 45 +++++++++++++++++++++++++-------------------- tests/gem_tiled_blits.c | 47 ++++++++++++++++++++++++++--------------------- 3 files changed, 53 insertions(+), 43 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 3f301c9..a422899 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,10 +26,12 @@ TESTS_progs_M = \ gem_fence_thrash \ gem_flink \ gem_gtt_concurrent_blit \ + gem_linear_blits \ gem_mmap_gtt \ gem_partial_pwrite_pread \ gem_ringfill \ gem_set_tiling_vs_blt \ + gem_tiled_blits \ gem_tiled_partial_pwrite_pread \ $(NOUVEAU_TESTS_M) \ kms_flip \ @@ -58,11 +60,9 @@ TESTS_progs = \ gem_tiled_pread \ gem_tiled_pread_pwrite \ gem_tiled_swapping \ - gem_linear_blits \ gem_vmap_blits \ gem_threaded_access_tiled \ gem_seqno_wrap \ - gem_tiled_blits \ gem_tiled_fence_blits \ gem_largeobject \ gem_bad_length \ diff --git a/tests/gem_linear_blits.c b/tests/gem_linear_blits.c index 4a6e506..617bcef 100644 --- a/tests/gem_linear_blits.c +++ b/tests/gem_linear_blits.c @@ -238,33 +238,38 @@ static void run_test(int fd, int count) int main(int argc, char **argv) { - int fd, count; + int fd, count = 0; + + drmtest_subtest_init(argc, argv); fd = drm_open_any(); - count = 0; - if (argc > 1) - count = atoi(argv[1]); - if (count == 0) - count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; - else if (count < 2) { - fprintf(stderr, "count must be >= 2\n"); - return 1; - } + if (!drmtest_only_list_subtests()) { + if (argc > 1) + count = atoi(argv[1]); + if (count == 0) + count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; + else if (count < 2) { + fprintf(stderr, "count must be >= 2\n"); + return 1; + } - if (count > intel_get_total_ram_mb() * 9 / 10) { - count = intel_get_total_ram_mb() * 9 / 10; - printf("not enough RAM to run test, reducing buffer count\n"); - } + if (count > intel_get_total_ram_mb() * 9 / 10) { + count = intel_get_total_ram_mb() * 9 / 10; + printf("not enough RAM to run test, reducing buffer count\n"); + } - printf("Using %d 1MiB buffers\n", count); + printf("Using %d 1MiB buffers\n", count); + } - run_test(fd, count); + if (drmtest_run_subtest("normal")) + run_test(fd, count); - /* and repeat under the rude interrupter */ - drmtest_fork_signal_helper(); - run_test(fd, count); - drmtest_stop_signal_helper(); + if (drmtest_run_subtest("interrutible")) { + drmtest_fork_signal_helper(); + run_test(fd, count); + drmtest_stop_signal_helper(); + } return 0; } diff --git a/tests/gem_tiled_blits.c b/tests/gem_tiled_blits.c index 34b96fd..a4a6f23 100644 --- a/tests/gem_tiled_blits.c +++ b/tests/gem_tiled_blits.c @@ -185,39 +185,44 @@ static void run_test(int count) int main(int argc, char **argv) { - int fd, count; + int fd, count = 0; + + drmtest_subtest_init(argc, argv); fd = drm_open_any(); - count = 0; - if (argc > 1) - count = atoi(argv[1]); - if (count == 0) { - count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; - count += (count & 1) == 0; - } else if (count < 2) { - fprintf(stderr, "count must be >= 2\n"); - return 1; - } + if (!drmtest_only_list_subtests()) { + if (argc > 1) + count = atoi(argv[1]); + if (count == 0) { + count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; + count += (count & 1) == 0; + } else if (count < 2) { + fprintf(stderr, "count must be >= 2\n"); + return 1; + } - if (count > intel_get_total_ram_mb() * 9 / 10) { - count = intel_get_total_ram_mb() * 9 / 10; - printf("not enough RAM to run test, reducing buffer count\n"); - } + if (count > intel_get_total_ram_mb() * 9 / 10) { + count = intel_get_total_ram_mb() * 9 / 10; + printf("not enough RAM to run test, reducing buffer count\n"); + } - printf("Using %d 1MiB buffers\n", count); + printf("Using %d 1MiB buffers\n", count); + } bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); drm_intel_bufmgr_gem_set_vma_cache_size(bufmgr, 32); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); - run_test(count); + if (drmtest_run_subtest("normal")) + run_test(count); - /* and again whilst being rudely interrupted */ - drmtest_fork_signal_helper(); - run_test(count); - drmtest_stop_signal_helper(); + if (drmtest_run_subtest("interrutible")) { + drmtest_fork_signal_helper(); + run_test(count); + drmtest_stop_signal_helper(); + } intel_batchbuffer_free(batch); drm_intel_bufmgr_destroy(bufmgr); -- 2.7.4