~ubuntu-branches/ubuntu/lucid/cmake/lucid

« back to all changes in this revision

Viewing changes to Source/CTest/cmCTestBuildCommand.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2009-12-16 11:11:54 UTC
  • mfrom: (3.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091216111154-6accvv6yq86h2hkc
Tags: 2.8.0-5ubuntu1
* Merge from debian testing (LP: #497349). Remaining changes:
  - Keep the Replaces: on cmake-data to cover the Kubuntu version from
    Jaunty in case someone decides to do an (unsupported) Jaunty->Lucid
    upgrade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*=========================================================================
2
 
 
3
 
  Program:   CMake - Cross-Platform Makefile Generator
4
 
  Module:    $RCSfile: cmCTestBuildCommand.cxx,v $
5
 
  Language:  C++
6
 
  Date:      $Date: 2007-09-17 14:40:57 $
7
 
  Version:   $Revision: 1.18 $
8
 
 
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.
11
 
 
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.
15
 
 
16
 
=========================================================================*/
 
1
/*============================================================================
 
2
  CMake - Cross Platform Makefile Generator
 
3
  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
 
4
 
 
5
  Distributed under the OSI-approved BSD License (the "License");
 
6
  see accompanying file Copyright.txt for details.
 
7
 
 
8
  This software is distributed WITHOUT ANY WARRANTY; without even the
 
9
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
10
  See the License for more information.
 
11
============================================================================*/
17
12
#include "cmCTestBuildCommand.h"
18
13
 
19
14
#include "cmCTest.h"
20
15
#include "cmCTestGenericHandler.h"
 
16
#include "cmCTestBuildHandler.h"
21
17
#include "cmake.h"
22
18
#include "cmGlobalGenerator.h"
23
19
 
26
22
cmCTestBuildCommand::cmCTestBuildCommand()
27
23
{
28
24
  this->GlobalGenerator = 0;
 
25
  this->Arguments[ctb_NUMBER_ERRORS] = "NUMBER_ERRORS";
 
26
  this->Arguments[ctb_NUMBER_WARNINGS] = "NUMBER_WARNINGS"; 
 
27
  this->Arguments[ctb_LAST] = 0;
 
28
  this->Last = ctb_LAST;
29
29
}
30
30
 
31
31
//----------------------------------------------------------------------------
48
48
    this->SetError("internal CTest error. Cannot instantiate build handler");
49
49
    return 0;
50
50
    }
51
 
 
 
51
  this->Handler =  (cmCTestBuildHandler*)handler;
52
52
  const char* ctestBuildCommand
53
53
    = this->Makefile->GetDefinition("CTEST_BUILD_COMMAND");
54
54
  if ( ctestBuildCommand && *ctestBuildCommand )
128
128
      }
129
129
    }
130
130
 
 
131
  if(const char* useLaunchers =
 
132
     this->Makefile->GetDefinition("CTEST_USE_LAUNCHERS"))
 
133
    {
 
134
    this->CTest->SetCTestConfiguration("UseLaunchers", useLaunchers);
 
135
    }
 
136
 
131
137
  return handler;
132
138
}
133
139
 
134
140
 
 
141
bool cmCTestBuildCommand::InitialPass(std::vector<std::string> const& args,
 
142
                                      cmExecutionStatus &status)
 
143
{
 
144
  bool ret =  cmCTestHandlerCommand::InitialPass(args, status);
 
145
  if ( this->Values[ctb_NUMBER_ERRORS] && *this->Values[ctb_NUMBER_ERRORS])
 
146
    {  
 
147
    cmOStringStream str;
 
148
    str << this->Handler->GetTotalErrors();
 
149
    this->Makefile->AddDefinition(
 
150
      this->Values[ctb_NUMBER_ERRORS], str.str().c_str());
 
151
    }
 
152
  if ( this->Values[ctb_NUMBER_WARNINGS]
 
153
       && *this->Values[ctb_NUMBER_WARNINGS])
 
154
    {
 
155
    cmOStringStream str;
 
156
    str << this->Handler->GetTotalWarnings();
 
157
    this->Makefile->AddDefinition(
 
158
      this->Values[ctb_NUMBER_WARNINGS], str.str().c_str());
 
159
    }
 
160
  return ret;
 
161
}