Skip to content

Commit

Permalink
Ignore --test flag when it is an user-provided argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Dowsley committed Sep 12, 2024
1 parent 5675c76 commit d202dcc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d202dcc

Please sign in to comment.