summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-14 13:47:47 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-14 13:47:47 +0200
commit6234658063b4080778c34228a444e96eb901279f (patch)
tree90bae911b39c7f00ea625fc0ba9b6ff3856afa99 /tests
parent1532af19d9bf962412bb150393aa10d13fae91d6 (diff)
tests: add igt_subtest_f for snprintf'ing testnames
Useful when stitching together combinatorial testnames. v2: - ## rules are just fun. We need 2 indirections to actually get __LINE__ to properly expand. - Kill stray ; which botched the logic. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_partial_pwrite_pread.c11
-rw-r--r--tests/gem_write_read_ring_switch.c12
2 files changed, 7 insertions, 16 deletions
diff --git a/tests/gem_partial_pwrite_pread.c b/tests/gem_partial_pwrite_pread.c
index ce2f1c81..814c552b 100644
--- a/tests/gem_partial_pwrite_pread.c
+++ b/tests/gem_partial_pwrite_pread.c
@@ -254,21 +254,16 @@ static void test_partial_read_writes(void)
static void do_tests(int cache_level, const char *suffix)
{
- char name[80];
-
if (cache_level != -1)
gem_set_caching(fd, scratch_bo->handle, cache_level);
- snprintf(name, sizeof(name), "reads%s", suffix);
- igt_subtest(name)
+ igt_subtest_f("reads%s", suffix)
test_partial_reads();
- snprintf(name, sizeof(name), "writes%s", suffix);
- igt_subtest(name)
+ igt_subtest_f("write%s", suffix)
test_partial_writes();
- snprintf(name, sizeof(name), "writes-after-reads%s", suffix);
- igt_subtest(name)
+ igt_subtest_f("writes-after-reads%s", suffix)
test_partial_read_writes();
}
diff --git a/tests/gem_write_read_ring_switch.c b/tests/gem_write_read_ring_switch.c
index 21eef64a..b7efac3f 100644
--- a/tests/gem_write_read_ring_switch.c
+++ b/tests/gem_write_read_ring_switch.c
@@ -56,7 +56,7 @@ int fd;
*/
#define COLOR 0xffffffff
-static void run_test(int ring, const char *testname)
+static void run_test(int ring)
{
uint32_t *ptr;
int i;
@@ -66,8 +66,6 @@ static void run_test(int ring, const char *testname)
if (ring == I915_EXEC_RENDER)
gem_require_ring(fd, I915_EXEC_BLT);
- printf("running subtest %s\n", testname);
-
target_bo = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096);
if (!target_bo) {
fprintf(stderr, "failed to alloc target buffer\n");
@@ -194,15 +192,13 @@ int main(int argc, char **argv)
for (i = 0; i < ARRAY_SIZE(tests); i++) {
igt_subtest(tests[i].name)
- run_test(tests[i].ring, tests[i].name);
+ run_test(tests[i].ring);
}
igt_fork_signal_helper();
for (i = 0; i < ARRAY_SIZE(tests); i++) {
- char name[180];
- snprintf(name, sizeof(name), "%s-interruptible", tests[i].name);
- igt_subtest(name)
- run_test(tests[i].ring, name);
+ igt_subtest_f("%s-interruptible", tests[i].name)
+ run_test(tests[i].ring);
}
igt_stop_signal_helper();