Vault  4.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
VUnitOutputWriter Class Reference

VUnitOutputWriter provides an abstract API for providing test results in various formats. More...

#include <vunit.h>

Inheritance diagram for VUnitOutputWriter:
VUnitJUnitXMLOutput VUnitSimpleTextOutput VUnitTeamCityBuildStatusOutput VUnitTeamCityOutput

List of all members.

Public Member Functions

 VUnitOutputWriter (VLogAppender &outputAppender)
virtual void testSuitesBegin ()=0
virtual void testSuiteBegin (const VString &testSuiteName)=0
virtual void testSuiteStatusMessage (const VString &message)=0
virtual void testCaseBegin (const VString &testCaseName)=0
virtual void testCaseEnd (const VTestInfo &testInfo)=0
virtual void testSuiteEnd ()=0
virtual void testSuitesEnd ()=0

Static Public Member Functions

static void createOutputWriters (const VStringVector &args, VUnitOutputWriterList &writers, VUnitLogAppenderList &appenders)
 This utility will set up writers and loggers according to a set of command line arguments:

Protected Member Functions

void _testSuitesBegin ()
void _testSuiteBegin (const VString &testSuiteName)
void _testCaseBegin (const VString &testCaseName)
void _testCaseEnd (const VTestInfo &testInfo)
void _testSuiteEnd ()

Protected Attributes

VLogAppendermLogAppender
VInstant mTestSuitesStartTime
int mTotalNumSuccesses
int mTotalNumErrors
VString mCurrentTestSuiteName
TestInfoVector mCurrentTestSuiteResults
int mCurrentTestSuiteNumSuccesses
int mCurrentTestSuiteNumErrors
VInstant mCurrentTestSuiteStartTime
VInstant mCurrentTestSuiteEndTime
VString mCurrentTestCaseName
VInstant mCurrentTestCaseStartTime
VInstant mCurrentTestCaseEndTime
VStringVector mFailedTestSuiteNames

Detailed Description

VUnitOutputWriter provides an abstract API for providing test results in various formats.

Provided concrete implementations are at the bottom of this file. Because most implementations will need to keep track of the current suite name, current test name, and the current suite's accumulated test case info, we store that here in the base class. Output should be written by calling mLogger.rawLog(); using a VLogger and rawLog() allows good flexibility because the logger may write to standard out, or to a file, or whatever it wants to.

Definition at line 63 of file vunit.h.


Member Function Documentation

void VUnitOutputWriter::createOutputWriters ( const VStringVector args,
VUnitOutputWriterList &  writers,
VUnitLogAppenderList &  appenders 
) [static]

This utility will set up writers and loggers according to a set of command line arguments:

-vunit-out <type> <file> The <type> argument determines the type of VUnitOutputWriter instantiated. text | junit | tc | tcstatus The <file> argument is the file path it creates and writes to. "stdout" writes to std::cout instead of a file. Multiple sets of "-vunit-out <type> <file>" will cause multiple writers to be created and written to during unit tests.

Parameters:
argsthe command line arguments
writersa vector of VUnitOutputWriter* to which this function adds the caller is responsible for deleting these objects when done with unit tests
appendersa vector of VLogAppender* to which this function appends the caller is responsible for deleting these objects when done with unit tests

Definition at line 217 of file vunit.cpp.


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

Copyright ©1997-2014 Trygve Isaacson. All rights reserved. This documentation was generated with Doxygen.