3
3
Program: CMake - Cross-Platform Makefile Generator
4
4
Module: $RCSfile: cmCTest.h,v $
6
Date: $Date: 2003/11/03 20:38:23 $
7
Version: $Revision: 1.18 $
6
Date: $Date: 2004/07/29 18:45:51 $
7
Version: $Revision: 1.38.2.5 $
9
9
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10
10
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
22
22
#include "cmStandardIncludes.h"
23
#include "cmListFileCache.h"
30
typedef std::vector<cmStdString> tm_VectorOfStrings;
31
typedef std::vector<cmListFileArgument> tm_VectorOfListFileArgs;
33
///! Process Command line arguments
34
int Run(std::vector<std::string>const&, std::string* output = 0);
37
* Run a dashboard using a specified confiuration script
39
int RunConfigurationScript();
40
int RunConfigurationScript(const std::string& script);
41
int RunConfigurationDashboard(cmMakefile *mf,
42
const char *srcDir, const char *binDir,
43
const char *ctestRoot,
44
bool backup, const char *cvsCheckOut,
45
const char *ctestCmd);
28
48
* Initialize and finalize testing
82
102
* Run the test for a directory and any subdirectories
84
void ProcessDirectory(std::vector<std::string> &passed,
85
std::vector<std::string> &failed);
104
void ProcessDirectory(tm_VectorOfStrings &passed,
105
tm_VectorOfStrings &failed,
88
109
* Find the executable for a test
98
119
* Set the cmake test mode (experimental, nightly, continuous).
100
void SetTestModel(int mode)
121
void SetTestModel(int mode);
104
123
std::string GetTestModelString();
124
static int GetTestModelFromString(const char* str);
131
//! Set the notes files to be created.
132
void SetNotesFiles(const char* notes);
111
134
bool m_UseIncludeRegExp;
112
135
std::string m_IncludeRegExp;
146
bool m_ForceNewCTestProcess;
148
bool m_RunConfigurationScript;
149
tm_VectorOfStrings m_ConfigurationScripts;
157
int GenerateNotesFile(const char* files);
159
void RestoreBackupDirectories(bool backup,
160
const char *srcDir, const char *binDir,
161
const char *backupSrc, const char *backupBin);
164
void SetTestsToRunInformation(const char*);
165
void ExpandTestsToRunInformation(int numPossibleTests);
166
std::string TestsToRunString;
217
301
int m_Tests[LAST_TEST];
219
303
std::string m_CurrentTag;
221
306
std::string m_StartBuild;
222
307
std::string m_EndBuild;
223
308
std::string m_StartTest;
224
309
std::string m_EndTest;
310
double m_ElapsedTestingTime;
316
std::string m_MemoryTester;
317
std::string m_MemoryTesterOptions;
318
int m_MemoryTesterStyle;
319
std::string m_MemoryTesterOutputFile;
320
tm_VectorOfStrings m_MemoryTesterOptionsParsed;
321
int m_MemoryTesterGlobalResults[NO_MEMORY_FAULT];
323
int m_CompatibilityMode;
325
// information for the --build-and-test options
326
std::string m_ExecutableDirectory;
327
std::string m_CMakeSelf;
328
std::string m_CTestSelf;
329
std::string m_SourceDir;
330
std::string m_BinaryDir;
331
std::string m_BuildRunDir;
332
std::string m_BuildGenerator;
333
std::string m_BuildMakeProgram;
334
std::string m_BuildProject;
335
std::string m_BuildTarget;
336
std::vector<std::string> m_BuildOptions;
337
std::string m_TestCommand;
338
std::vector<std::string> m_TestCommandArgs;
339
bool m_BuildTwoConfig;
342
std::string m_NotesFiles;
343
std::vector<int> m_TestsToRun;
346
int ReadCustomConfigurationFileTree(const char* dir);
347
void PopulateCustomVector(cmMakefile* mf, const char* definition, tm_VectorOfStrings& vec);
349
tm_VectorOfStrings m_CustomErrorMatches;
350
tm_VectorOfStrings m_CustomErrorExceptions;
351
tm_VectorOfStrings m_CustomWarningMatches;
352
tm_VectorOfStrings m_CustomWarningExceptions;
354
tm_VectorOfStrings m_CustomTestsIgnore;
355
tm_VectorOfStrings m_CustomMemCheckIgnore;
357
tm_VectorOfStrings m_CustomPreTest;
358
tm_VectorOfStrings m_CustomPostTest;
359
tm_VectorOfStrings m_CustomPreMemCheck;
360
tm_VectorOfStrings m_CustomPostMemCheck;
361
bool m_InteractiveDebugMode;
363
void BlockTestErrorDiagnostics();
365
int ExecuteCommands(tm_VectorOfStrings& vec);
368
* Get the list of tests in directory and subdirectories.
370
void GetListOfTests(tm_ListOfTests* testlist, bool memcheck);
372
//! Reread the configuration file
373
void UpdateCTestConfiguration();
231
376
* Generate the Dart compatible output
233
378
void GenerateDartTestOutput(std::ostream& os);
379
void GenerateDartMemCheckOutput(std::ostream& os);
234
380
void GenerateDartBuildOutput(std::ostream& os,
235
std::vector<cmCTestBuildErrorWarning>);
381
std::vector<cmCTestBuildErrorWarning>,
382
double elapsed_time);
237
384
bool OpenOutputFile(const std::string& path,
238
385
const std::string& name, std::ofstream& stream);
248
395
//! Run command specialized for tests. Returns process status and retVal is
249
396
// return value or exception.
250
int RunTest(std::vector<const char*> args, std::string* output, int *retVal);
397
int RunTest(std::vector<const char*> args, std::string* output, int *retVal,
398
std::ostream* logfile);
252
400
std::string GenerateRegressionImages(const std::string& xml);
253
401
const char* GetTestStatus(int status);
403
//! Start CTest XML output file
404
void StartXML(std::ostream& ostr);
406
//! End CTest XML output file
407
void EndXML(std::ostream& ostr);
409
//! Create not from files.
410
int GenerateDartNotesOutput(std::ostream& os, const tm_VectorOfStrings& files);
412
//! Parse Valgrind/Purify/Bounds Checker result out of the output string. After running,
413
// log holds the output and results hold the different memmory errors.
414
bool ProcessMemCheckOutput(const std::string& str, std::string& log, int* results);
415
bool ProcessMemCheckValgrindOutput(const std::string& str, std::string& log, int* results);
416
bool ProcessMemCheckPurifyOutput(const std::string& str, std::string& log, int* results);
418
///! Run CMake and build a test and then run it as a single test.
419
int RunCMakeAndTest(std::string* output);
420
///! Initialize memory checking subsystem.
421
bool InitializeMemoryChecking();
422
///! Find the running cmake
423
void FindRunningCMake(const char* arg0);
425
///! Get the current time as string
426
std::string CurrentTime();