From 071e9ca1ca4424ba35edec0246918efdd0528d76 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 31 Oct 2013 16:23:26 +0100 Subject: 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 --- tests/prime_nv_pcopy.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'tests/prime_nv_pcopy.c') diff --git a/tests/prime_nv_pcopy.c b/tests/prime_nv_pcopy.c index c6347dd9..12578f76 100644 --- a/tests/prime_nv_pcopy.c +++ b/tests/prime_nv_pcopy.c @@ -1263,10 +1263,8 @@ out: return ret; } -int main(int argc, char **argv) +igt_main { - igt_subtest_init(argc, argv); - igt_fixture { igt_assert(find_and_open_devices() == 0); @@ -1318,6 +1316,4 @@ int main(int argc, char **argv) close(intel_fd); close(nouveau_fd); } - - igt_exit(); } -- cgit v1.2.3