1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmAddTestCommand.cxx,v $
6 Date: $Date: 2008-01-23 15:27:59 $
7 Version: $Revision: 1.29 $
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 "cmAddTestCommand.h"
22 // cmExecutableCommand
24 ::InitialPass(std::vector
<std::string
> const& args
, cmExecutionStatus
&)
26 // First argument is the name of the test Second argument is the name of
27 // the executable to run (a target or external program) Remaining arguments
28 // are the arguments to pass to the executable
31 this->SetError("called with incorrect number of arguments");
35 // store the arguments for the final pass
36 // also expand any CMake variables
38 std::vector
<cmStdString
> arguments
;
39 std::vector
<std::string
>::const_iterator it
;
40 for ( it
= args
.begin() + 2; it
!= args
.end(); ++ it
)
42 arguments
.push_back(*it
);
45 cmTest
* test
= this->Makefile
->CreateTest(args
[0].c_str());
46 test
->SetCommand(args
[1].c_str());
47 test
->SetArguments(arguments
);