CppTest home page CppTest project page

cpptest-compileroutput.h

Go to the documentation of this file.
00001 // ---
00002 //
00003 // $Id: cpptest-compileroutput.h,v 1.3 2005/06/08 08:08:06 nilu Exp $
00004 //
00005 // CppTest - A C++ Unit Testing Framework
00006 // Copyright (c) 2003 Niklas Lundell
00007 //
00008 // ---
00009 //
00010 // This library is free software; you can redistribute it and/or
00011 // modify it under the terms of the GNU Lesser General Public
00012 // License as published by the Free Software Foundation; either
00013 // version 2 of the License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the
00022 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00023 // Boston, MA 02111-1307, USA.
00024 //
00025 // ---
00026 
00029 #ifndef CPPTEST_COMPILEROUTPUT_H
00030 #define CPPTEST_COMPILEROUTPUT_H
00031 
00032 #include <iostream>
00033 #include <stdexcept>
00034 
00035 #include "cpptest-output.h"
00036 
00037 namespace Test
00038 {
00052     class CompilerOutput : public Output
00053     {
00054     public:
00061         class InvalidFormat : public std::logic_error
00062         {
00063             public:
00064                 InvalidFormat(const std::string& what)
00065                     : std::logic_error(what) {}
00066         };
00067         
00070         enum Format
00071         {
00075             Generic,
00076 
00081             BCC,
00082             
00087             GCC,
00088 
00093             MSVC
00094         };
00095         
00096         explicit CompilerOutput(Format              format = Generic,
00097                                 std::ostream&       stream = std::cout);
00098         
00099         explicit CompilerOutput(const std::string&  format,
00100                                 std::ostream&       stream = std::cout);
00101         
00102         virtual void assertment(const Source& s);
00103         
00104     private:
00105         std::string     _format;
00106         std::ostream&   _stream;
00107     };
00108 
00109 } // namespace Test
00110     
00111 #endif // #ifndef CPPTEST_COMPILEROUTPUT_H
00112 

Supported by:

SourceForge Logo