ENH: keep cleaning up Tcl/Tk modules
[cmake.git] / Source / CTest / cmCTestTestCommand.cxx
blobe937c9869c08e08cad8d40a4d0a95dd8a20b44c9
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCTestTestCommand.cxx,v $
5 Language: C++
6 Date: $Date: 2006-03-15 16:02:08 $
7 Version: $Revision: 1.10 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. 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 =========================================================================*/
17 #include "cmCTestTestCommand.h"
19 #include "cmCTest.h"
20 #include "cmCTestGenericHandler.h"
22 cmCTestTestCommand::cmCTestTestCommand()
24 this->Arguments[ctt_START] = "START";
25 this->Arguments[ctt_END] = "END";
26 this->Arguments[ctt_STRIDE] = "STRIDE";
27 this->Arguments[ctt_LAST] = 0;
28 this->Last = ctt_LAST;
31 cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
33 const char* ctestTimeout =
34 this->Makefile->GetDefinition("CTEST_TEST_TIMEOUT");
35 double timeout = this->CTest->GetTimeOut();
36 if ( ctestTimeout )
38 timeout = atof(ctestTimeout);
40 else
42 if ( timeout <= 0 )
44 // By default use timeout of 10 minutes
45 timeout = 600;
48 this->CTest->SetTimeOut(timeout);
49 cmCTestGenericHandler* handler = this->InitializeActualHandler();
50 if ( this->Values[ctt_START] || this->Values[ctt_END] ||
51 this->Values[ctt_STRIDE] )
53 cmOStringStream testsToRunString;
54 if ( this->Values[ctt_START] )
56 testsToRunString << this->Values[ctt_START];
58 testsToRunString << ",";
59 if ( this->Values[ctt_END] )
61 testsToRunString << this->Values[ctt_END];
63 testsToRunString << ",";
64 if ( this->Values[ctt_STRIDE] )
66 testsToRunString << this->Values[ctt_STRIDE];
68 handler->SetOption("TestsToRunInformation",
69 testsToRunString.str().c_str());
71 return handler;
74 cmCTestGenericHandler* cmCTestTestCommand::InitializeActualHandler()
76 return this->CTest->GetInitializedHandler("test");