Skip to content

Commit f03a54b

Browse files
committed
Ignore --test flag when it is an user-provided argument
1 parent 5675c76 commit f03a54b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main/main.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,10 @@ void Main::test_cleanup() {
861861

862862
int Main::test_entrypoint(int argc, char *argv[], bool &tests_need_run) {
863863
for (int x = 0; x < argc; x++) {
864+
// Early return to ignore a possible user-provided "--test" argument.
865+
if ((strlen(argv[x]) == 2) && ((strncmp(argv[x], "--", 2) == 0) || (strncmp(argv[x], "++", 2) == 0))) {
866+
return EXIT_SUCCESS;
867+
}
864868
if ((strncmp(argv[x], "--test", 6) == 0) && (strlen(argv[x]) == 6)) {
865869
tests_need_run = true;
866870
#ifdef TESTS_ENABLED

0 commit comments

Comments
 (0)