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>
This commit is contained in:
Daniel Vetter
2013-08-14 13:47:47 +02:00
parent 1532af19d9
commit 6234658063
3 changed files with 18 additions and 16 deletions
+3 -8
View File
@@ -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();
}