diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-07-03 08:47:34 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-07-03 08:47:34 +0200 |
commit | 9360df4ab33697b6a64ed8ec05d84564c784d607 (patch) | |
tree | a10b10ca04fb99e0d7d82f64b62fef32ecb1eb09 /tests/gem_linear_blits.c | |
parent | bc388b54d4325669bfffef314c6f18349c239a1c (diff) |
tests/gem_linear|tiled_blits: convert to subtests
Finer granularity for nightly runs and regression reporting is always
nice.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gem_linear_blits.c')
-rw-r--r-- | tests/gem_linear_blits.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/tests/gem_linear_blits.c b/tests/gem_linear_blits.c index 4a6e5064..617bcef2 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; } |