diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2014-07-07 19:58:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-09 13:48:35 (GMT) |
commit | 49948f72214f6e3a4acb566f773ac3ad86e6c68c (patch) | |
tree | 7e81570edd08a6a6376a68560240000544c6db92 /Source/CTest/cmCTestMemCheckHandler.h | |
parent | 4e7983bc06219e24ff37699b66a1e1697d2fc171 (diff) | |
download | CMake-49948f72214f6e3a4acb566f773ac3ad86e6c68c.zip CMake-49948f72214f6e3a4acb566f773ac3ad86e6c68c.tar.gz CMake-49948f72214f6e3a4acb566f773ac3ad86e6c68c.tar.bz2 |
ctest_memcheck: Add support for ThreadSanitizer
This commit adds support for ThreadSanitizer to ctest. ThreadSanitizer
is part of the clang compiler and also gcc 4.8 and later. You have to
compile the code with special flags. Then your code gets the the
ThreadSanitizer ability built into it. To pass options to the
ThreadSanitizer you use an environment variable. This commit teaches
ctest to parse the output from ThreadSanitizer and send it to CDash.
Diffstat (limited to 'Source/CTest/cmCTestMemCheckHandler.h')
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h index 20a38bb..ffe57f6 100644 --- a/Source/CTest/cmCTestMemCheckHandler.h +++ b/Source/CTest/cmCTestMemCheckHandler.h @@ -15,7 +15,10 @@ #include "cmCTestTestHandler.h" +#include "cmStandardIncludes.h" #include "cmListFileCache.h" +#include <vector> +#include <string> class cmMakefile; @@ -45,7 +48,9 @@ private: UNKNOWN = 0, VALGRIND, PURIFY, - BOUNDS_CHECKER + BOUNDS_CHECKER, + // checkers after hear do not use the standard error list + THREAD_SANITIZER }; public: enum { // Memory faults @@ -93,7 +98,17 @@ private: std::vector<std::string> MemoryTesterOptions; int MemoryTesterStyle; std::string MemoryTesterOutputFile; - int MemoryTesterGlobalResults[NO_MEMORY_FAULT]; + std::string MemoryTesterEnvironmentVariable; + // these are used to store the types of errors that can show up + std::vector<std::string> ResultStrings; + std::vector<std::string> ResultStringsLong; + std::vector<int> GlobalResults; + bool LogWithPID; // does log file add pid + + std::vector<int>::size_type FindOrAddWarning(const std::string& warning); + // initialize the ResultStrings and ResultStringsLong for + // this type of checker + void InitializeResultsVectors(); ///! Initialize memory checking subsystem. bool InitializeMemoryChecking(); @@ -110,17 +125,22 @@ private: //string. After running, log holds the output and results hold the //different memmory errors. bool ProcessMemCheckOutput(const std::string& str, - std::string& log, int* results); + std::string& log, std::vector<int>& results); bool ProcessMemCheckValgrindOutput(const std::string& str, - std::string& log, int* results); + std::string& log, + std::vector<int>& results); bool ProcessMemCheckPurifyOutput(const std::string& str, - std::string& log, int* results); + std::string& log, + std::vector<int>& results); + bool ProcessMemCheckThreadSanitizerOutput(const std::string& str, + std::string& log, + std::vector<int>& results); bool ProcessMemCheckBoundsCheckerOutput(const std::string& str, - std::string& log, int* results); + std::string& log, + std::vector<int>& results); - void PostProcessPurifyTest(cmCTestTestResult& res, int test); + void PostProcessTest(cmCTestTestResult& res, int test); void PostProcessBoundsCheckerTest(cmCTestTestResult& res, int test); - void PostProcessValgrindTest(cmCTestTestResult& res, int test); ///! append MemoryTesterOutputFile to the test log void AppendMemTesterOutput(cmCTestTestHandler::cmCTestTestResult& res, |