summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CTestCommandLine
diff options
context:
space:
mode:
authorBetsy McPhail <betsy.mcphail@kitware.com>2015-07-02 14:21:36 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-06 14:06:35 (GMT)
commit42747fcc73478073eaaee4c906ffe03c0b33c632 (patch)
treec1ecc967a52046398fe4beb269866d0d3ad383da /Tests/RunCMake/CTestCommandLine
parent8fbd9584af44100bbddd0f4031b57c5bc2530837 (diff)
downloadCMake-42747fcc73478073eaaee4c906ffe03c0b33c632.zip
CMake-42747fcc73478073eaaee4c906ffe03c0b33c632.tar.gz
CMake-42747fcc73478073eaaee4c906ffe03c0b33c632.tar.bz2
CTest: Show the number of tests for each label in the summary
Diffstat (limited to 'Tests/RunCMake/CTestCommandLine')
-rw-r--r--Tests/RunCMake/CTestCommandLine/LabelCount-stdout.txt7
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake23
2 files changed, 30 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestCommandLine/LabelCount-stdout.txt b/Tests/RunCMake/CTestCommandLine/LabelCount-stdout.txt
new file mode 100644
index 0000000..7fe04eb
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/LabelCount-stdout.txt
@@ -0,0 +1,7 @@
+100% tests passed, 0 tests failed out of 4
++
++Label Time Summary:
++'bar' = +[0-9.]+ sec \(3 tests\)
++'foo' = +[0-9.]+ sec \(1 test\)
++
+Total Test time \(real\) = +[0-9.]+ sec
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index aba1daf..dfc1e33 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -54,6 +54,29 @@ add_test(MergeOutput \"${CMAKE_COMMAND}\" -P \"${RunCMake_SOURCE_DIR}/MergeOutpu
endfunction()
run_MergeOutput()
+function(run_LabelCount)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/LabelCount)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\")
+set_tests_properties(test1 PROPERTIES LABELS 'bar')
+
+add_test(test2 \"${CMAKE_COMMAND}\" -E echo \"test2\")
+set_tests_properties(test2 PROPERTIES LABELS 'bar')
+
+add_test(test3 \"${CMAKE_COMMAND}\" -E echo \"test3\")
+set_tests_properties(test3 PROPERTIES LABELS 'foo')
+
+add_test(test4 \"${CMAKE_COMMAND}\" -E echo \"test4\")
+set_tests_properties(test4 PROPERTIES LABELS 'bar')
+")
+
+ run_cmake_command(LabelCount ${CMAKE_CTEST_COMMAND} -V)
+endfunction()
+
+run_LabelCount()
function(run_TestLoad name load)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TestLoad)