diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2023-11-29 13:45:04 +0200 |
---|---|---|
committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2023-12-13 20:52:16 +0200 |
commit | 4a3936c33cb2ab9fee2e93cbe99d31daf1cd0cc8 (patch) | |
tree | 30d426078286eff9f91ae6ee38266c4ab114b3ea /cmake/QtTestHelpers.cmake | |
parent | 76a1c7690fd9f8e747a2bbdd5d910bebd6ef162c (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.7 6.6 6.5
Change-Id: I4820cfe58f05d15179b4af819caa92e475881634
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtTestHelpers.cmake')
-rw-r--r-- | cmake/QtTestHelpers.cmake | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 7ac7058131..9edf5274bd 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -606,12 +606,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(EXISTS "${OPENSSL_ROOT_DIR}/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_3.so") message(STATUS "Looking for OpenSSL in ${OPENSSL_ROOT_DIR}") @@ -737,6 +737,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 "") |