diff options
author | Petri Latvala <petri.latvala@intel.com> | 2019-05-23 15:27:14 +0300 |
---|---|---|
committer | Petri Latvala <petri.latvala@intel.com> | 2019-05-27 12:47:43 +0300 |
commit | b15d7f6c29dab4f63609de72663a5b364ebb4635 (patch) | |
tree | 1272e28aeec587bf6ab08811498efb8d1c81d21e /tests/kms_concurrent.c | |
parent | a1c3d34486ea03c28cdf612e928cb80a81499b77 (diff) |
kms_concurrent: Nuke custom main function
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests/kms_concurrent.c')
-rw-r--r-- | tests/kms_concurrent.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c index d82ca040..23b05ea1 100644 --- a/tests/kms_concurrent.c +++ b/tests/kms_concurrent.c @@ -372,30 +372,27 @@ static int opt_handler(int option, int option_index, void *input) opt.seed = strtol(optarg, NULL, 0); break; default: - igt_assert(false); + return IGT_OPT_HANDLER_ERROR; } - return 0; + return IGT_OPT_HANDLER_SUCCESS; } const char *help_str = " --iterations Number of iterations for test coverage. -1 loop forever, default 1 iteration\n" " --seed Seed for random number generator\n"; +struct option long_options[] = { + { "iterations", required_argument, NULL, 'i'}, + { "seed", required_argument, NULL, 's'}, + { 0, 0, 0, 0 } +}; static data_t data; -int main(int argc, char *argv[]) +igt_main_args("", long_options, help_str, opt_handler, NULL) { - struct option long_options[] = { - { "iterations", required_argument, NULL, 'i'}, - { "seed", required_argument, NULL, 's'}, - { 0, 0, 0, 0 } - }; enum pipe pipe; - igt_subtest_init_parse_opts(&argc, argv, "", long_options, help_str, - opt_handler, NULL); - igt_skip_on_simulation(); igt_fixture { @@ -414,6 +411,4 @@ int main(int argc, char *argv[]) igt_display_fini(&data.display); close(data.drm_fd); } - - igt_exit(); } |