Skip to content

Commit d481669

Browse files
committed
Ignore --test flag when it is an user-provided argument
1 parent e65a237 commit d481669

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main/main.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,11 @@ void Main::test_cleanup() {
889889

890890
int Main::test_entrypoint(int argc, char *argv[], bool &tests_need_run) {
891891
for (int x = 0; x < argc; x++) {
892+
// Early return to ignore a possible user-provided "--test" argument.
893+
if ((strlen(argv[x]) == 2) && ((strncmp(argv[x], "--", 2) == 0) || (strncmp(argv[x], "++", 2) == 0))) {
894+
tests_need_run = false;
895+
return EXIT_SUCCESS;
896+
}
892897
if ((strncmp(argv[x], "--test", 6) == 0) && (strlen(argv[x]) == 6)) {
893898
tests_need_run = true;
894899
#ifdef TESTS_ENABLED

0 commit comments

Comments
 (0)