ENH: mark some vars as advanced (and resort the list)
[cmake.git] / Source / ctest.h
blob1b0f2aedb5285390f9670bf4ed1feb2c0238fba2
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: ctest.h,v $
5 Language: C++
6 Date: $Date: 2002-10-09 02:54:24 $
7 Version: $Revision: 1.13 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 =========================================================================*/
19 #include "cmStandardIncludes.h"
21 class ctest
23 public:
24 /**
25 * Initialize and finalize testing
27 void Initialize();
28 void Finalize();
30 /**
31 * Process the tests. This is the main routine. The execution of the
32 * tests should look like this:
34 * ctest foo;
35 * foo.Initialize();
36 * // Set some things on foo
37 * foo.ProcessTests();
38 * foo.Finalize();
40 int ProcessTests();
42 /**
43 * Try to build the project
45 int BuildDirectory();
47 /**
48 * Try to run tests of the project
50 int TestDirectory();
52 /**
53 * Do revision control update of directory
55 int UpdateDirectory();
57 /**
58 * Do configure the project
60 int ConfigureDirectory();
62 /**
63 * Run the test for a directory and any subdirectories
65 void ProcessDirectory(std::vector<std::string> &passed,
66 std::vector<std::string> &failed);
68 /**
69 * Find the executable for a test
71 std::string FindExecutable(const char *exe);
73 /**
74 * Set the cmake test
76 bool SetTest(const char*);
78 /**
79 * constructor
81 ctest();
83 bool m_UseIncludeRegExp;
84 std::string m_IncludeRegExp;
86 bool m_UseExcludeRegExp;
87 bool m_UseExcludeRegExpFirst;
88 std::string m_ExcludeRegExp;
90 std::string m_ConfigType;
91 bool m_Verbose;
92 bool m_DartMode;
94 private:
95 enum {
96 FIRST_TEST = 0,
97 UPDATE_TEST,
98 CONFIGURE_TEST,
99 BUILD_TEST,
100 TEST_TEST,
101 COVERAGE_TEST,
102 PURIFY_TEST,
103 ALL_TEST,
104 LAST_TEST
107 struct cmCTestTestResult
109 std::string m_Name;
110 std::string m_Path;
111 std::string m_FullCommandLine;
112 double m_ExecutionTime;
113 int m_ReturnValue;
114 std::string m_CompletionStatus;
115 std::string m_Output;
118 struct cmCTestBuildErrorWarning
120 bool m_Error;
121 int m_LogLine;
122 std::string m_Text;
123 std::string m_SourceFile;
124 std::string m_SourceFileTail;
125 int m_LineNumber;
126 std::string m_PreContext;
127 std::string m_PostContext;
130 typedef std::vector<cmCTestTestResult> tm_TestResultsVector;
131 typedef std::map<std::string, std::string> tm_DartConfigurationMap;
133 tm_TestResultsVector m_TestResults;
134 std::string m_ToplevelPath;
135 tm_DartConfigurationMap m_DartConfiguration;
136 int m_Tests[LAST_TEST];
138 std::string m_CurrentTag;
140 std::string m_StartBuild;
141 std::string m_EndBuild;
142 std::string m_StartTest;
143 std::string m_EndTest;
146 * Generate the Dart compatible output
148 void GenerateDartOutput(std::ostream& os);
149 void GenerateDartBuildOutput(std::ostream& os,
150 std::vector<cmCTestBuildErrorWarning>);