1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCTestMemCheckHandler.h,v $
6 Date: $Date: 2007/07/24 18:43:31 $
7 Version: $Revision: 1.4 $
9 Copyright (c) 2002 Kitware, Inc. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
18 #ifndef cmCTestMemCheckHandler_h
19 #define cmCTestMemCheckHandler_h
22 #include "cmCTestTestHandler.h"
23 #include "cmListFileCache.h"
27 /** \class cmCTestMemCheckHandler
28 * \brief A class that handles ctest -S invocations
31 class cmCTestMemCheckHandler
: public cmCTestTestHandler
34 cmTypeMacro(cmCTestMemCheckHandler
, cmCTestTestHandler
);
36 void PopulateCustomVectors(cmMakefile
*mf
);
38 cmCTestMemCheckHandler();
42 virtual int PreProcessHandler();
43 virtual int PostProcessHandler();
44 virtual void GenerateTestCommand(std::vector
<const char*>& args
);
48 enum { // Memory checkers
55 enum { // Memory faults
81 enum { // Program statuses
93 std::string BoundsCheckerDPBDFile
;
94 std::string BoundsCheckerXMLFile
;
95 std::string MemoryTester
;
96 std::vector
<cmStdString
> MemoryTesterOptionsParsed
;
97 std::string MemoryTesterOptions
;
98 int MemoryTesterStyle
;
99 std::string MemoryTesterOutputFile
;
100 int MemoryTesterGlobalResults
[NO_MEMORY_FAULT
];
102 ///! Initialize memory checking subsystem.
103 bool InitializeMemoryChecking();
106 * Generate the Dart compatible output
108 void GenerateDartOutput(std::ostream
& os
);
110 std::vector
<cmStdString
> CustomPreMemCheck
;
111 std::vector
<cmStdString
> CustomPostMemCheck
;
113 //! Parse Valgrind/Purify/Bounds Checker result out of the output
114 //string. After running, log holds the output and results hold the
115 //different memmory errors.
116 bool ProcessMemCheckOutput(const std::string
& str
,
117 std::string
& log
, int* results
);
118 bool ProcessMemCheckValgrindOutput(const std::string
& str
,
119 std::string
& log
, int* results
);
120 bool ProcessMemCheckPurifyOutput(const std::string
& str
,
121 std::string
& log
, int* results
);
122 bool ProcessMemCheckBoundsCheckerOutput(const std::string
& str
,
123 std::string
& log
, int* results
);
127 virtual void ProcessOneTest(cmCTestTestProperties
*props
,
128 std::vector
<cmStdString
> &passed
,
129 std::vector
<cmStdString
> &failed
,
130 int count
, int tmsize
);
131 void PostProcessPurifyTest(cmCTestTestResult
& res
);
132 void PostProcessBoundsCheckerTest(cmCTestTestResult
& res
);