diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index ffa79c3c4..c1a8dc81e 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -608,6 +608,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector &passed, const std::string& testname = it->Name; std::vector& args = it->Args; cmCTestTestResult cres; + cres.Properties = &*it; cres.ExecutionTime = 0; cres.ReturnValue = -1; cres.Status = cmCTestTestHandler::NOT_RUN; @@ -1000,6 +1001,20 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os) << "name=\"Completion Status\">" << result->CompletionStatus << "\n"; } + os + << "\t\t\t" + << result->FullCommandLine << "\n"; + std::map::iterator measureIt; + for ( measureIt = result->Properties->Measurements.begin(); + measureIt != result->Properties->Measurements.end(); + ++ measureIt ) + { + os + << "\t\t\tfirst.c_str() << "\">" + << measureIt->second.c_str() << "\n"; + } os << "\t\t\t\n" << "\t\t\t\t"; @@ -1635,6 +1650,20 @@ bool cmCTestTestHandler::SetTestsProperties( cmsys::RegularExpression(crit->c_str())); } } + if ( key == "MEASUREMENT" ) + { + size_t pos = val.find_first_of("="); + if ( pos != val.npos ) + { + std::string mKey = val.substr(0, pos); + const char* mVal = val.c_str() + pos + 1; + rtit->Measurements[mKey] = mVal; + } + else + { + rtit->Measurements[val] = "1"; + } + } if ( key == "PASS_REGULAR_EXPRESSION" ) { std::vector lval; diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index c1d3c8f87..1b47e55b1 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -73,6 +73,21 @@ public: */ bool SetTestsProperties(const std::vector& args); + void Initialize(); + +protected: + struct cmCTestTestProperties + { + cmStdString Name; + cmStdString Directory; + std::vector Args; + std::vector ErrorRegularExpressions; + std::vector RequiredRegularExpressions; + std::map Measurements; + bool IsInBasedOnREOptions; + bool WillFail; + }; + struct cmCTestTestResult { std::string Name; @@ -85,20 +100,7 @@ public: std::string Output; std::string RegressionImages; int TestCount; - }; - - void Initialize(); - -protected: - struct cmCTestTestProperties - { - cmStdString Name; - cmStdString Directory; - std::vector Args; - std::vector ErrorRegularExpressions; - std::vector RequiredRegularExpressions; - bool IsInBasedOnREOptions; - bool WillFail; + cmCTestTestProperties* Properties; }; diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index e3f8ff2c7..b3febd2f5 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -914,6 +914,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) GET_TEST_PROPERTY(kwsys.testFail WILL_FAIL wfv) SET_TESTS_PROPERTIES(kwsys.testRegistry PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR;FAIL;Test failed") SET_TESTS_PROPERTIES(kwsys.testRegistry PROPERTIES PASS_REGULAR_EXPRESSION "Test passed") + SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value") MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}") ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) ENDIF(BUILD_TESTING)