1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCTestCoverageCommand.cxx,v $
6 Date: $Date: 2009-03-05 15:17:42 $
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 "cmCTestCoverageCommand.h"
20 #include "cmCTestCoverageHandler.h"
22 //----------------------------------------------------------------------------
23 cmCTestCoverageCommand::cmCTestCoverageCommand()
25 this->LabelsMentioned
= false;
28 //----------------------------------------------------------------------------
29 cmCTestGenericHandler
* cmCTestCoverageCommand::InitializeHandler()
31 this->CTest
->SetCTestConfigurationFromCMakeVariable(this->Makefile
,
32 "CoverageCommand", "CTEST_COVERAGE_COMMAND");
34 cmCTestCoverageHandler
* handler
= static_cast<cmCTestCoverageHandler
*>(
35 this->CTest
->GetInitializedHandler("coverage"));
38 this->SetError("internal CTest error. Cannot instantiate test handler");
42 // If a LABELS option was given, select only files with the labels.
43 if(this->LabelsMentioned
)
45 handler
->SetLabelFilter(this->Labels
);
51 //----------------------------------------------------------------------------
52 bool cmCTestCoverageCommand::CheckArgumentKeyword(std::string
const& arg
)
54 // Look for arguments specific to this command.
57 this->ArgumentDoing
= ArgumentDoingLabels
;
58 this->LabelsMentioned
= true;
62 // Look for other arguments.
63 return this->Superclass::CheckArgumentKeyword(arg
);
66 //----------------------------------------------------------------------------
67 bool cmCTestCoverageCommand::CheckArgumentValue(std::string
const& arg
)
69 // Handle states specific to this command.
70 if(this->ArgumentDoing
== ArgumentDoingLabels
)
72 this->Labels
.insert(arg
);
76 // Look for other arguments.
77 return this->Superclass::CheckArgumentValue(arg
);