Commit a1ca8ef5 authored by Daniel Vetter's avatar Daniel Vetter

tests: use igt_exit() consistently with subtests

This is mostly important to get the SKIP reporting right, but I've
found a few stragglers that wanted to get converted over to the igt
result reporting completely.
Signed-off-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent ec283d6a
......@@ -90,5 +90,5 @@ int main(int argc, char **argv)
igt_subtest("create-fd-close")
test_create_fd_close(fd);
return 0;
igt_exit();
}
......@@ -366,5 +366,5 @@ main(int argc, char **argv)
for (i = 0; i < ARRAY_SIZE(access_modes); i++)
run_modes(&access_modes[i]);
return 0;
igt_exit();
}
......@@ -126,5 +126,5 @@ int main(int argc, char *argv[])
igt_subtest("blt")
igt_assert(exec(fd, handle, I915_EXEC_BLT, ctx_id) != 0);
igt_success();
igt_exit();
}
......@@ -260,5 +260,5 @@ int main(int argc, char **argv)
close(fd);
return 0;
igt_exit();
}
......@@ -229,5 +229,5 @@ int main(int argc, char **argv)
igt_enable_prefault();
}
return 0;
igt_exit();
}
......@@ -238,5 +238,5 @@ main(int argc, char **argv)
igt_subtest("bo-copy")
igt_assert(run_test(1, bo_copy, I915_TILING_X, 1) == 0);
return 0;
igt_exit();
}
......@@ -168,5 +168,5 @@ int main(int argc, char **argv)
igt_subtest("flink-lifetime")
test_flink_lifetime(fd);
return 0;
igt_exit();
}
......@@ -202,5 +202,5 @@ int main(int argc, char **argv)
igt_subtest("flink_close")
test_flink_close();
return 0;
igt_exit();
}
......@@ -272,5 +272,5 @@ int main(int argc, char **argv)
igt_stop_signal_helper();
}
return 0;
igt_exit();
}
......@@ -180,5 +180,5 @@ int main(int argc, char **argv)
close(fd);
return 0;
igt_exit();
}
......@@ -142,5 +142,5 @@ int main(int argc, char **argv)
close(fd);
return 0;
igt_exit();
}
......@@ -54,7 +54,6 @@ struct bo {
};
static const int width = 512, height = 512;
static bool skipped_all = true;
static void create_bo(drm_intel_bufmgr *bufmgr,
struct bo *b,
......@@ -122,7 +121,6 @@ static int check_ring(drm_intel_bufmgr *bufmgr,
int i;
snprintf(output, 100, "filling %s ring: ", ring);
skipped_all = false;
create_bo(bufmgr, &bo, ring);
......@@ -202,7 +200,7 @@ int main(int argc, char **argv)
drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
render_copyfunc_t copy;
int fd, fails = 0;
int fd;
igt_subtest_init(argc, argv);
igt_skip_on_simulation();
......@@ -214,22 +212,21 @@ int main(int argc, char **argv)
batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
igt_subtest("blitter")
fails += check_ring(bufmgr, batch, "blt", blt_copy);
check_ring(bufmgr, batch, "blt", blt_copy);
/* Strictly only required on architectures with a separate BLT ring,
* but lets stress everybody.
*/
copy = get_render_copyfunc(batch->devid);
igt_require(copy);
igt_subtest("render") {
if (copy)
fails += check_ring(bufmgr, batch, "render", copy);
}
igt_subtest("render")
check_ring(bufmgr, batch, "render", copy);
intel_batchbuffer_free(batch);
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
return skipped_all ? 77 : fails != 0;
igt_exit();
}
......@@ -272,5 +272,5 @@ int main(int argc, char **argv)
igt_assert(tiling_after == I915_TILING_X);
}
return 0;
igt_exit();
}
......@@ -112,5 +112,5 @@ int main(int argc, char **argv)
close(fd);
return 0;
igt_exit();
}
......@@ -233,5 +233,5 @@ int main(int argc, char **argv)
close(fd);
return 0;
igt_exit();
}
......@@ -316,5 +316,5 @@ int main(int argc, char **argv)
close(fd);
return 0;
igt_exit();
}
......@@ -1211,5 +1211,5 @@ int main(int argc, char **argv)
close(drm_fd);
return 0;
igt_exit();
}
......@@ -253,5 +253,5 @@ int main(int argc, char **argv)
if (!igt_only_list_subtests())
close(drm_fd);
return 0;
igt_exit();
}
......@@ -594,5 +594,5 @@ int main(int argc, char **argv)
close(intel_fd);
close(nouveau_fd);
return ret;
igt_exit();
}
......@@ -1265,7 +1265,7 @@ out:
int main(int argc, char **argv)
{
int ret, failed = 0, run = 0;
int ret;
igt_subtest_init(argc, argv);
......@@ -1296,14 +1296,8 @@ int main(int argc, char **argv)
batch = intel_batchbuffer_alloc(bufmgr, devid);
#define xtest(x, args...) \
igt_subtest( #x ) { \
ret = ((x)(args)); \
++run; \
if (ret) { \
++failed; \
fprintf(stderr, "prime_pcopy: failed " #x "\n"); \
} \
}
igt_subtest( #x ) \
igt_assert(((x)(args)) == 0); \
xtest(test1_macro);
xtest(test1_micro);
......@@ -1331,8 +1325,5 @@ int main(int argc, char **argv)
close(intel_fd);
close(nouveau_fd);
if (!igt_only_list_subtests())
printf("Tests: %u run, %u failed\n", run, failed);
return failed;
igt_exit();
}
......@@ -505,8 +505,7 @@ int main(int argc, char **argv)
#define xtest(name) \
igt_subtest(#name) \
if (test_##name()) \
igt_fail(2);
igt_assert(test_##name() == 0);
xtest(i915_nv_sharing);
xtest(nv_i915_sharing);
......@@ -525,5 +524,5 @@ int main(int argc, char **argv)
close(intel_fd);
close(nouveau_fd);
return ret;
igt_exit();
}
......@@ -387,5 +387,5 @@ int main(int argc, char **argv)
tests[i].fn();
}
return 0;
igt_exit();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment