summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorSergey Bronnikov <estetus@gmail.com>2021-04-27 08:01:21 (GMT)
committerBrad King <brad.king@kitware.com>2021-04-28 13:28:25 (GMT)
commit3f6ff4b5dba01f2f58dca75546ebefd0830110a5 (patch)
tree554978b7174afed2e1899b76b9f2c63397eb75fd /Tests
parenta3aa5596a11b67c0de860b9cb366038c3da2a4e2 (diff)
downloadCMake-3f6ff4b5dba01f2f58dca75546ebefd0830110a5.zip
CMake-3f6ff4b5dba01f2f58dca75546ebefd0830110a5.tar.gz
CMake-3f6ff4b5dba01f2f58dca75546ebefd0830110a5.tar.bz2
create_test_sourcelist: add test driver option to run all tests
New option `-A` passed to test binary allows to run all testcases at once and prints a report in a standard format - TestAnythingProtocol v.13 [1]. Execution of test whose names will be passed after an option will be skipped. Sample of output: TAP version 13 1..6 ok 1 TestCryptoHash # 0.030000 ok 2 TestCryptoRand # 0.008000 not ok 3 TestCryptoCipher # 0.005000 ok 4 TestCryptoProtectData # 0.000000 cbPlainText: 21 cbCipherText: 32 PlainText: MySecretPassword123! (cbPlainText = 21, cbCipherText = 32) Decrypted CipherText: MySecretPassword123! ok 5 TestCryptoProtectMemory # 0.014000 ok 6 TestCryptoCertEnumCertificatesInStore # 0.000000 1. https://testanything.org/ Fixes: #19367
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt26
1 files changed, 26 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index cd1b465..f9df95a 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1772,6 +1772,32 @@ if(BUILD_TESTING)
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver3")
+ add_test(testdriver4 ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/TestDriver"
+ "${CMake_BINARY_DIR}/Tests/TestDriver4"
+ ${build_generator_args}
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
+ --build-project TestDriverTest
+ --test-command TestDriverTest -A test2
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver4")
+
+ add_test(testdriver5 ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/TestDriver"
+ "${CMake_BINARY_DIR}/Tests/TestDriver5"
+ ${build_generator_args}
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
+ --build-project TestDriverTest
+ --test-command TestDriverTest -A test2
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver5")
+ set_tests_properties(testdriver5 PROPERTIES
+ PASS_REGULAR_EXPRESSION
+ "TAP version 13\n1\\.\\.3.+ok 1 test1 # [0-9]+\\.[0-9]+.*All tests finished."
+ )
+
add_test(Dependency ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Dependency"