Static Public Member Functions | List of all members
TestRunner Class Reference

The main test runner class. More...

#include <TestRunner.hpp>

Inherits TestRunnerBase.

Static Public Member Functions

static int run (int argc, char *argv[], bool ignoreFirst=true, std::shared_ptr< Impl::TestReportGenerator > reportGenerator=std::shared_ptr< Impl::TestReportGenerator >(new Reporters::SurefireTestReportGenerator))
 Run the test runner after parsing the supplied input arguments. More...
 
template<typename ... WriterItemT>
static int run (int argc, char *argv[], bool ignoreFirst, std::shared_ptr< Impl::TestReportGenerator > reportGenerator, const WriterItemT &... writerItems)
 Run the test runner after parsing the supplied input arguments and using the supplied writers. More...
 
static int run (ExecutionModel executionModel, const Resource::File &reportOutputFolder=Resource::File(), std::shared_ptr< Impl::TestReportGenerator > reportGenerator=std::shared_ptr< Impl::TestReportGenerator >(new Reporters::SurefireTestReportGenerator))
 Run all the tests in the test runner. More...
 
template<typename ... WriterItemT>
static int run (ExecutionModel executionModel, const Resource::File &reportOutputFolder, std::shared_ptr< Impl::TestReportGenerator > reportGenerator, const WriterItemT &... writerItems)
 Run the test runner after parsing the supplied input arguments and using the supplied writers. More...
 

Detailed Description

The main test runner class.

The runner runs the registered test group class' test cases and produces a report at the end of execution.

If not explicitly initialised, the default execution model used is WorkerProcesses and the default concurrency level is one thread/process per available CPU logical core.

Member Function Documentation

◆ run() [1/4]

static int run ( int  argc,
char *  argv[],
bool  ignoreFirst = true,
std::shared_ptr< Impl::TestReportGenerator >  reportGenerator = std::shared_ptr<Impl::TestReportGenerator>(new Reporters::SurefireTestReportGenerator) 
)
inlinestatic

Run the test runner after parsing the supplied input arguments.

If not specified, the default concurrency level will be equal to the number of logical cores if the execution model is WorkerThreads or WorkerProcesses, and the logging will output to stdout.

Parameters
argcthe number of arguments in argv
argvthe command line arguments
ignoreFirstignore the first command line argument (default == true)
reportGeneratorthe report generator to use if reporting is enabled (default == Surefire report generator)
Returns
0 if all tests passed, 1 otherwise

◆ run() [2/4]

static int run ( int  argc,
char *  argv[],
bool  ignoreFirst,
std::shared_ptr< Impl::TestReportGenerator >  reportGenerator,
const WriterItemT &...  writerItems 
)
inlinestatic

Run the test runner after parsing the supplied input arguments and using the supplied writers.

If not specified, the concurrency level will be equal to the number of logical cores if the execution model is WorkerThreads or WorkerProcesses.

The supplied report generator must have its output folder set.

Template Parameters
WriterItemTthe writer item types
Parameters
argcthe number of arguments in argv
argvthe command line arguments
ignoreFirstignore the first command line argument
reportGeneratorthe report generator to use
writerItemsthe writer items to write the output to
Returns
0 if all tests passed, 1 otherwise

◆ run() [3/4]

static int run ( ExecutionModel  executionModel,
const Resource::File reportOutputFolder = Resource::File(),
std::shared_ptr< Impl::TestReportGenerator >  reportGenerator = std::shared_ptr<Impl::TestReportGenerator>(new Reporters::SurefireTestReportGenerator) 
)
inlinestatic

Run all the tests in the test runner.

The concurrency level will be equal to the number of logical cores if the execution model is WorkerThreads or WorkerProcesses, and the logging will output to stdout.

Test output reports will be written if a report output folder is specified.

Parameters
executionModelthe execution model to run the tests
reportOutputFolderthe output folder in which the reports will be written (default == empty == no reports written)
reportGeneratorthe report generator to use if reporting is enabled (default == Surefire report generator)
Returns
0 if all tests passed, 1 otherwise

◆ run() [4/4]

static int run ( ExecutionModel  executionModel,
const Resource::File reportOutputFolder,
std::shared_ptr< Impl::TestReportGenerator >  reportGenerator,
const WriterItemT &...  writerItems 
)
inlinestatic

Run the test runner after parsing the supplied input arguments and using the supplied writers.

If not specified, the concurrency level will be equal to the number of logical cores if the execution model is WorkerThreads or WorkerProcesses.

Test output reports will only be written if a report output folder is specified.

Template Parameters
WriterItemTthe writer item types
Parameters
executionModelthe execution model to run the tests
reportOutputFolderthe output folder in which the reports will be written (empty == no reports written)
reportGeneratorthe report generator to use if reporting is enabled
writerItemsthe writer items to write the output to
Returns
0 if all tests passed, 1 otherwise

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