lib: add igt_main macro

In the past new testcases with subtest often forgot to add the call to
igt_exit at the end of their main() function. That is now caught with
a bit more obnoxious asserts, but it's still a nuissance.

This little igt_main macro takes care of that (and also of calling the
subtest machinery initialization code correctly).

If no one objects I'll roll this out for all the simple cases (i.e.
those tests that don't have additional argv parsing on top of the
subtest machinery).

v2: Roll it out across the board.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter
2013-10-31 16:23:26 +01:00
parent 223a61e12e
commit 071e9ca1ca
40 changed files with 49 additions and 182 deletions
+1 -5
View File
@@ -77,10 +77,8 @@ test_create_fd_close(int fd)
int fd;
int main(int argc, char **argv)
igt_main
{
igt_subtest_init(argc, argv);
igt_fixture
fd = drm_open_any();
@@ -90,6 +88,4 @@ int main(int argc, char **argv)
test_create_close(fd);
igt_subtest("create-fd-close")
test_create_fd_close(fd);
igt_exit();
}