CppTest  Version 2.0.0
cpptest-compileroutput.h
Go to the documentation of this file.
1 // ---
2 //
3 // $Id: cpptest-compileroutput.h,v 1.3 2005/06/08 08:08:06 nilu Exp $
4 //
5 // CppTest - A C++ Unit Testing Framework
6 // Copyright (c) 2003 Niklas Lundell
7 //
8 // ---
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the
22 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 // Boston, MA 02111-1307, USA.
24 //
25 // ---
26 
29 #ifndef CPPTEST_COMPILEROUTPUT_H
30 #define CPPTEST_COMPILEROUTPUT_H
31 
32 #include <iostream>
33 #include <stdexcept>
34 
35 #include "cpptest-output.h"
36 
37 namespace Test
38 {
52  class CompilerOutput : public Output
53  {
54  public:
61  class InvalidFormat : public std::logic_error
62  {
63  public:
64  InvalidFormat(const std::string& what)
65  : std::logic_error(what) {}
66  };
67 
70  enum Format
71  {
76 
81  BCC,
82 
87  GCC,
88 
94  };
95 
96  explicit CompilerOutput(Format format = Generic,
97  std::ostream& stream = std::cout);
98 
99  explicit CompilerOutput(const std::string& format,
100  std::ostream& stream = std::cout);
101 
102  virtual void assertment(const Source& s);
103 
104  private:
105  std::string _format;
106  std::ostream& _stream;
107  };
108 
109 } // namespace Test
110 
111 #endif // #ifndef CPPTEST_COMPILEROUTPUT_H
112 
Compiler-like output handler.
Definition: cpptest-compileroutput.h:52
Format
Definition: cpptest-compileroutput.h:70
Assertment source information.
Definition: cpptest-source.h:42
Definition: cpptest-compileroutput.h:75
Definition: cpptest-compileroutput.h:87
Definition: collectoroutput.cpp:37
Definition: cpptest-compileroutput.h:81
Compiler output exception.
Definition: cpptest-compileroutput.h:61
Test suite output handler.
Definition: cpptest-output.h:55
CompilerOutput(Format format=Generic, std::ostream &stream=std::cout)
Definition: compileroutput.cpp:64
Definition: cpptest-compileroutput.h:93
virtual void assertment(const Source &s)
Definition: compileroutput.cpp:109