mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-11 16:32:58 +00:00
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:
@@ -138,6 +138,16 @@ bool __igt_run_subtest(const char *subtest_name);
|
||||
(setjmp(igt_subtest_jmpbuf) == 0); \
|
||||
igt_success())
|
||||
const char *igt_subtest_name(void);
|
||||
#define igt_main \
|
||||
static void igt_tokencat(__real_main, __LINE__)(void); \
|
||||
int main(int argc, char **argv) { \
|
||||
igt_subtest_init(argc, argv); \
|
||||
igt_tokencat(__real_main, __LINE__)(); \
|
||||
igt_exit(); \
|
||||
} \
|
||||
static void igt_tokencat(__real_main, __LINE__)(void) \
|
||||
|
||||
|
||||
/**
|
||||
* igt_skip - subtest aware test skipping
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user