diff options
Diffstat (limited to 'main/main.h')
-rw-r--r-- | main/main.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/main/main.h b/main/main.h index 308128735c..20c0bebefa 100644 --- a/main/main.h +++ b/main/main.h @@ -45,7 +45,7 @@ class Main { public: static bool is_project_manager(); - + static int test_entrypoint(int argc, char *argv[], bool &tests_need_run); static Error setup(const char *execpath, int argc, char *argv[], bool p_second_phase = true); static Error setup2(Thread::ID p_main_tid_override = 0); static bool start(); @@ -58,4 +58,19 @@ public: static void cleanup(); }; +// Test main override is for the testing behaviour +#define TEST_MAIN_OVERRIDE \ + bool run_test = false; \ + int return_code = Main::test_entrypoint(argc, argv, run_test); \ + if (run_test) { \ + return return_code; \ + } + +#define TEST_MAIN_PARAM_OVERRIDE(argc, argv) \ + bool run_test = false; \ + int return_code = Main::test_entrypoint(argc, argv, run_test); \ + if (run_test) { \ + return return_code; \ + } + #endif // MAIN_H |