[Cmake-commits] CMake branch, next, updated. v3.3.0-rc3-795-g0c7f85c
Betsy McPhail
betsy.mcphail at kitware.com
Thu Jul 2 11:28:16 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 0c7f85c5608b2b8e4a15ff935990c7c34d8a89de (commit)
via d07d4fb2281706fc861353c5b37fe100c982bfb5 (commit)
from ce0cf4d99389ca9bdb0631f72bb8b2e2fa0a9e84 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0c7f85c5608b2b8e4a15ff935990c7c34d8a89de
commit 0c7f85c5608b2b8e4a15ff935990c7c34d8a89de
Merge: ce0cf4d d07d4fb
Author: Betsy McPhail <betsy.mcphail at kitware.com>
AuthorDate: Thu Jul 2 11:28:15 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 2 11:28:15 2015 -0400
Merge topic 'show-number-of-tests' into next
d07d4fb2 Show the number of tests for each label in the CTest summary
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d07d4fb2281706fc861353c5b37fe100c982bfb5
commit d07d4fb2281706fc861353c5b37fe100c982bfb5
Author: Betsy McPhail <betsy.mcphail at kitware.com>
AuthorDate: Thu Jul 2 10:21:36 2015 -0400
Commit: Betsy McPhail <betsy.mcphail at kitware.com>
CommitDate: Thu Jul 2 11:24:10 2015 -0400
Show the number of tests for each label in the CTest summary
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 59576f4..1a6a462 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -656,9 +656,8 @@ int cmCTestTestHandler::ProcessHandler()
void cmCTestTestHandler::PrintLabelSummary()
{
cmCTestTestHandler::ListOfTests::iterator it = this->TestList.begin();
- cmCTestTestHandler::TestResultsVector::iterator ri =
- this->TestResults.begin();
std::map<std::string, double> labelTimes;
+ std::map<std::string, int> labelCounts;
std::set<std::string> labels;
// initialize maps
std::string::size_type maxlen = 0;
@@ -676,10 +675,12 @@ void cmCTestTestHandler::PrintLabelSummary()
}
labels.insert(*l);
labelTimes[*l] = 0;
+ labelCounts[*l] = 0;
}
}
}
- ri = this->TestResults.begin();
+ cmCTestTestHandler::TestResultsVector::iterator ri =
+ this->TestResults.begin();
// fill maps
for(; ri != this->TestResults.end(); ++ri)
{
@@ -691,6 +692,7 @@ void cmCTestTestHandler::PrintLabelSummary()
l != p.Labels.end(); ++l)
{
labelTimes[*l] += result.ExecutionTime;
+ ++labelCounts[*l];
}
}
}
@@ -705,10 +707,21 @@ void cmCTestTestHandler::PrintLabelSummary()
{
std::string label = *i;
label.resize(maxlen +3, ' ');
+
char buf[1024];
sprintf(buf, "%6.2f sec", labelTimes[*i]);
+
+ std::ostringstream labelCountStr;
+ labelCountStr << "(" << labelCounts[*i] << " test";
+ if (labelCounts[*i] > 1)
+ {
+ labelCountStr << "s";
+ }
+ labelCountStr << ")";
+
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "\n"
- << label << " = " << buf, this->Quiet );
+ << label << " = " << buf << " " << labelCountStr.str(),
+ this->Quiet );
if ( this->LogFile )
{
*this->LogFile << "\n" << *i << " = "
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..1ada61b 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)
-----------------------------------------------------------------------
Summary of changes:
Source/CTest/cmCTestTestHandler.cxx | 21 ++++++++++++++----
.../CTestCommandLine/LabelCount-stdout.txt | 7 ++++++
Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake | 23 ++++++++++++++++++++
3 files changed, 47 insertions(+), 4 deletions(-)
create mode 100644 Tests/RunCMake/CTestCommandLine/LabelCount-stdout.txt
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list