diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-02-10 18:09:45 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-02-11 15:01:45 +0100 |
commit | bda8d7a0b003f982cdb5e9b985711306a2602fbd (patch) | |
tree | de309944c312a63156a41362a2930f6583b76070 /src/testlib | |
parent | d8158c6c93fc2a83f5acacc7baaf1a840951cf1e (diff) |
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>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestcase.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 17901eb08a..8b66d04fab 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -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); |