Skip to content

Commit f45d2f8

Browse files
committed
Merge pull request #96926 from Dowsley/user-provided-arguments-fix
Ignore `--test` flag when it is an user-provided argument
2 parents d408264 + d481669 commit f45d2f8

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
@@ -864,6 +864,11 @@ void Main::test_cleanup() {
864864

865865
int Main::test_entrypoint(int argc, char *argv[], bool &tests_need_run) {
866866
for (int x = 0; x < argc; x++) {
867+
// Early return to ignore a possible user-provided "--test" argument.
868+
if ((strlen(argv[x]) == 2) && ((strncmp(argv[x], "--", 2) == 0) || (strncmp(argv[x], "++", 2) == 0))) {
869+
tests_need_run = false;
870+
return EXIT_SUCCESS;
871+
}
867872
if ((strncmp(argv[x], "--test", 6) == 0) && (strlen(argv[x]) == 6)) {
868873
tests_need_run = true;
869874
#ifdef TESTS_ENABLED

0 commit comments

Comments
 (0)