testlib: Don't abort on unrecognized -AppleFoo command line arguments

Allow passing command line arguments such as -AppleLocale, that override
user preferences for the test process.

Change-Id: I9e58e91fcb01a36f9d6c64ef52369308be5e95b5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Tor Arne Vestbø 2021-02-10 18:09:45 +01:00
parent d8158c6c93
commit bda8d7a0b0

View File

@ -787,10 +787,15 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, const char *const argv[], bool
} else if (strcmp(argv[i], "-vb") == 0) {
QBenchmarkGlobalData::current->verboseOutput = true;
#if defined(Q_OS_MAC) && defined(HAVE_XCTEST)
#if defined(Q_OS_DARWIN)
} else if (strncmp(argv[i], "-Apple", 6) == 0) {
i += 1; // Skip Apple-specific user preferences
continue;
# if defined(HAVE_XCTEST)
} else if (int skip = QXcodeTestLogger::parseCommandLineArgument(argv[i])) {
i += (skip - 1); // Eating argv[i] with a continue counts towards skips
continue;
# endif
#endif
} else if (argv[i][0] == '-') {
fprintf(stderr, "Unknown option: '%s'\n\n%s", argv[i], testOptions);