diff options
author | Petri Latvala <petri.latvala@intel.com> | 2019-05-23 15:27:23 +0300 |
---|---|---|
committer | Petri Latvala <petri.latvala@intel.com> | 2019-05-27 12:47:43 +0300 |
commit | 061f03ccca2372130456e3bd10038bdaa7e9341c (patch) | |
tree | 4b23342bc8dc7372a067fe508a65a292a7394281 | |
parent | defc37eb2a8e33c2894ba22545a06991146615c5 (diff) | |
download | igt-gpu-tools-061f03ccca2372130456e3bd10038bdaa7e9341c.tar.gz |
kms_setmode: Nuke custom main function
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
-rw-r--r-- | tests/kms_setmode.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c index c40c723d4..68b89b435 100644 --- a/tests/kms_setmode.c +++ b/tests/kms_setmode.c @@ -821,13 +821,17 @@ static int opt_handler(int opt, int opt_index, void *data) filter_test_id = atoi(optarg); break; default: - igt_assert(0); + return IGT_OPT_HANDLER_ERROR; } - return 0; + return IGT_OPT_HANDLER_SUCCESS; } -int main(int argc, char **argv) +const char *help_str = + " -d\t\tDon't run any test, only print what would be done. (still needs DRM access)\n" + " -t <test id>\tRun only the test with this id."; + +igt_main_args("dt:", NULL, help_str, opt_handler, NULL) { const struct { enum test_flags flags; @@ -845,16 +849,7 @@ int main(int argc, char **argv) { TEST_INVALID | TEST_CLONE | TEST_SINGLE_CRTC_CLONE | TEST_STEALING, "invalid-clone-single-crtc-stealing" } }; - const char *help_str = - " -d\t\tDon't run any test, only print what would be done. (still needs DRM access)\n" - " -t <test id>\tRun only the test with this id."; int i; - int ret; - - ret = igt_subtest_init_parse_opts(&argc, argv, "dt:", NULL, help_str, - opt_handler, NULL); - if (ret < 0) - return ret == -1 ? 0 : ret; igt_skip_on_simulation(); @@ -886,6 +881,4 @@ int main(int argc, char **argv) close(drm_fd); } - - igt_exit(); } |