summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2023-11-29 13:45:04 +0200
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2023-12-15 02:52:24 +0200
commit3d2265b333b97e9e564833948021306cbc3b1940 (patch)
tree6cd88d6366103871f9f10edc73ce0e88f3c131c8 /cmake
parentb1aa12b3dee092f117453cbef8ab3cbf0c2a3f85 (diff)
AndroidTestRunner: uninstall the test when interrupted
If the test runner was interrupted, stop waiting for the test to start or to finish, go fetch the available test results and logcat and uninstall the test app. Also, set CMake TIMEOUT_SIGNAL_NAME to SIGINT and TIMEOUT_SIGNAL_GRACE_PERIOD to 10 seconds to allow enough time to fetch the logs and uninstall the test app. Task-number: QTBUG-106479 Pick-to: 6.5 Change-Id: I4820cfe58f05d15179b4af819caa92e475881634 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 4a3936c33cb2ab9fee2e93cbe99d31daf1cd0cc8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit aecf64eb7b896285d66b22fd725cb11e83f5e807)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtTestHelpers.cmake18
1 files changed, 13 insertions, 5 deletions
diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake
index 9bde392077..f5470db9fd 100644
--- a/cmake/QtTestHelpers.cmake
+++ b/cmake/QtTestHelpers.cmake
@@ -579,12 +579,12 @@ function(qt_internal_add_test name)
endif()
endif()
- # Pass 95% of the timeout to allow the test runner time to do any cleanup
- # before being killed.
- set(percentage "95")
- qt_internal_get_android_test_timeout("${arg_TIMEOUT}" "${percentage}" android_timeout)
-
if (ANDROID)
+ # Pass 95% of the timeout to allow the test runner time to do any cleanup
+ # before being killed.
+ set(percentage "95")
+ qt_internal_get_android_test_timeout("${arg_TIMEOUT}" "${percentage}" android_timeout)
+
if(arg_BUNDLE_ANDROID_OPENSSL_LIBS)
if(NOT OPENSSL_ROOT_DIR)
message(WARNING "The argument BUNDLE_ANDROID_OPENSSL_LIBS is set "
@@ -695,6 +695,14 @@ function(qt_internal_add_test name)
set_tests_properties(${testname} PROPERTIES TIMEOUT ${arg_TIMEOUT})
endif()
+ if(ANDROID)
+ # Set timeout signal and some time for androidtestrunner to do cleanup
+ set_tests_properties(${testname} PROPERTIES
+ TIMEOUT_SIGNAL_NAME "SIGINT"
+ TIMEOUT_SIGNAL_GRACE_PERIOD 10.0
+ )
+ endif()
+
# Add a ${target}/check makefile target, to more easily test one test.
set(test_config_options "")