![]() |
Vault
4.1
|
VUnitOutputWriter provides an abstract API for providing test results in various formats. More...
#include <vunit.h>
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 | |
| VLogAppender & | mLogAppender |
| 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 |
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.
| 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.
| args | the command line arguments |
| writers | a vector of VUnitOutputWriter* to which this function adds the caller is responsible for deleting these objects when done with unit tests |
| appenders | a vector of VLogAppender* to which this function appends the caller is responsible for deleting these objects when done with unit tests |