CppTest  Version 2.0.0
Classes | Public Types | Public Member Functions | List of all members
Test::CompilerOutput Class Reference

#include <cpptest-compileroutput.h>

Inheritance diagram for Test::CompilerOutput:
Test::Output

Classes

class  InvalidFormat
 

Public Types

enum  Format { Generic, BCC, GCC, MSVC }
 

Public Member Functions

 CompilerOutput (Format format=Generic, std::ostream &stream=std::cout)
 
 CompilerOutput (const std::string &format, std::ostream &stream=std::cout)
 
virtual void assertment (const Source &s)
 
- Public Member Functions inherited from Test::Output
virtual ~Output ()
 
virtual void initialize (int tests)
 
virtual void finished (int tests, const Time &time)
 
virtual void suite_start (int tests, const std::string &name)
 
virtual void suite_end (int tests, const std::string &name, const Time &time)
 
virtual void test_start (const std::string &name)
 
virtual void test_end (const std::string &name, bool ok, const Time &time)
 

Additional Inherited Members

- Protected Member Functions inherited from Test::Output
 Output ()
 

Detailed Description

Compiler-like output handler.

Test suite output handler that only outputs failures in compiler warning/error format. This way, you can use your IDE to browse between failures.

The output format is configurable to be able to emulate different compiler outputs. The following modifiers exist:

Member Enumeration Documentation

◆ Format

Pre-defined compiler output formats.

Enumerator
Generic 

Generic compiler format, which equals: %file:%line: %text

BCC 

Borland C++ Compiler (BCC) format, which equals: Error cpptest %file %line: %text.

GCC 

GNU Compiler Collection (GCC) format, which equals: %file:%line: %text

MSVC 

Microsoft Visual C++ (MSVC) format, which equals: %file(%line) : %text

Constructor & Destructor Documentation

◆ CompilerOutput() [1/2]

Test::CompilerOutput::CompilerOutput ( Format  format = Generic,
std::ostream &  stream = std::cout 
)
explicit

Constructs a compiler output handler.

Parameters
formatPre-defined compiler output format.
streamStream to output to.

◆ CompilerOutput() [2/2]

Test::CompilerOutput::CompilerOutput ( const std::string &  format,
std::ostream &  stream = std::cout 
)
explicit

Constructs a compiler output handler.

Parameters
formatOutput format to use.
streamStream to output to.
Exceptions
InvalidFormatInvalid format specified.

Member Function Documentation

◆ assertment()

void Test::CompilerOutput::assertment ( const Source s)
virtual

Called when an assertment is issued.

Parameters
sAssert point information.

Reimplemented from Test::Output.

References Test::Source::file(), Test::Source::line(), and Test::Source::message().


The documentation for this class was generated from the following files: