diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2019-10-23 17:21:36 +0200 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2019-10-24 07:16:51 +0000 |
commit | 340763d1ff55b740acec34537c8f1140064e6393 (patch) | |
tree | a8e86c7e0a6be20dc2acc3109c4345b02cb17e06 /src/tools | |
parent | f2cb720e3fc465c96314f35ae621a2ae977b1e0e (diff) |
Add --skip-install-root option to androidtestrunner
Add the above option to android test runner since its not required
when building with Cmake.
Change-Id: Ie5c9b0af29cfa76802723960071b3bd2a37a56a5
Reviewed-by: Qt CMake Build Bot
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/androidtestrunner/main.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/tools/androidtestrunner/main.cpp b/src/tools/androidtestrunner/main.cpp index f61d407d4a..18c4a680be 100644 --- a/src/tools/androidtestrunner/main.cpp +++ b/src/tools/androidtestrunner/main.cpp @@ -51,6 +51,7 @@ struct Options { bool helpRequested = false; bool verbose = false; + bool skipAddInstallRoot = false; std::chrono::seconds timeout{300}; // 5minutes QString androidDeployQtCommand; QString buildPath; @@ -233,6 +234,8 @@ static bool parseOptions() g_options.helpRequested = true; else g_options.activity = arguments.at(++i); + } else if (argument.compare(QStringLiteral("--skip-install-root"), Qt::CaseInsensitive) == 0) { + g_options.skipAddInstallRoot = true; } else if (argument.compare(QStringLiteral("--timeout"), Qt::CaseInsensitive) == 0) { if (i + 1 == arguments.size()) g_options.helpRequested = true; @@ -283,6 +286,7 @@ static void printHelp() " If make is missing make sure the --path is set.\n" " --apk <apk path>: If the apk is specified and if exists, we'll skip\n" " the package building.\n" + " --skip-install-root: Do not append INSTALL_ROOT=... to the make command.\n" " -- arguments that will be passed to the test application.\n" " --verbose: Prints out information during processing.\n" " --help: Displays this information.\n\n", @@ -452,10 +456,17 @@ int main(int argc, char *argv[]) } } else { if (!g_options.makeCommand.isEmpty()) { - // we need to run make INSTALL_ROOT=path install to install the application file(s) first - if (!execCommand(QStringLiteral("%1 INSTALL_ROOT=%2 install") - .arg(g_options.makeCommand, QDir::toNativeSeparators(g_options.buildPath)), nullptr, g_options.verbose)) { - return 1; + if (!g_options.skipAddInstallRoot) { + // we need to run make INSTALL_ROOT=path install to install the application file(s) first + if (!execCommand(QStringLiteral("%1 INSTALL_ROOT=%2 install") + .arg(g_options.makeCommand, QDir::toNativeSeparators(g_options.buildPath)), nullptr, g_options.verbose)) { + return 1; + } + } else { + if (!execCommand(QStringLiteral("%1") + .arg(g_options.makeCommand), nullptr, g_options.verbose)) { + return 1; + } } } |