From d202dcc5b80449170a4f9db034560a894a66c805 Mon Sep 17 00:00:00 2001 From: Dowsley Date: Thu, 12 Sep 2024 14:56:14 -0300 Subject: [PATCH] Ignore --test flag when it is an user-provided argument --- main/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/main.cpp b/main/main.cpp index 18ffedef1877..42ef3074a8ee 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -861,6 +861,10 @@ void Main::test_cleanup() { int Main::test_entrypoint(int argc, char *argv[], bool &tests_need_run) { for (int x = 0; x < argc; x++) { + // Early return to ignore a possible user-provided "--tests" argument. + if ((strlen(argv[x]) == 2) && ((strncmp(argv[x], "--", 2) == 0) || (strncmp(argv[x], "++", 2) == 0))) { + return EXIT_SUCCESS; + } if ((strncmp(argv[x], "--test", 6) == 0) && (strlen(argv[x]) == 6)) { tests_need_run = true; #ifdef TESTS_ENABLED