diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2016-02-18 18:59:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-03-22 15:17:55 (GMT) |
commit | 993e48d0451b41f8e2c2a59473d9ddc09ada5792 (patch) | |
tree | ef678a032f62e84338653b903e6be7ebc0522d2b /Help/prop_test/TIMEOUT_AFTER_MATCH.rst | |
parent | 2b64dc7cabb6eda86f0c8b91b27aee4119ac7ebb (diff) | |
download | CMake-993e48d0451b41f8e2c2a59473d9ddc09ada5792.zip CMake-993e48d0451b41f8e2c2a59473d9ddc09ada5792.tar.gz CMake-993e48d0451b41f8e2c2a59473d9ddc09ada5792.tar.bz2 |
CTest: Optionally use a secondary test timeout after matching output
Allow a test N seconds to complete after we detect a matching line in
its output. Activate this behavior with a new TIMEOUT_AFTER_MATCH test
property.
Diffstat (limited to 'Help/prop_test/TIMEOUT_AFTER_MATCH.rst')
-rw-r--r-- | Help/prop_test/TIMEOUT_AFTER_MATCH.rst | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Help/prop_test/TIMEOUT_AFTER_MATCH.rst b/Help/prop_test/TIMEOUT_AFTER_MATCH.rst new file mode 100644 index 0000000..a191a9c --- /dev/null +++ b/Help/prop_test/TIMEOUT_AFTER_MATCH.rst @@ -0,0 +1,37 @@ +TIMEOUT_AFTER_MATCH +------------------- + +Change a test's timeout duration after a matching line is encountered +in its output. + +Usage +^^^^^ + +.. code-block:: cmake + + add_test(mytest ...) + set_property(TEST mytest PROPERTY TIMEOUT_AFTER_MATCH "${seconds}" "${regex}") + +Description +^^^^^^^^^^^ + +Allow a test ``seconds`` to complete after ``regex`` is encountered in +its output. + +When the test outputs a line that matches ``regex`` its start time is +reset to the current time and its timeout duration is changed to +``seconds``. Prior to this, the timeout duration is determined by the +:prop_test:`TIMEOUT` property or the :variable:`CTEST_TEST_TIMEOUT` +variable if either of these are set. + +:prop_test:`TIMEOUT_AFTER_MATCH` is useful for avoiding spurious +timeouts when your test must wait for some system resource to become +available before it can execute. Set :prop_test:`TIMEOUT` to a longer +duration that accounts for resource acquisition and use +:prop_test:`TIMEOUT_AFTER_MATCH` to control how long the actual test +is allowed to run. + +If the required resource can be controlled by CTest you should use +:prop_test:`RESOURCE_LOCK` instead of :prop_test:`TIMEOUT_AFTER_MATCH`. +This property should be used when only the test itself can determine +when its required resources are available. |