summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-12-10 10:18:32 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-12-10 10:18:32 +0100
commitdda85fb108469e3d3c8ce19751f928c70e9fba4c (patch)
treea711eaada22dc9d1713922482e3680bedb10300e
parentce1a9f918ef2415562bf441c2b7d886c6eb865c4 (diff)
tests: roll out igt_simple_init/igt_simple_main
Also use igt_skip a bit more to simplify some of the tests. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--tests/Makefile.sources2
-rw-r--r--tests/core_getclient.c3
-rw-r--r--tests/core_getstats.c3
-rw-r--r--tests/core_getversion.c3
-rw-r--r--tests/drm_vma_limiter.c4
-rw-r--r--tests/drm_vma_limiter_cached.c4
-rw-r--r--tests/drm_vma_limiter_cpu.c4
-rw-r--r--tests/drm_vma_limiter_gtt.c4
-rw-r--r--tests/gem_bad_length.c4
-rw-r--r--tests/gem_cpu_reloc.c10
-rw-r--r--tests/gem_cs_prefetch.c4
-rw-r--r--tests/gem_ctx_bad_destroy.c4
-rw-r--r--tests/gem_ctx_basic.c4
-rw-r--r--tests/gem_ctx_create.c4
-rw-r--r--tests/gem_double_irq_loop.c4
-rw-r--r--tests/gem_exec_blt.c2
-rw-r--r--tests/gem_exec_lut_handle.c4
-rw-r--r--tests/gem_gtt_cpu_tlb.c5
-rw-r--r--tests/gem_gtt_speed.c2
-rw-r--r--tests/gem_hangcheck_forcewake.c4
-rw-r--r--tests/gem_largeobject.c4
-rw-r--r--tests/gem_lut_handle.c4
-rw-r--r--tests/gem_media_fill.c22
-rw-r--r--tests/gem_mmap_offset_exhaustion.c4
-rw-r--r--tests/gem_pin.c4
-rw-r--r--tests/gem_reg_read.c3
-rw-r--r--tests/gem_render_copy.c2
-rw-r--r--tests/gem_render_linear_blits.c2
-rw-r--r--tests/gem_render_tiled_blits.c2
-rw-r--r--tests/gem_ring_sync_loop.c9
-rw-r--r--tests/gem_seqno_wrap.c2
-rw-r--r--tests/gem_set_tiling_vs_gtt.c4
-rw-r--r--tests/gem_set_tiling_vs_pwrite.c4
-rw-r--r--tests/gem_storedw_loop_blt.c4
-rw-r--r--tests/gem_storedw_loop_bsd.c4
-rw-r--r--tests/gem_storedw_loop_render.c4
-rw-r--r--tests/gem_storedw_loop_vebox.c4
-rw-r--r--tests/gem_threaded_access_tiled.c4
-rw-r--r--tests/gem_tiled_fence_blits.c4
-rw-r--r--tests/gem_tiled_pread.c5
-rw-r--r--tests/gem_tiled_pread_pwrite.c5
-rw-r--r--tests/gem_tiled_swapping.c5
-rw-r--r--tests/gem_tiling_max_stride.c4
-rw-r--r--tests/gem_unfence_active_buffers.c4
-rw-r--r--tests/gem_unref_active_buffers.c4
-rw-r--r--tests/gem_vmap_blits.c2
-rw-r--r--tests/gem_wait_render_timeout.c10
-rw-r--r--tests/gen3_mixed_blits.c2
-rw-r--r--tests/gen3_render_linear_blits.c2
-rw-r--r--tests/gen3_render_mixed_blits.c2
-rw-r--r--tests/gen3_render_tiledx_blits.c2
-rw-r--r--tests/gen3_render_tiledy_blits.c2
-rw-r--r--tests/pm_psr.c4
-rw-r--r--tests/pm_rc6_residency.c4
-rw-r--r--tests/pm_rps.c7
-rw-r--r--tests/prime_udl.c26
56 files changed, 89 insertions, 169 deletions
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 4bb53893..d71e3a09 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -118,10 +118,10 @@ TESTS_progs = \
gen3_render_mixed_blits \
gen3_render_tiledx_blits \
gen3_render_tiledy_blits \
- prime_udl \
pm_psr \
pm_rc6_residency \
pm_rps \
+ prime_udl \
$(NULL)
# IMPORTANT: The ZZ_ tests need to be run last!
diff --git a/tests/core_getclient.c b/tests/core_getclient.c
index dcb7b326..22f0ab2e 100644
--- a/tests/core_getclient.c
+++ b/tests/core_getclient.c
@@ -32,7 +32,7 @@
/**
* Checks DRM_IOCTL_GET_CLIENT.
*/
-int main(int argc, char **argv)
+igt_simple_main
{
int fd, ret;
drm_client_t client;
@@ -57,5 +57,4 @@ int main(int argc, char **argv)
igt_assert(ret == -1 && errno == EINVAL);
close(fd);
- return 0;
}
diff --git a/tests/core_getstats.c b/tests/core_getstats.c
index 7975257d..cce8271b 100644
--- a/tests/core_getstats.c
+++ b/tests/core_getstats.c
@@ -35,7 +35,7 @@
* I don't care too much about the actual contents, just that the kernel
* doesn't crash.
*/
-int main(int argc, char **argv)
+igt_simple_main
{
int fd, ret;
drm_stats_t stats;
@@ -46,5 +46,4 @@ int main(int argc, char **argv)
igt_assert(ret == 0);
close(fd);
- return 0;
}
diff --git a/tests/core_getversion.c b/tests/core_getversion.c
index d6da2ad6..7058c897 100644
--- a/tests/core_getversion.c
+++ b/tests/core_getversion.c
@@ -32,7 +32,7 @@
/**
* Checks DRM_IOCTL_GET_VERSION and libdrm's drmGetVersion() interface to it.
*/
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
drmVersionPtr v;
@@ -45,5 +45,4 @@ int main(int argc, char **argv)
igt_assert(v->version_major >= 1);
drmFree(v);
close(fd);
- return 0;
}
diff --git a/tests/drm_vma_limiter.c b/tests/drm_vma_limiter.c
index 9c95b77b..b38037ad 100644
--- a/tests/drm_vma_limiter.c
+++ b/tests/drm_vma_limiter.c
@@ -53,7 +53,7 @@ struct intel_batchbuffer *batch;
#define BO_ARRAY_SIZE 35000
drm_intel_bo *bos[BO_ARRAY_SIZE];
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
int i;
@@ -106,6 +106,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/drm_vma_limiter_cached.c b/tests/drm_vma_limiter_cached.c
index 10cd7b6a..3a78436d 100644
--- a/tests/drm_vma_limiter_cached.c
+++ b/tests/drm_vma_limiter_cached.c
@@ -53,7 +53,7 @@ struct intel_batchbuffer *batch;
/* we do both cpu and gtt maps, so only need half of 64k to exhaust */
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
int i;
@@ -131,6 +131,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/drm_vma_limiter_cpu.c b/tests/drm_vma_limiter_cpu.c
index 792a9f87..77a50b1d 100644
--- a/tests/drm_vma_limiter_cpu.c
+++ b/tests/drm_vma_limiter_cpu.c
@@ -54,7 +54,7 @@ struct intel_batchbuffer *batch;
#define BO_ARRAY_SIZE 68000
drm_intel_bo *bos[BO_ARRAY_SIZE];
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
int i;
@@ -96,6 +96,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/drm_vma_limiter_gtt.c b/tests/drm_vma_limiter_gtt.c
index 68ba25cb..5104b0da 100644
--- a/tests/drm_vma_limiter_gtt.c
+++ b/tests/drm_vma_limiter_gtt.c
@@ -55,7 +55,7 @@ struct intel_batchbuffer *batch;
#define BO_ARRAY_SIZE 68000
drm_intel_bo *bos[BO_ARRAY_SIZE];
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
int i;
@@ -97,6 +97,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_bad_length.c b/tests/gem_bad_length.c
index 72f0fe31..ae48d552 100644
--- a/tests/gem_bad_length.c
+++ b/tests/gem_bad_length.c
@@ -116,7 +116,7 @@ static void exec0(int fd)
}
#endif
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
@@ -129,6 +129,4 @@ int main(int argc, char **argv)
//exec0(fd);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_cpu_reloc.c b/tests/gem_cpu_reloc.c
index a6048f44..6e1f8886 100644
--- a/tests/gem_cpu_reloc.c
+++ b/tests/gem_cpu_reloc.c
@@ -153,7 +153,7 @@ uint32_t gen8_batch[] = {
uint32_t *batch = gen6_batch;
uint32_t batch_size = sizeof(gen6_batch);
-int main(int argc, char **argv)
+igt_simple_main
{
const uint32_t hang[] = {-1, -1, -1, -1};
const uint32_t end[] = {MI_BATCH_BUFFER_END, 0};
@@ -175,10 +175,8 @@ int main(int argc, char **argv)
}
aper_size = gem_mappable_aperture_size();
- if (intel_get_total_ram_mb() < aper_size / (1024*1024) * 2) {
- fprintf(stderr, "not enough mem to run test\n");
- return 77;
- }
+ igt_skip_on_f(intel_get_total_ram_mb() < aper_size / (1024*1024) * 2,
+ "not enough mem to run test\n");
count = aper_size / 4096 * 2;
if (igt_run_in_simulation())
@@ -242,6 +240,4 @@ int main(int argc, char **argv)
printf("Test suceeded, cleanup up - this might take a while.\n");
close(fd);
-
- return 0;
}
diff --git a/tests/gem_cs_prefetch.c b/tests/gem_cs_prefetch.c
index eb515ead..ef0cdf14 100644
--- a/tests/gem_cs_prefetch.c
+++ b/tests/gem_cs_prefetch.c
@@ -87,7 +87,7 @@ static void exec(int fd, uint32_t handle)
igt_assert(ret == 0);
}
-int main(int argc, char **argv)
+igt_simple_main
{
uint32_t batch_end[4] = {MI_BATCH_BUFFER_END, 0, 0, 0};
int fd, i, ret;
@@ -164,6 +164,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_ctx_bad_destroy.c b/tests/gem_ctx_bad_destroy.c
index e93642f6..3fcc946e 100644
--- a/tests/gem_ctx_bad_destroy.c
+++ b/tests/gem_ctx_bad_destroy.c
@@ -54,7 +54,7 @@ static void handle_bad(int ret, int lerrno, int expected, const char *desc)
}
}
-int main(int argc, char *argv[])
+igt_simple_main
{
struct local_drm_i915_context_destroy destroy;
uint32_t ctx_id;
@@ -86,6 +86,4 @@ int main(int argc, char *argv[])
handle_bad(ret, errno, ENOENT, "default destroy");
close(fd);
-
- igt_success();
}
diff --git a/tests/gem_ctx_basic.c b/tests/gem_ctx_basic.c
index a2b83dfd..e1eeaa16 100644
--- a/tests/gem_ctx_basic.c
+++ b/tests/gem_ctx_basic.c
@@ -133,6 +133,8 @@ int main(int argc, char *argv[])
{
int i;
+ igt_simple_init();
+
fd = drm_open_any_render();
devid = intel_get_drm_devid(fd);
@@ -156,5 +158,5 @@ int main(int argc, char *argv[])
free(threads);
close(fd);
- igt_success();
+ return 0;
}
diff --git a/tests/gem_ctx_create.c b/tests/gem_ctx_create.c
index 1d9ff86c..d7a45387 100644
--- a/tests/gem_ctx_create.c
+++ b/tests/gem_ctx_create.c
@@ -37,7 +37,7 @@ struct local_drm_i915_gem_context_create {
#define CONTEXT_CREATE_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x2d, struct local_drm_i915_gem_context_create)
-int main(int argc, char *argv[])
+igt_simple_main
{
int ret, fd;
struct local_drm_i915_gem_context_create create;
@@ -60,6 +60,4 @@ int main(int argc, char *argv[])
igt_assert(create.ctx_id != 0);
close(fd);
-
- igt_success();
}
diff --git a/tests/gem_double_irq_loop.c b/tests/gem_double_irq_loop.c
index ff44e4e3..d4d2efef 100644
--- a/tests/gem_double_irq_loop.c
+++ b/tests/gem_double_irq_loop.c
@@ -91,7 +91,7 @@ dummy_reloc_loop(void)
}
}
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
int devid;
@@ -125,6 +125,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_exec_blt.c b/tests/gem_exec_blt.c
index e0e29972..4fe1d476 100644
--- a/tests/gem_exec_blt.c
+++ b/tests/gem_exec_blt.c
@@ -246,6 +246,8 @@ int main(int argc, char **argv)
{
int i;
+ igt_simple_init();
+
igt_skip_on_simulation();
if (argc > 1) {
diff --git a/tests/gem_exec_lut_handle.c b/tests/gem_exec_lut_handle.c
index 7a12e029..05aece15 100644
--- a/tests/gem_exec_lut_handle.c
+++ b/tests/gem_exec_lut_handle.c
@@ -111,7 +111,7 @@ static int exec(int fd, int num_exec, int num_relocs, unsigned flags)
}
#define ELAPSED(a,b) (1e6*((b)->tv_sec - (a)->tv_sec) + ((b)->tv_usec - (a)->tv_usec))
-int main(int argc, char **argv)
+igt_simple_main
{
uint32_t batch[2] = {MI_BATCH_BUFFER_END};
int fd, n, m, count;
@@ -200,6 +200,4 @@ int main(int argc, char **argv)
printf("\n");
}
}
-
- return 0;
}
diff --git a/tests/gem_gtt_cpu_tlb.c b/tests/gem_gtt_cpu_tlb.c
index bdae4f86..d6640258 100644
--- a/tests/gem_gtt_cpu_tlb.c
+++ b/tests/gem_gtt_cpu_tlb.c
@@ -66,8 +66,7 @@ create_bo(int fd)
return handle;
}
-int
-main(int argc, char **argv)
+igt_simple_main
{
int fd;
int i;
@@ -103,6 +102,4 @@ main(int argc, char **argv)
igt_assert(ptr[i] == i);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_gtt_speed.c b/tests/gem_gtt_speed.c
index 459bdab5..2f70276f 100644
--- a/tests/gem_gtt_speed.c
+++ b/tests/gem_gtt_speed.c
@@ -59,6 +59,8 @@ int main(int argc, char **argv)
int loop, i, tiling;
int fd;
+ igt_simple_init();
+
igt_skip_on_simulation();
if (argc > 1)
diff --git a/tests/gem_hangcheck_forcewake.c b/tests/gem_hangcheck_forcewake.c
index 5f379e04..cd51d6ca 100644
--- a/tests/gem_hangcheck_forcewake.c
+++ b/tests/gem_hangcheck_forcewake.c
@@ -57,7 +57,7 @@ struct intel_batchbuffer *batch;
uint32_t blob[2048*2048];
#define MAX_BLT_SIZE 128
-int main(int argc, char **argv)
+igt_simple_main
{
drm_intel_bo *bo = NULL;
uint32_t tiling_mode = I915_TILING_X;
@@ -122,6 +122,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_largeobject.c b/tests/gem_largeobject.c
index 913e3683..93a2bcdc 100644
--- a/tests/gem_largeobject.c
+++ b/tests/gem_largeobject.c
@@ -71,7 +71,7 @@ test_large_object(int fd)
/* kernel should clean this up for us */
}
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
@@ -80,6 +80,4 @@ int main(int argc, char **argv)
fd = drm_open_any();
test_large_object(fd);
-
- return 0;
}
diff --git a/tests/gem_lut_handle.c b/tests/gem_lut_handle.c
index dcb6b519..4bf88b35 100644
--- a/tests/gem_lut_handle.c
+++ b/tests/gem_lut_handle.c
@@ -175,7 +175,7 @@ static int many_exec(int fd, uint32_t batch, int num_exec, int num_reloc, unsign
#define fail(x) ASSERT(_fail(x))
#define pass(x) ASSERT(!_fail(x))
-int main(int argc, char **argv)
+igt_simple_main
{
uint32_t batch[2] = {MI_BATCH_BUFFER_END};
uint32_t handle;
@@ -240,6 +240,4 @@ int main(int argc, char **argv)
fail(many_exec(fd, handle, i+1, i, USE_LUT | BROKEN));
fail(many_exec(fd, handle, i+1, i+1, USE_LUT | BROKEN));
}
-
- return 0;
}
diff --git a/tests/gem_media_fill.c b/tests/gem_media_fill.c
index b458deda..1c3fe609 100644
--- a/tests/gem_media_fill.c
+++ b/tests/gem_media_fill.c
@@ -84,7 +84,7 @@ scratch_buf_check(data_t *data, struct scratch_buf *buf, int x, int y,
}
}
-int main(int argc, char **argv)
+igt_simple_main
{
data_t data = {0, };
struct intel_batchbuffer *batch = NULL;
@@ -92,21 +92,19 @@ int main(int argc, char **argv)
media_fillfunc_t media_fill = NULL;
int i, j;
- igt_fixture {
- data.drm_fd = drm_open_any_render();
- data.devid = intel_get_drm_devid(data.drm_fd);
+ data.drm_fd = drm_open_any_render();
+ data.devid = intel_get_drm_devid(data.drm_fd);
- data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
- igt_assert(data.bufmgr);
+ data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
+ igt_assert(data.bufmgr);
- media_fill = get_media_fillfunc(data.devid);
+ media_fill = get_media_fillfunc(data.devid);
- igt_require_f(media_fill,
- "no media-fill function\n");
+ igt_require_f(media_fill,
+ "no media-fill function\n");
- batch = intel_batchbuffer_alloc(data.bufmgr, data.devid);
- igt_assert(batch);
- }
+ batch = intel_batchbuffer_alloc(data.bufmgr, data.devid);
+ igt_assert(batch);
scratch_buf_init(&data, &dst, WIDTH, HEIGHT, STRIDE, COLOR_C4);
diff --git a/tests/gem_mmap_offset_exhaustion.c b/tests/gem_mmap_offset_exhaustion.c
index d834fda4..670ca466 100644
--- a/tests/gem_mmap_offset_exhaustion.c
+++ b/tests/gem_mmap_offset_exhaustion.c
@@ -77,7 +77,7 @@ create_and_map_bo(int fd)
gem_madvise(fd, handle, I915_MADV_DONTNEED);
}
-int main(int argc, char **argv)
+igt_simple_main
{
int fd, i;
@@ -91,6 +91,4 @@ int main(int argc, char **argv)
create_and_map_bo(fd);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_pin.c b/tests/gem_pin.c
index 73e5e68f..06360c36 100644
--- a/tests/gem_pin.c
+++ b/tests/gem_pin.c
@@ -198,7 +198,7 @@ static uint32_t gem_pin(int fd, int handle, int alignment)
return pin.offset;
}
-int main(int argc, char **argv)
+igt_simple_main
{
const uint32_t batch[2] = {MI_BATCH_BUFFER_END};
struct timeval start, now;
@@ -245,6 +245,4 @@ int main(int argc, char **argv)
gettimeofday(&now, NULL);
} while ((now.tv_sec - start.tv_sec)*1000 + (now.tv_usec - start.tv_usec) / 1000 < 10000);
igt_stop_signal_helper();
-
- return 0;
}
diff --git a/tests/gem_reg_read.c b/tests/gem_reg_read.c
index 67c1d91b..a88c6a46 100644
--- a/tests/gem_reg_read.c
+++ b/tests/gem_reg_read.c
@@ -63,7 +63,7 @@ static uint64_t timer_query(int fd)
return reg_read.val;
}
-int main(int argc, char *argv[])
+igt_simple_main
{
struct local_drm_i915_reg_read reg_read;
int fd, ret;
@@ -88,5 +88,4 @@ int main(int argc, char *argv[])
EINVAL, "bad register");
close(fd);
- igt_success();
}
diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c
index 62285956..5e2433c9 100644
--- a/tests/gem_render_copy.c
+++ b/tests/gem_render_copy.c
@@ -114,6 +114,8 @@ int main(int argc, char **argv)
int opt_dump_png = false;
int opt_dump_aub = drmtest_dump_aub();
+ igt_simple_init();
+
while ((opt = getopt(argc, argv, "d")) != -1) {
switch (opt) {
case 'd':
diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c
index 4ae2103b..c63b0914 100644
--- a/tests/gem_render_linear_blits.c
+++ b/tests/gem_render_linear_blits.c
@@ -73,6 +73,8 @@ int main(int argc, char **argv)
uint32_t start = 0;
int i, j, fd, count;
+ igt_simple_init();
+
fd = drm_open_any();
render_copy = get_render_copyfunc(intel_get_drm_devid(fd));
diff --git a/tests/gem_render_tiled_blits.c b/tests/gem_render_tiled_blits.c
index f8af2368..8e0c7de7 100644
--- a/tests/gem_render_tiled_blits.c
+++ b/tests/gem_render_tiled_blits.c
@@ -71,6 +71,8 @@ int main(int argc, char **argv)
uint32_t start = 0;
int i, j, fd, count;
+ igt_simple_init();
+
igt_skip_on_simulation();
fd = drm_open_any();
diff --git a/tests/gem_ring_sync_loop.c b/tests/gem_ring_sync_loop.c
index 152a6fee..95fcd305 100644
--- a/tests/gem_ring_sync_loop.c
+++ b/tests/gem_ring_sync_loop.c
@@ -90,17 +90,14 @@ store_dword_loop(int fd)
drm_intel_bo_unmap(target_buffer);
}
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
int devid;
fd = drm_open_any();
devid = intel_get_drm_devid(fd);
- if (!HAS_BLT_RING(devid)) {
- fprintf(stderr, "inter ring check needs gen6+\n");
- return 77;
- }
+ gem_require_ring(fd, I915_EXEC_BLT);
bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
@@ -120,6 +117,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c
index 2c6ffbe3..40c6227e 100644
--- a/tests/gem_seqno_wrap.c
+++ b/tests/gem_seqno_wrap.c
@@ -641,6 +641,8 @@ int main(int argc, char **argv)
int wcount = 0;
int r = -1;
+ igt_simple_init();
+
parse_options(argc, argv);
card_index = drm_get_card();
diff --git a/tests/gem_set_tiling_vs_gtt.c b/tests/gem_set_tiling_vs_gtt.c
index ac3be7d2..5dc90aea 100644
--- a/tests/gem_set_tiling_vs_gtt.c
+++ b/tests/gem_set_tiling_vs_gtt.c
@@ -46,7 +46,7 @@
* Testcase: Check set_tiling vs gtt mmap coherency
*/
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
uint32_t *ptr;
@@ -132,6 +132,4 @@ int main(int argc, char **argv)
munmap(ptr, OBJECT_SIZE);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_set_tiling_vs_pwrite.c b/tests/gem_set_tiling_vs_pwrite.c
index fb3c7eea..4ef37201 100644
--- a/tests/gem_set_tiling_vs_pwrite.c
+++ b/tests/gem_set_tiling_vs_pwrite.c
@@ -46,7 +46,7 @@
* Testcase: Check set_tiling vs pwrite coherency
*/
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
uint32_t *ptr;
@@ -94,6 +94,4 @@ int main(int argc, char **argv)
munmap(ptr, OBJECT_SIZE);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_storedw_loop_blt.c b/tests/gem_storedw_loop_blt.c
index 9c1ee08f..d08f5b0d 100644
--- a/tests/gem_storedw_loop_blt.c
+++ b/tests/gem_storedw_loop_blt.c
@@ -113,7 +113,7 @@ cont:
drm_intel_bo_unmap(target_buffer);
}
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
int devid;
@@ -152,6 +152,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_storedw_loop_bsd.c b/tests/gem_storedw_loop_bsd.c
index 7dd15e4a..079b139f 100644
--- a/tests/gem_storedw_loop_bsd.c
+++ b/tests/gem_storedw_loop_bsd.c
@@ -113,7 +113,7 @@ cont:
drm_intel_bo_unmap(target_buffer);
}
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
int devid;
@@ -155,6 +155,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_storedw_loop_render.c b/tests/gem_storedw_loop_render.c
index 423152e3..2dc16b10 100644
--- a/tests/gem_storedw_loop_render.c
+++ b/tests/gem_storedw_loop_render.c
@@ -113,7 +113,7 @@ cont:
drm_intel_bo_unmap(target_buffer);
}
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
int devid;
@@ -149,6 +149,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_storedw_loop_vebox.c b/tests/gem_storedw_loop_vebox.c
index 2a494ea3..aa1987ac 100644
--- a/tests/gem_storedw_loop_vebox.c
+++ b/tests/gem_storedw_loop_vebox.c
@@ -100,7 +100,7 @@ cont:
drm_intel_bo_unmap(target_buffer);
}
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
@@ -131,6 +131,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_threaded_access_tiled.c b/tests/gem_threaded_access_tiled.c
index a51cd4d8..cf07daf4 100644
--- a/tests/gem_threaded_access_tiled.c
+++ b/tests/gem_threaded_access_tiled.c
@@ -86,7 +86,7 @@ static int copy_tile_threaded(drm_intel_bo *bo)
return 0;
}
-int main(int argc, char **argv)
+igt_simple_main
{
int fd;
drm_intel_bo *bo;
@@ -119,6 +119,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_tiled_fence_blits.c b/tests/gem_tiled_fence_blits.c
index aa20293a..c72d25f9 100644
--- a/tests/gem_tiled_fence_blits.c
+++ b/tests/gem_tiled_fence_blits.c
@@ -100,7 +100,7 @@ check_bo(int fd, drm_intel_bo *bo, uint32_t start_val)
}
}
-int main(int argc, char **argv)
+igt_simple_main
{
drm_intel_bo *bo[4096];
uint32_t bo_start_val[4096];
@@ -170,6 +170,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_tiled_pread.c b/tests/gem_tiled_pread.c
index f3760938..0592b8c0 100644
--- a/tests/gem_tiled_pread.c
+++ b/tests/gem_tiled_pread.c
@@ -123,8 +123,7 @@ calculate_expected(int offset)
return (base_y + tile_y) * WIDTH + base_x + tile_x;
}
-int
-main(int argc, char **argv)
+igt_simple_main
{
int fd;
int i, iter = 100;
@@ -230,6 +229,4 @@ main(int argc, char **argv)
}
close(fd);
-
- return 0;
}
diff --git a/tests/gem_tiled_pread_pwrite.c b/tests/gem_tiled_pread_pwrite.c
index 3e1a7a8a..09d3ea4c 100644
--- a/tests/gem_tiled_pread_pwrite.c
+++ b/tests/gem_tiled_pread_pwrite.c
@@ -111,8 +111,7 @@ create_bo(int fd)
return handle;
}
-int
-main(int argc, char **argv)
+igt_simple_main
{
int fd;
uint32_t *data;
@@ -151,6 +150,4 @@ main(int argc, char **argv)
}
close(fd);
-
- return 0;
}
diff --git a/tests/gem_tiled_swapping.c b/tests/gem_tiled_swapping.c
index 8785a6f8..e8fcc7ef 100644
--- a/tests/gem_tiled_swapping.c
+++ b/tests/gem_tiled_swapping.c
@@ -90,8 +90,7 @@ create_bo_and_fill(int fd)
uint32_t *bo_handles;
int *idx_arr;
-int
-main(int argc, char **argv)
+igt_simple_main
{
int fd;
uint32_t *data;
@@ -136,6 +135,4 @@ main(int argc, char **argv)
}
close(fd);
-
- return 0;
}
diff --git a/tests/gem_tiling_max_stride.c b/tests/gem_tiling_max_stride.c
index a0fde46a..e4b58dcb 100644
--- a/tests/gem_tiling_max_stride.c
+++ b/tests/gem_tiling_max_stride.c
@@ -55,7 +55,7 @@ static void test_invalid_tiling(int fd, uint32_t handle, int stride)
* Testcase: Check that max fence stride works
*/
-int main(int argc, char *argv[])
+igt_simple_main
{
int fd;
uint32_t *ptr;
@@ -135,6 +135,4 @@ int main(int argc, char *argv[])
munmap(ptr, size);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_unfence_active_buffers.c b/tests/gem_unfence_active_buffers.c
index 71ab42c8..b79b124a 100644
--- a/tests/gem_unfence_active_buffers.c
+++ b/tests/gem_unfence_active_buffers.c
@@ -63,7 +63,7 @@ uint32_t devid;
uint32_t data[TEST_SIZE/4];
-int main(int argc, char **argv)
+igt_simple_main
{
int i, ret, fd, num_fences;
drm_intel_bo *busy_bo, *test_bo;
@@ -164,6 +164,4 @@ int main(int argc, char **argv)
}
}
intel_batchbuffer_flush(batch);
-
- return 0;
}
diff --git a/tests/gem_unref_active_buffers.c b/tests/gem_unref_active_buffers.c
index c4f73d9e..1e9e2146 100644
--- a/tests/gem_unref_active_buffers.c
+++ b/tests/gem_unref_active_buffers.c
@@ -51,7 +51,7 @@ static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
static drm_intel_bo *load_bo;
-int main(int argc, char **argv)
+igt_simple_main
{
int fd, i;
@@ -96,6 +96,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gem_vmap_blits.c b/tests/gem_vmap_blits.c
index 3c77281d..48297afc 100644
--- a/tests/gem_vmap_blits.c
+++ b/tests/gem_vmap_blits.c
@@ -247,6 +247,8 @@ int main(int argc, char **argv)
uint32_t start = 0;
int i, fd, count;
+ igt_simple_init();
+
igt_skip_on_simulation();
fd = drm_open_any();
diff --git a/tests/gem_wait_render_timeout.c b/tests/gem_wait_render_timeout.c
index 3253d7ff..29717525 100644
--- a/tests/gem_wait_render_timeout.c
+++ b/tests/gem_wait_render_timeout.c
@@ -100,7 +100,7 @@ static void blt_color_fill(struct intel_batchbuffer *batch,
ADVANCE_BATCH();
}
-int main(int argc, char **argv)
+igt_simple_main
{
drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
@@ -122,10 +122,8 @@ int main(int argc, char **argv)
dst = drm_intel_bo_alloc(bufmgr, "dst", BUF_SIZE, 4096);
dst2 = drm_intel_bo_alloc(bufmgr, "dst2", BUF_SIZE, 4096);
- if (gem_bo_wait_timeout(fd, dst->handle, &timeout) == -EINVAL) {
- printf("kernel doesn't support wait_timeout, skipping test\n");
- return 77;
- }
+ igt_skip_on_f(gem_bo_wait_timeout(fd, dst->handle, &timeout) == -EINVAL,
+ "kernel doesn't support wait_timeout, skipping test\n");
timeout = ENOUGH_WORK_IN_SECONDS * NSEC_PER_SEC;
/* Figure out a rough number of fills required to consume 1 second of
@@ -212,6 +210,4 @@ int main(int argc, char **argv)
drm_intel_bufmgr_destroy(bufmgr);
close(fd);
-
- return 0;
}
diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c
index 0b7109d4..17ccf202 100644
--- a/tests/gen3_mixed_blits.c
+++ b/tests/gen3_mixed_blits.c
@@ -464,6 +464,8 @@ int main(int argc, char **argv)
uint32_t start = 0;
int i, fd, count;
+ igt_simple_init();
+
fd = drm_open_any();
if (!IS_GEN3(intel_get_drm_devid(fd))) {
diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c
index 506d6d24..129b5068 100644
--- a/tests/gen3_render_linear_blits.c
+++ b/tests/gen3_render_linear_blits.c
@@ -332,6 +332,8 @@ int main(int argc, char **argv)
uint32_t start = 0;
int i, fd, count;
+ igt_simple_init();
+
fd = drm_open_any();
if (!IS_GEN3(intel_get_drm_devid(fd))) {
diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c
index b3e25daf..d60e7261 100644
--- a/tests/gen3_render_mixed_blits.c
+++ b/tests/gen3_render_mixed_blits.c
@@ -352,6 +352,8 @@ int main(int argc, char **argv)
uint32_t start = 0;
int i, fd, count;
+ igt_simple_init();
+
fd = drm_open_any();
if (!IS_GEN3(intel_get_drm_devid(fd))) {
diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c
index 3db8f0c1..427a5c71 100644
--- a/tests/gen3_render_tiledx_blits.c
+++ b/tests/gen3_render_tiledx_blits.c
@@ -339,6 +339,8 @@ int main(int argc, char **argv)
uint32_t start = 0;
int i, fd, count;
+ igt_simple_init();
+
fd = drm_open_any();
if (!IS_GEN3(intel_get_drm_devid(fd))) {
diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c
index 37a4d1a4..a82f994f 100644
--- a/tests/gen3_render_tiledy_blits.c
+++ b/tests/gen3_render_tiledy_blits.c
@@ -339,6 +339,8 @@ int main(int argc, char **argv)
uint32_t start = 0;
int i, fd, count;
+ igt_simple_init();
+
fd = drm_open_any();
if (!IS_GEN3(intel_get_drm_devid(fd))) {
diff --git a/tests/pm_psr.c b/tests/pm_psr.c
index 6139295d..def8e12d 100644
--- a/tests/pm_psr.c
+++ b/tests/pm_psr.c
@@ -78,7 +78,7 @@ static int get_perf(const char *path)
return perf;
}
-int main(int argc, char *argv[])
+igt_simple_main
{
int ret, perf1, perf2;
int device = drm_get_card();
@@ -97,6 +97,4 @@ int main(int argc, char *argv[])
fprintf(stderr, "Unable to enter PSR state again\n");
igt_fail(1);
}
-
- igt_success();
}
diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
index 3b873a08..3fd9d47e 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -54,7 +54,7 @@ static unsigned int readit(const char *path)
return ret;
}
-int main(int argc, char *argv[])
+igt_simple_main
{
const int device = drm_get_card();
char *path, *pathp, *pathpp;
@@ -116,6 +116,4 @@ int main(int argc, char *argv[])
"running and running no other tests)\n");
igt_fail(1);
}
-
- igt_success();
}
diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index e663a3cf..e8affdbc 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -127,7 +127,7 @@ static void dumpit(void)
}
-int main(int argc, char *argv[])
+igt_simple_main
{
const int device = drm_get_card();
struct junk *junk = stuff;
@@ -135,9 +135,6 @@ int main(int argc, char *argv[])
igt_skip_on_simulation();
- if (argc > 1)
- verbose++;
-
/* Use drm_open_any to verify device existence */
fd = drm_open_any();
close(fd);
@@ -189,6 +186,4 @@ int main(int argc, char *argv[])
writeval(stuff[MIN].filp, origmin);
writeval(stuff[MAX].filp, origmax);
-
- igt_success();
}
diff --git a/tests/prime_udl.c b/tests/prime_udl.c
index 463fc7e6..d8530851 100644
--- a/tests/prime_udl.c
+++ b/tests/prime_udl.c
@@ -147,20 +147,14 @@ out:
return ret;
}
-int main(int argc, char **argv)
+igt_simple_main
{
- int ret;
-
igt_skip_on_simulation();
- ret = find_and_open_devices();
- if (ret < 0)
- return ret;
+ igt_assert(find_and_open_devices() >= 0);
- if (udl_fd == -1 || intel_fd == -1) {
- printf("failed to find intel and udl GPU\n");
- return 77;
- }
+ igt_skip_on(udl_fd == -1);
+ igt_skip_on(intel_fd == -1);
/* set up intel bufmgr */
bufmgr = drm_intel_bufmgr_gem_init(intel_fd, 4096);
@@ -171,15 +165,9 @@ int main(int argc, char **argv)
intel_batch = intel_batchbuffer_alloc(bufmgr, devid);
/* create an object on the i915 */
- ret = test1();
- if (ret) {
- fprintf(stderr,"prime_test: failed test 1\n");
- return -1;
- }
+ igt_assert(test1() == 0);
- ret = test2();
- if (ret)
- fprintf(stderr,"prime_test: failed test 2 %d\n", ret);
+ igt_assert(test2() == 0);
intel_batchbuffer_free(intel_batch);
@@ -187,6 +175,4 @@ int main(int argc, char **argv)
close(intel_fd);
close(udl_fd);
-
- return ret;
}