summaryrefslogtreecommitdiffstats
path: root/src/tools/androidtestrunner
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/androidtestrunner')
-rw-r--r--src/tools/androidtestrunner/CMakeLists.txt27
-rw-r--r--src/tools/androidtestrunner/main.cpp19
2 files changed, 42 insertions, 4 deletions
diff --git a/src/tools/androidtestrunner/CMakeLists.txt b/src/tools/androidtestrunner/CMakeLists.txt
new file mode 100644
index 0000000000..d7ec4a66fa
--- /dev/null
+++ b/src/tools/androidtestrunner/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Generated from androidtestrunner.pro.
+
+#####################################################################
+## androidtestrunner Binary:
+#####################################################################
+
+qt_add_executable(androidtestrunner
+ SOURCES
+ main.cpp
+ DEFINES
+ QT_NO_CAST_FROM_ASCII
+ QT_NO_CAST_TO_ASCII
+ QT_NO_FOREACH
+ PUBLIC_LIBRARIES
+ Qt::Gui
+)
+
+#### Keys ignored in scope 1:.:.:androidtestrunner.pro:<TRUE>:
+# _OPTION = "host_build"
+
+## Scopes:
+#####################################################################
+
+qt_extend_target(androidtestrunner CONDITION windows
+ COMPILE_OPTIONS
+ -U__STRICT_ANSI__
+)
diff --git a/src/tools/androidtestrunner/main.cpp b/src/tools/androidtestrunner/main.cpp
index 5471db3afd..f25d2c2de9 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;
+ }
}
}