[igt-dev] [PATCH i-g-t 26/36] kms_force_connector_basic: Nuke custom main function
Petri Latvala
petri.latvala at intel.com
Thu May 23 12:27:17 UTC 2019
Signed-off-by: Petri Latvala <petri.latvala at intel.com>
---
tests/kms_force_connector_basic.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c
index b8246e66..20812d5e 100644
--- a/tests/kms_force_connector_basic.c
+++ b/tests/kms_force_connector_basic.c
@@ -65,25 +65,23 @@ static int opt_handler(int opt, int opt_index, void *data)
break;
}
- return 0;
+ return IGT_OPT_HANDLER_SUCCESS;
}
-int main(int argc, char **argv)
+struct option long_opts[] = {
+ {"reset", 0, 0, 'r'},
+ {0, 0, 0, 0}
+};
+const char *help_str =
+ " --reset\t\tReset all connector force states and edid.\n";
+
+igt_main_args("", long_opts, help_str, opt_handler, NULL)
{
/* force the VGA output and test that it worked */
int drm_fd = 0;
drmModeRes *res;
drmModeConnector *vga_connector = NULL, *temp;
int start_n_modes, start_connection;
- struct option long_opts[] = {
- {"reset", 0, 0, 'r'},
- {0, 0, 0, 0}
- };
- const char *help_str =
- " --reset\t\tReset all connector force states and edid.\n";
-
- igt_subtest_init_parse_opts(&argc, argv, "", long_opts, help_str,
- opt_handler, NULL);
igt_fixture {
unsigned vga_connector_id = 0;
@@ -320,6 +318,4 @@ int main(int argc, char **argv)
reset_connectors();
}
-
- igt_exit();
}
--
2.19.1
More information about the igt-dev
mailing list