From 5a98fe9d4ae7431a9c65579dcc0ac32ff3e83adf Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 14 Jul 2014 14:42:23 +0200 Subject: [PATCH] lib: Add argc/argv to igt_simple_init There's a pile of ideas around to add generally useful options like --debug to all igt tests. Or unify the runtime behaviour between simple and subtest tests a bit more. The first step to get there is to add argc/argv to igt_simple_init so that we can get at the argument list. Cc: Tim Gore Cc: Thomas Wood Signed-off-by: Daniel Vetter --- lib/igt_core.c | 4 +++- lib/igt_core.h | 9 ++------- tests/gem_ctx_basic.c | 2 +- tests/gem_exec_blt.c | 2 +- tests/gem_gtt_speed.c | 2 +- tests/gem_hang.c | 2 +- tests/gem_render_copy.c | 2 +- tests/gem_render_linear_blits.c | 2 +- tests/gem_render_tiled_blits.c | 2 +- tests/gem_seqno_wrap.c | 2 +- tests/gem_stress.c | 2 +- tests/gen3_mixed_blits.c | 2 +- tests/gen3_render_linear_blits.c | 2 +- tests/gen3_render_mixed_blits.c | 2 +- tests/gen3_render_tiledx_blits.c | 2 +- tests/gen3_render_tiledy_blits.c | 2 +- tests/igt_simulation.c | 2 +- tests/kms_force_connector.c | 2 +- 18 files changed, 21 insertions(+), 24 deletions(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index b7bd169..1015b91 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -451,6 +451,8 @@ void igt_subtest_init(int argc, char **argv) /** * igt_simple_init: + * @argc: argc from the test's main() + * @argv: argv from the test's main() * * This initializes a simple test without any support for subtests. * @@ -458,7 +460,7 @@ void igt_subtest_init(int argc, char **argv) * #igt_simple_main block instead of stitching the tests's main() function together * manually. */ -void igt_simple_init(void) +void igt_simple_init(int argc, char **argv) { print_version(); diff --git a/lib/igt_core.h b/lib/igt_core.h index e252eba..8438d00 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -161,12 +161,7 @@ bool igt_only_list_subtests(void); } \ static void igt_tokencat(__real_main, __LINE__)(void) \ -/** - * igt_simple_init: - * - * Init for simple tests without subtests - */ -void igt_simple_init(void); +void igt_simple_init(int argc, char **argv); /** * igt_simple_main: @@ -178,7 +173,7 @@ void igt_simple_init(void); #define igt_simple_main \ static void igt_tokencat(__real_main, __LINE__)(void); \ int main(int argc, char **argv) { \ - igt_simple_init(); \ + igt_simple_init(argc, argv); \ igt_tokencat(__real_main, __LINE__)(); \ exit(0); \ } \ diff --git a/tests/gem_ctx_basic.c b/tests/gem_ctx_basic.c index 3e9b688..a2464fd 100644 --- a/tests/gem_ctx_basic.c +++ b/tests/gem_ctx_basic.c @@ -149,7 +149,7 @@ int main(int argc, char *argv[]) { int i; - igt_simple_init(); + igt_simple_init(argc, argv); fd = drm_open_any_render(); devid = intel_get_drm_devid(fd); diff --git a/tests/gem_exec_blt.c b/tests/gem_exec_blt.c index 3bcef18..db997b3 100644 --- a/tests/gem_exec_blt.c +++ b/tests/gem_exec_blt.c @@ -257,7 +257,7 @@ int main(int argc, char **argv) { int i; - igt_simple_init(); + igt_simple_init(argc, argv); igt_skip_on_simulation(); diff --git a/tests/gem_gtt_speed.c b/tests/gem_gtt_speed.c index 385eeb7..5125078 100644 --- a/tests/gem_gtt_speed.c +++ b/tests/gem_gtt_speed.c @@ -59,7 +59,7 @@ int main(int argc, char **argv) int loop, i, tiling; int fd; - igt_simple_init(); + igt_simple_init(argc, argv); igt_skip_on_simulation(); diff --git a/tests/gem_hang.c b/tests/gem_hang.c index 6248244..d5eb564 100644 --- a/tests/gem_hang.c +++ b/tests/gem_hang.c @@ -72,7 +72,7 @@ int main(int argc, char **argv) { int fd; - igt_simple_init(); + igt_simple_init(argc, argv); igt_assert_f(argc == 2, "usage: %s \n", diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c index fd26b43..76ba40e 100644 --- a/tests/gem_render_copy.c +++ b/tests/gem_render_copy.c @@ -127,7 +127,7 @@ int main(int argc, char **argv) int opt_dump_png = false; int opt_dump_aub = igt_aub_dump_enabled(); - igt_simple_init(); + igt_simple_init(argc, argv); while ((opt = getopt(argc, argv, "d")) != -1) { switch (opt) { diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c index f847486..ee99dea 100644 --- a/tests/gem_render_linear_blits.c +++ b/tests/gem_render_linear_blits.c @@ -90,7 +90,7 @@ int main(int argc, char **argv) uint32_t start = 0; int i, j, fd, count; - igt_simple_init(); + igt_simple_init(argc, argv); fd = drm_open_any(); diff --git a/tests/gem_render_tiled_blits.c b/tests/gem_render_tiled_blits.c index f63c57e..3d83f7c 100644 --- a/tests/gem_render_tiled_blits.c +++ b/tests/gem_render_tiled_blits.c @@ -105,7 +105,7 @@ int main(int argc, char **argv) int i, j, fd, count; uint32_t devid; - igt_simple_init(); + igt_simple_init(argc, argv); igt_skip_on_simulation(); diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c index beda28b..0fa722d 100644 --- a/tests/gem_seqno_wrap.c +++ b/tests/gem_seqno_wrap.c @@ -538,7 +538,7 @@ int main(int argc, char **argv) int wcount = 0; int r = -1; - igt_simple_init(); + igt_simple_init(argc, argv); parse_options(argc, argv); diff --git a/tests/gem_stress.c b/tests/gem_stress.c index 2ccb6fc..c8d7393 100644 --- a/tests/gem_stress.c +++ b/tests/gem_stress.c @@ -865,7 +865,7 @@ int main(int argc, char **argv) int i, j; unsigned *current_permutation, *tmp_permutation; - igt_simple_init(); + igt_simple_init(argc, argv); drm_fd = drm_open_any(); devid = intel_get_drm_devid(drm_fd); diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c index 75d61a5..33eea74 100644 --- a/tests/gen3_mixed_blits.c +++ b/tests/gen3_mixed_blits.c @@ -463,7 +463,7 @@ int main(int argc, char **argv) uint32_t start = 0; int i, fd, count; - igt_simple_init(); + igt_simple_init(argc, argv); fd = drm_open_any(); diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c index 7fe368d..7d4a228 100644 --- a/tests/gen3_render_linear_blits.c +++ b/tests/gen3_render_linear_blits.c @@ -331,7 +331,7 @@ int main(int argc, char **argv) uint32_t start = 0; int i, fd, count; - igt_simple_init(); + igt_simple_init(argc, argv); fd = drm_open_any(); diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c index 77ac0e2..1fe323c 100644 --- a/tests/gen3_render_mixed_blits.c +++ b/tests/gen3_render_mixed_blits.c @@ -351,7 +351,7 @@ int main(int argc, char **argv) uint32_t start = 0; int i, fd, count; - igt_simple_init(); + igt_simple_init(argc, argv); fd = drm_open_any(); diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c index 95c0c96..d8e2e87 100644 --- a/tests/gen3_render_tiledx_blits.c +++ b/tests/gen3_render_tiledx_blits.c @@ -338,7 +338,7 @@ int main(int argc, char **argv) uint32_t start = 0; int i, fd, count; - igt_simple_init(); + igt_simple_init(argc, argv); fd = drm_open_any(); diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c index 1b9a419..1a819e5 100644 --- a/tests/gen3_render_tiledy_blits.c +++ b/tests/gen3_render_tiledy_blits.c @@ -338,7 +338,7 @@ int main(int argc, char **argv) uint32_t start = 0; int i, fd, count; - igt_simple_init(); + igt_simple_init(argc, argv); fd = drm_open_any(); diff --git a/tests/igt_simulation.c b/tests/igt_simulation.c index 15cbe64..a1aa2f4 100644 --- a/tests/igt_simulation.c +++ b/tests/igt_simulation.c @@ -53,7 +53,7 @@ static int do_fork(void) assert(0); case 0: if (simple) { - igt_simple_init(); + igt_simple_init(1, argv_run); igt_skip_on_simulation(); diff --git a/tests/kms_force_connector.c b/tests/kms_force_connector.c index 39cacb9..47e2b48 100644 --- a/tests/kms_force_connector.c +++ b/tests/kms_force_connector.c @@ -36,7 +36,7 @@ main (int argc, char **argv) drmModeConnector *connector, *temp; igt_display_t display; - igt_simple_init(); + igt_simple_init(argc, argv); drm_fd = drm_open_any(); res = drmModeGetResources(drm_fd); -- 2.7.4