summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-31 16:23:26 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-11-01 21:10:59 +0100
commit071e9ca1ca4424ba35edec0246918efdd0528d76 (patch)
tree7606357a8f0116d17f2e30a74b274796ba83f3d8 /tests
parent223a61e12e119d96484ed05c563d1781fd613a4e (diff)
lib: add igt_main macro
In the past new testcases with subtest often forgot to add the call to igt_exit at the end of their main() function. That is now caught with a bit more obnoxious asserts, but it's still a nuissance. This little igt_main macro takes care of that (and also of calling the subtest machinery initialization code correctly). If no one objects I'll roll this out for all the simple cases (i.e. those tests that don't have additional argv parsing on top of the subtest machinery). v2: Roll it out across the board. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests')
-rw-r--r--tests/debugfs_pipe_crc.c6
-rw-r--r--tests/gem_basic.c6
-rw-r--r--tests/gem_caching.c5
-rw-r--r--tests/gem_close_race.c5
-rw-r--r--tests/gem_concurrent_blit.c6
-rw-r--r--tests/gem_cs_tlb.c5
-rw-r--r--tests/gem_ctx_bad_exec.c5
-rw-r--r--tests/gem_dummy_reloc_loop.c6
-rw-r--r--tests/gem_evict_alignment.c6
-rw-r--r--tests/gem_evict_everything.c6
-rw-r--r--tests/gem_exec_bad_domains.c6
-rw-r--r--tests/gem_exec_faulting_reloc.c6
-rw-r--r--tests/gem_exec_nop.c6
-rw-r--r--tests/gem_fence_thrash.c6
-rw-r--r--tests/gem_fenced_exec_thrash.c7
-rw-r--r--tests/gem_flink.c6
-rw-r--r--tests/gem_flink_race.c6
-rw-r--r--tests/gem_mmap.c6
-rw-r--r--tests/gem_mmap_gtt.c6
-rw-r--r--tests/gem_partial_pwrite_pread.c5
-rw-r--r--tests/gem_persistent_relocs.c5
-rw-r--r--tests/gem_pipe_control_store_loop.c6
-rw-r--r--tests/gem_pread_after_blit.c6
-rw-r--r--tests/gem_readwrite.c5
-rw-r--r--tests/gem_reloc_overflow.c6
-rw-r--r--tests/gem_reloc_vs_gpu.c5
-rw-r--r--tests/gem_ringfill.c6
-rw-r--r--tests/gem_set_tiling_vs_blt.c5
-rw-r--r--tests/gem_storedw_batches_loop.c5
-rw-r--r--tests/gem_suspend.c6
-rw-r--r--tests/gem_tiled_partial_pwrite_pread.c5
-rw-r--r--tests/gem_write_read_ring_switch.c5
-rw-r--r--tests/kms_addfb.c6
-rw-r--r--tests/kms_cursor_crc.c5
-rw-r--r--tests/kms_render.c5
-rw-r--r--tests/prime_nv_api.c6
-rw-r--r--tests/prime_nv_pcopy.c6
-rw-r--r--tests/prime_nv_test.c6
-rw-r--r--tests/prime_self_import.c6
39 files changed, 39 insertions, 182 deletions
diff --git a/tests/debugfs_pipe_crc.c b/tests/debugfs_pipe_crc.c
index debc172f..25452331 100644
--- a/tests/debugfs_pipe_crc.c
+++ b/tests/debugfs_pipe_crc.c
@@ -206,12 +206,10 @@ static void test_read_crc(data_t *data, int pipe, unsigned flags)
}
-int main(int argc, char **argv)
+igt_main
{
data_t data = {0, };
- igt_subtest_init(argc, argv);
-
igt_skip_on_simulation();
igt_fixture {
@@ -261,6 +259,4 @@ int main(int argc, char **argv)
display_fini(&data);
fclose(data.ctl);
}
-
- igt_exit();
}
diff --git a/tests/gem_basic.c b/tests/gem_basic.c
index 19065b1e..5d8f8406 100644
--- a/tests/gem_basic.c
+++ b/tests/gem_basic.c
@@ -77,10 +77,8 @@ test_create_fd_close(int fd)
int fd;
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_fixture
fd = drm_open_any();
@@ -90,6 +88,4 @@ int main(int argc, char **argv)
test_create_close(fd);
igt_subtest("create-fd-close")
test_create_fd_close(fd);
-
- igt_exit();
}
diff --git a/tests/gem_caching.c b/tests/gem_caching.c
index 6c1d9415..10ac7a4c 100644
--- a/tests/gem_caching.c
+++ b/tests/gem_caching.c
@@ -103,14 +103,13 @@ blt_bo_fill(drm_intel_bo *tmp_bo, drm_intel_bo *bo, uint8_t val)
#define TEST_READ 0x1
#define TEST_WRITE 0x2
#define TEST_BOTH (TEST_READ | TEST_WRITE)
-int main(int argc, char **argv)
+igt_main
{
unsigned flags = TEST_BOTH;
int i, j;
uint8_t *cpu_ptr;
uint8_t *gtt_ptr;
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -284,6 +283,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_close_race.c b/tests/gem_close_race.c
index db7cd1f0..6064c026 100644
--- a/tests/gem_close_race.c
+++ b/tests/gem_close_race.c
@@ -209,10 +209,9 @@ static void *thread_busy(void *_data)
return 0;
}
-int main(int argc, char *argv[])
+igt_main
{
igt_skip_on_simulation();
- igt_subtest_init(argc, argv);
sprintf(device, "/dev/dri/card%d", drm_get_card());
{
@@ -263,6 +262,4 @@ int main(int argc, char *argv[])
close(data->fds[n]);
free(data);
}
-
- igt_exit();
}
diff --git a/tests/gem_concurrent_blit.c b/tests/gem_concurrent_blit.c
index 0e20abfc..fb56c257 100644
--- a/tests/gem_concurrent_blit.c
+++ b/tests/gem_concurrent_blit.c
@@ -354,12 +354,10 @@ run_modes(struct access_mode *mode)
run_basic_modes(mode, src, dst, dummy, "-forked", run_forked);
}
-int
-main(int argc, char **argv)
+igt_main
{
int max, i;
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -372,6 +370,4 @@ main(int argc, char **argv)
for (i = 0; i < ARRAY_SIZE(access_modes); i++)
run_modes(&access_modes[i]);
-
- igt_exit();
}
diff --git a/tests/gem_cs_tlb.c b/tests/gem_cs_tlb.c
index 490b6d3c..6f1fd5b5 100644
--- a/tests/gem_cs_tlb.c
+++ b/tests/gem_cs_tlb.c
@@ -145,10 +145,9 @@ static void run_on_ring(int fd, unsigned ring_id, const char *ring_name)
int fd;
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -174,6 +173,4 @@ int main(int argc, char **argv)
igt_fixture
close(fd);
-
- igt_exit();
}
diff --git a/tests/gem_ctx_bad_exec.c b/tests/gem_ctx_bad_exec.c
index c60e6938..3f6f34d0 100644
--- a/tests/gem_ctx_bad_exec.c
+++ b/tests/gem_ctx_bad_exec.c
@@ -85,10 +85,9 @@ uint32_t batch[2] = {MI_BATCH_BUFFER_END};
uint32_t ctx_id;
int fd;
-int main(int argc, char *argv[])
+igt_main
{
igt_skip_on_simulation();
- igt_subtest_init(argc, argv);
igt_fixture {
fd = drm_open_any_render();
@@ -110,6 +109,4 @@ int main(int argc, char *argv[])
igt_subtest("vebox")
igt_assert(exec(fd, handle, I915_EXEC_VEBOX, ctx_id) != 0);
#endif
-
- igt_exit();
}
diff --git a/tests/gem_dummy_reloc_loop.c b/tests/gem_dummy_reloc_loop.c
index 73eab895..955de96f 100644
--- a/tests/gem_dummy_reloc_loop.c
+++ b/tests/gem_dummy_reloc_loop.c
@@ -127,10 +127,8 @@ int fd;
int devid;
int num_rings;
-int main(int argc, char **argv)
+igt_main
{
-
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -199,6 +197,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_evict_alignment.c b/tests/gem_evict_alignment.c
index 57eb5860..50f241c0 100644
--- a/tests/gem_evict_alignment.c
+++ b/tests/gem_evict_alignment.c
@@ -177,12 +177,10 @@ static void major_evictions(int fd, int size, int count)
int fd;
-int main(int argc, char **argv)
+igt_main
{
int size, count;
- igt_subtest_init(argc, argv);
-
igt_skip_on_simulation();
igt_fixture
@@ -216,6 +214,4 @@ int main(int argc, char **argv)
igt_fixture
close(fd);
-
- igt_exit();
}
diff --git a/tests/gem_evict_everything.c b/tests/gem_evict_everything.c
index ae856b05..dbf1582a 100644
--- a/tests/gem_evict_everything.c
+++ b/tests/gem_evict_everything.c
@@ -296,14 +296,12 @@ static void major_evictions(int fd, int size, int count)
free(bo);
}
-int main(int argc, char **argv)
+igt_main
{
int size, count, fd;
size = count = 0;
fd = -1;
- igt_subtest_init(argc, argv);
-
igt_skip_on_simulation();
igt_fixture {
@@ -359,6 +357,4 @@ int main(int argc, char **argv)
igt_fixture {
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_exec_bad_domains.c b/tests/gem_exec_bad_domains.c
index 51894f7d..e0e13de5 100644
--- a/tests/gem_exec_bad_domains.c
+++ b/tests/gem_exec_bad_domains.c
@@ -150,10 +150,8 @@ static void multi_write_domain(int fd)
int fd;
drm_intel_bo *tmp;
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_fixture {
fd = drm_open_any();
@@ -231,6 +229,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_exec_faulting_reloc.c b/tests/gem_exec_faulting_reloc.c
index ef801ed4..b4518fd9 100644
--- a/tests/gem_exec_faulting_reloc.c
+++ b/tests/gem_exec_faulting_reloc.c
@@ -208,10 +208,8 @@ static void run(int object_size)
close(fd);
}
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_subtest("normal")
run(OBJECT_SIZE);
igt_subtest("no-prefault") {
@@ -219,6 +217,4 @@ int main(int argc, char **argv)
run(OBJECT_SIZE);
igt_enable_prefault();
}
-
- igt_exit();
}
diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c
index 265220e6..868f010e 100644
--- a/tests/gem_exec_nop.c
+++ b/tests/gem_exec_nop.c
@@ -109,10 +109,8 @@ uint32_t batch[2] = {MI_BATCH_BUFFER_END};
uint32_t handle;
int fd;
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_fixture {
fd = drm_open_any();
@@ -137,6 +135,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c
index be196b09..bff73ddd 100644
--- a/tests/gem_fence_thrash.c
+++ b/tests/gem_fence_thrash.c
@@ -198,10 +198,8 @@ static int run_test(int threads_per_fence, void *f, int tiling,
return 0;
}
-int
-main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_subtest("bo-write-verify-none")
@@ -232,6 +230,4 @@ main(int argc, char **argv)
igt_subtest("bo-copy")
igt_assert(run_test(1, bo_copy, I915_TILING_X, 1) == 0);
-
- igt_exit();
}
diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c
index bca8f187..edab9f14 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -218,11 +218,8 @@ static void run_test(int fd, int num_fences, int expected_errno,
int fd;
int num_fences;
-int
-main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_skip_on_simulation();
igt_fixture {
@@ -247,6 +244,4 @@ main(int argc, char **argv)
igt_fixture
close(fd);
-
- igt_exit();
}
diff --git a/tests/gem_flink.c b/tests/gem_flink.c
index f822b9b0..4b3b7c2f 100644
--- a/tests/gem_flink.c
+++ b/tests/gem_flink.c
@@ -151,10 +151,8 @@ test_flink_lifetime(int fd)
int fd;
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_fixture
fd = drm_open_any();
@@ -168,6 +166,4 @@ int main(int argc, char **argv)
test_bad_open(fd);
igt_subtest("flink-lifetime")
test_flink_lifetime(fd);
-
- igt_exit();
}
diff --git a/tests/gem_flink_race.c b/tests/gem_flink_race.c
index 2e97f76f..b81007e5 100644
--- a/tests/gem_flink_race.c
+++ b/tests/gem_flink_race.c
@@ -190,17 +190,13 @@ static void test_flink_close(void)
igt_assert(obj_count == 0);
}
-int main(int argc, char **argv)
+igt_main
{
igt_skip_on_simulation();
- igt_subtest_init(argc, argv);
-
igt_subtest("flink_name")
test_flink_name();
igt_subtest("flink_close")
test_flink_close();
-
- igt_exit();
}
diff --git a/tests/gem_mmap.c b/tests/gem_mmap.c
index c812a5b9..4c5be8fa 100644
--- a/tests/gem_mmap.c
+++ b/tests/gem_mmap.c
@@ -42,7 +42,7 @@
int fd;
int handle;
-int main(int argc, char **argv)
+igt_main
{
struct drm_i915_gem_mmap arg;
uint8_t expected[OBJECT_SIZE];
@@ -50,8 +50,6 @@ int main(int argc, char **argv)
uint8_t *addr;
int ret;
- igt_subtest_init(argc, argv);
-
igt_fixture
fd = drm_open_any();
@@ -96,6 +94,4 @@ int main(int argc, char **argv)
igt_fixture
close(fd);
-
- igt_exit();
}
diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index 79e34e2e..34ca6789 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -191,13 +191,11 @@ run_without_prefault(int fd,
int fd;
-int main(int argc, char **argv)
+igt_main
{
if (igt_run_in_simulation())
OBJECT_SIZE = 1 * 1024 * 1024;
- igt_subtest_init(argc, argv);
-
igt_fixture
fd = drm_open_any();
@@ -220,6 +218,4 @@ int main(int argc, char **argv)
igt_fixture
close(fd);
-
- igt_exit();
}
diff --git a/tests/gem_partial_pwrite_pread.c b/tests/gem_partial_pwrite_pread.c
index af772438..d6d00dd9 100644
--- a/tests/gem_partial_pwrite_pread.c
+++ b/tests/gem_partial_pwrite_pread.c
@@ -253,11 +253,10 @@ static void do_tests(int cache_level, const char *suffix)
test_partial_read_writes();
}
-int main(int argc, char **argv)
+igt_main
{
srandom(0xdeadbeef);
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -289,6 +288,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_persistent_relocs.c b/tests/gem_persistent_relocs.c
index ffa4559e..29b19ed1 100644
--- a/tests/gem_persistent_relocs.c
+++ b/tests/gem_persistent_relocs.c
@@ -328,9 +328,8 @@ static void do_forked_test(int fd, unsigned flags)
int fd;
#define MAX_BLT_SIZE 128
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
memset(blob, 'A', sizeof(blob));
@@ -371,6 +370,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_pipe_control_store_loop.c b/tests/gem_pipe_control_store_loop.c
index 5eae6ca5..7a400915 100644
--- a/tests/gem_pipe_control_store_loop.c
+++ b/tests/gem_pipe_control_store_loop.c
@@ -151,10 +151,8 @@ store_pipe_control_loop(bool preuse_buffer)
int fd;
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_fixture {
fd = drm_open_any();
devid = intel_get_drm_devid(fd);
@@ -186,6 +184,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_pread_after_blit.c b/tests/gem_pread_after_blit.c
index d0f85fe6..4faf104e 100644
--- a/tests/gem_pread_after_blit.c
+++ b/tests/gem_pread_after_blit.c
@@ -171,12 +171,10 @@ static void do_test(int fd, int cache_level,
drm_intel_bo *src[2], *dst[2];
int fd;
-int
-main(int argc, char **argv)
+igt_main
{
const uint32_t start[2] = {0, 1024 * 1024 / 4};
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -240,6 +238,4 @@ main(int argc, char **argv)
}
close(fd);
-
- igt_exit();
}
diff --git a/tests/gem_readwrite.c b/tests/gem_readwrite.c
index adf4af28..149254a2 100644
--- a/tests/gem_readwrite.c
+++ b/tests/gem_readwrite.c
@@ -76,14 +76,13 @@ do_write(int fd, int handle, void *buf, int offset, int size)
int fd;
uint32_t handle;
-int main(int argc, char **argv)
+igt_main
{
uint8_t expected[OBJECT_SIZE];
uint8_t buf[OBJECT_SIZE];
int ret;
igt_skip_on_simulation();
- igt_subtest_init(argc, argv);
igt_fixture {
fd = drm_open_any();
@@ -145,6 +144,4 @@ int main(int argc, char **argv)
igt_fixture
close(fd);
-
- igt_exit();
}
diff --git a/tests/gem_reloc_overflow.c b/tests/gem_reloc_overflow.c
index ccc0e756..f7ba1d7c 100644
--- a/tests/gem_reloc_overflow.c
+++ b/tests/gem_reloc_overflow.c
@@ -250,10 +250,8 @@ static void buffer_count_tests(void)
}
}
-int main(int argc, char *argv[])
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_fixture {
int ring;
uint32_t batch_data [2] = { MI_NOOP, MI_BATCH_BUFFER_END };
@@ -306,6 +304,4 @@ int main(int argc, char *argv[])
gem_close(fd, batch_handle);
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c
index 14d11042..ae7b446f 100644
--- a/tests/gem_reloc_vs_gpu.c
+++ b/tests/gem_reloc_vs_gpu.c
@@ -323,9 +323,8 @@ static void do_forked_test(int fd, unsigned flags)
int fd;
#define MAX_BLT_SIZE 128
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
memset(blob, 'A', sizeof(blob));
@@ -372,6 +371,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c
index 12906451..3130cde6 100644
--- a/tests/gem_ringfill.c
+++ b/tests/gem_ringfill.c
@@ -200,10 +200,8 @@ struct intel_batchbuffer *batch;
render_copyfunc_t copy;
int fd;
-int main(int argc, char **argv)
+igt_main
{
-
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -234,6 +232,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_set_tiling_vs_blt.c b/tests/gem_set_tiling_vs_blt.c
index 9ecd2b53..2c074b7b 100644
--- a/tests/gem_set_tiling_vs_blt.c
+++ b/tests/gem_set_tiling_vs_blt.c
@@ -229,12 +229,11 @@ static void do_test(uint32_t tiling, unsigned stride,
int fd;
-int main(int argc, char **argv)
+igt_main
{
int i;
uint32_t tiling, tiling_after;
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -275,6 +274,4 @@ int main(int argc, char **argv)
igt_assert(tiling == I915_TILING_X);
igt_assert(tiling_after == I915_TILING_X);
}
-
- igt_exit();
}
diff --git a/tests/gem_storedw_batches_loop.c b/tests/gem_storedw_batches_loop.c
index eabc6f26..1b475f02 100644
--- a/tests/gem_storedw_batches_loop.c
+++ b/tests/gem_storedw_batches_loop.c
@@ -122,9 +122,8 @@ cont:
int fd;
int devid;
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -166,6 +165,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_suspend.c b/tests/gem_suspend.c
index dfdb5661..e526e2a2 100644
--- a/tests/gem_suspend.c
+++ b/tests/gem_suspend.c
@@ -147,10 +147,8 @@ test_sysfs_reader(void)
int fd;
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_skip_on_simulation();
igt_fixture
@@ -170,6 +168,4 @@ int main(int argc, char **argv)
igt_fixture
close(fd);
-
- igt_exit();
}
diff --git a/tests/gem_tiled_partial_pwrite_pread.c b/tests/gem_tiled_partial_pwrite_pread.c
index d535e382..2e24105e 100644
--- a/tests/gem_tiled_partial_pwrite_pread.c
+++ b/tests/gem_tiled_partial_pwrite_pread.c
@@ -255,11 +255,10 @@ static void test_partial_read_writes(void)
}
}
-int main(int argc, char **argv)
+igt_main
{
uint32_t tiling_mode = I915_TILING_X;
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
srandom(0xdeadbeef);
@@ -303,6 +302,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/gem_write_read_ring_switch.c b/tests/gem_write_read_ring_switch.c
index d04043b7..99025319 100644
--- a/tests/gem_write_read_ring_switch.c
+++ b/tests/gem_write_read_ring_switch.c
@@ -143,7 +143,7 @@ static void run_test(int ring)
drm_intel_bo_unreference(target_bo);
}
-int main(int argc, char **argv)
+igt_main
{
static const struct {
const char *name;
@@ -155,7 +155,6 @@ int main(int argc, char **argv)
};
int i;
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -196,6 +195,4 @@ int main(int argc, char **argv)
close(fd);
}
-
- igt_exit();
}
diff --git a/tests/kms_addfb.c b/tests/kms_addfb.c
index 11b0a865..3f727cc0 100644
--- a/tests/kms_addfb.c
+++ b/tests/kms_addfb.c
@@ -215,10 +215,8 @@ static void size_tests(int fd)
int fd;
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_fixture
fd = drm_open_any();
@@ -228,6 +226,4 @@ int main(int argc, char **argv)
igt_fixture
close(fd);
-
- igt_exit();
}
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 359825ca..2c9ca359 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -321,11 +321,10 @@ static void create_cursor_fb(data_t *data,
igt_assert(cairo_status(cr) == 0);
}
-int main(int argc, char **argv)
+igt_main
{
data_t data = {};
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -377,6 +376,4 @@ int main(int argc, char **argv)
display_fini(&data);
fclose(data.ctl);
}
-
- igt_exit();
}
diff --git a/tests/kms_render.c b/tests/kms_render.c
index 26ca8dc4..dc009322 100644
--- a/tests/kms_render.c
+++ b/tests/kms_render.c
@@ -221,7 +221,7 @@ static int run_test(const char *test_name, enum test_flags flags)
return 1;
}
-int main(int argc, char **argv)
+igt_main
{
struct {
enum test_flags flags;
@@ -232,7 +232,6 @@ int main(int argc, char **argv)
};
int i;
- igt_subtest_init(argc, argv);
igt_skip_on_simulation();
igt_fixture {
@@ -252,6 +251,4 @@ int main(int argc, char **argv)
igt_fixture
close(drm_fd);
-
- igt_exit();
}
diff --git a/tests/prime_nv_api.c b/tests/prime_nv_api.c
index 8bb5091d..e2448bef 100644
--- a/tests/prime_nv_api.c
+++ b/tests/prime_nv_api.c
@@ -510,10 +510,8 @@ static int test_nv_self_import_to_different_fd(void)
return 0;
}
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_fixture {
igt_assert(find_and_open_devices() == 0);
@@ -574,6 +572,4 @@ int main(int argc, char **argv)
close(intel_fd);
close(nouveau_fd);
}
-
- igt_exit();
}
diff --git a/tests/prime_nv_pcopy.c b/tests/prime_nv_pcopy.c
index c6347dd9..12578f76 100644
--- a/tests/prime_nv_pcopy.c
+++ b/tests/prime_nv_pcopy.c
@@ -1263,10 +1263,8 @@ out:
return ret;
}
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_fixture {
igt_assert(find_and_open_devices() == 0);
@@ -1318,6 +1316,4 @@ int main(int argc, char **argv)
close(intel_fd);
close(nouveau_fd);
}
-
- igt_exit();
}
diff --git a/tests/prime_nv_test.c b/tests/prime_nv_test.c
index 7b40652f..18a13a0e 100644
--- a/tests/prime_nv_test.c
+++ b/tests/prime_nv_test.c
@@ -352,10 +352,8 @@ static void test_i915_blt_fill_nv_read(void)
/* test 9 nouveau copy engine?? */
-int main(int argc, char **argv)
+igt_main
{
- igt_subtest_init(argc, argv);
-
igt_fixture {
igt_assert(find_and_open_devices() == 0);
@@ -399,6 +397,4 @@ int main(int argc, char **argv)
close(intel_fd);
close(nouveau_fd);
}
-
- igt_exit();
}
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index 481a809e..2edc1f8b 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -420,7 +420,7 @@ static void test_llseek_bad(void)
close(fd);
}
-int main(int argc, char **argv)
+igt_main
{
struct {
const char *name;
@@ -437,12 +437,8 @@ int main(int argc, char **argv)
};
int i;
- igt_subtest_init(argc, argv);
-
for (i = 0; i < ARRAY_SIZE(tests); i++) {
igt_subtest(tests[i].name)
tests[i].fn();
}
-
- igt_exit();
}