Commit 5a98fe9d authored by Daniel Vetter's avatar Daniel Vetter

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 <tim.gore@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent c7be53c7
......@@ -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();
......
......@@ -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); \
} \
......
......@@ -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);
......
......@@ -257,7 +257,7 @@ int main(int argc, char **argv)
{
int i;
igt_simple_init();
igt_simple_init(argc, argv);
igt_skip_on_simulation();
......
......@@ -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();
......
......@@ -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 <disabled pipe number>\n",
......
......@@ -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) {
......
......@@ -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();
......
......@@ -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();
......
......@@ -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);
......
......@@ -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);
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment