Updated formatting of documentation plus a little reorganization.
[cmake.git] / Source / CTest / cmCTestCoverageCommand.cxx
bloba2b29b7a69c8627f39389f58d20f1620caf68ce2
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCTestCoverageCommand.cxx,v $
5 Language: C++
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"
19 #include "cmCTest.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"));
36 if ( !handler )
38 this->SetError("internal CTest error. Cannot instantiate test handler");
39 return 0;
42 // If a LABELS option was given, select only files with the labels.
43 if(this->LabelsMentioned)
45 handler->SetLabelFilter(this->Labels);
48 return handler;
51 //----------------------------------------------------------------------------
52 bool cmCTestCoverageCommand::CheckArgumentKeyword(std::string const& arg)
54 // Look for arguments specific to this command.
55 if(arg == "LABELS")
57 this->ArgumentDoing = ArgumentDoingLabels;
58 this->LabelsMentioned = true;
59 return 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);
73 return true;
76 // Look for other arguments.
77 return this->Superclass::CheckArgumentValue(arg);