From 5aaaee5e9e67b637c3e34346715377145bc08a97 Mon Sep 17 00:00:00 2001 From: Betsy McPhail Date: Tue, 28 Aug 2018 16:45:49 -0400 Subject: ctest_memcheck: Change failure to find log file from error to warning Sanitizers do not create a log file when no defects are found. Therefore, it is currently impossible for ctest_memcheck to set both `CAPTURE_CMAKE_ERROR` and `RETURN_VALUE` to zero. With defects, `CAPTURE_CMAKE_ERROR`=0 and `RETURN_VALUE`=-1, as expected. With no defects, `CAPTURE_CMAKE_ERROR`=-1 and `RETURN_VALUE`=0. --- Source/CTest/cmCTestMemCheckHandler.cxx | 4 ++-- Tests/RunCMake/ctest_memcheck/DummyAddressLeakSanitizer-result.txt | 1 - Tests/RunCMake/ctest_memcheck/DummyAddressSanitizer-result.txt | 1 - Tests/RunCMake/ctest_memcheck/DummyLeakSanitizer-result.txt | 1 - .../RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-result.txt | 1 - Tests/RunCMake/ctest_memcheck/DummyMemorySanitizer-result.txt | 1 - Tests/RunCMake/ctest_memcheck/DummyPurifyNoLogFile-result.txt | 1 - Tests/RunCMake/ctest_memcheck/DummyThreadSanitizer-result.txt | 1 - .../ctest_memcheck/DummyUndefinedBehaviorSanitizer-result.txt | 1 - Tests/RunCMake/ctest_memcheck/DummyValgrindCustomOptions-result.txt | 1 - Tests/RunCMake/ctest_memcheck/DummyValgrindNoLogFile-result.txt | 1 - 11 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 Tests/RunCMake/ctest_memcheck/DummyAddressLeakSanitizer-result.txt delete mode 100644 Tests/RunCMake/ctest_memcheck/DummyAddressSanitizer-result.txt delete mode 100644 Tests/RunCMake/ctest_memcheck/DummyLeakSanitizer-result.txt delete mode 100644 Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-result.txt delete mode 100644 Tests/RunCMake/ctest_memcheck/DummyMemorySanitizer-result.txt delete mode 100644 Tests/RunCMake/ctest_memcheck/DummyPurifyNoLogFile-result.txt delete mode 100644 Tests/RunCMake/ctest_memcheck/DummyThreadSanitizer-result.txt delete mode 100644 Tests/RunCMake/ctest_memcheck/DummyUndefinedBehaviorSanitizer-result.txt delete mode 100644 Tests/RunCMake/ctest_memcheck/DummyValgrindCustomOptions-result.txt delete mode 100644 Tests/RunCMake/ctest_memcheck/DummyValgrindNoLogFile-result.txt diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 04d1839..9c9532a 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -1087,7 +1087,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames( g.FindFiles(ofile); if (g.GetFiles().empty()) { std::string log = "Cannot find memory tester output file: " + ofile; - cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl); + cmCTestLog(this->CTest, WARNING, log << std::endl); ofile.clear(); } else { files = g.GetFiles(); @@ -1095,7 +1095,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames( } } else if (!cmSystemTools::FileExists(ofile)) { std::string log = "Cannot find memory tester output file: " + ofile; - cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl); + cmCTestLog(this->CTest, WARNING, log << std::endl); ofile.clear(); } files.push_back(std::move(ofile)); diff --git a/Tests/RunCMake/ctest_memcheck/DummyAddressLeakSanitizer-result.txt b/Tests/RunCMake/ctest_memcheck/DummyAddressLeakSanitizer-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_memcheck/DummyAddressLeakSanitizer-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_memcheck/DummyAddressSanitizer-result.txt b/Tests/RunCMake/ctest_memcheck/DummyAddressSanitizer-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_memcheck/DummyAddressSanitizer-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizer-result.txt b/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizer-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizer-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-result.txt b/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_memcheck/DummyLeakSanitizerPrintDefects-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_memcheck/DummyMemorySanitizer-result.txt b/Tests/RunCMake/ctest_memcheck/DummyMemorySanitizer-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_memcheck/DummyMemorySanitizer-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_memcheck/DummyPurifyNoLogFile-result.txt b/Tests/RunCMake/ctest_memcheck/DummyPurifyNoLogFile-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_memcheck/DummyPurifyNoLogFile-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_memcheck/DummyThreadSanitizer-result.txt b/Tests/RunCMake/ctest_memcheck/DummyThreadSanitizer-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_memcheck/DummyThreadSanitizer-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_memcheck/DummyUndefinedBehaviorSanitizer-result.txt b/Tests/RunCMake/ctest_memcheck/DummyUndefinedBehaviorSanitizer-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_memcheck/DummyUndefinedBehaviorSanitizer-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_memcheck/DummyValgrindCustomOptions-result.txt b/Tests/RunCMake/ctest_memcheck/DummyValgrindCustomOptions-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_memcheck/DummyValgrindCustomOptions-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/ctest_memcheck/DummyValgrindNoLogFile-result.txt b/Tests/RunCMake/ctest_memcheck/DummyValgrindNoLogFile-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/ctest_memcheck/DummyValgrindNoLogFile-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) -- cgit v0.12