Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

Test Runner Functions


Detailed Description

Functions that are used to define, start, report on, and complete test runners.


Defines

#define XTESTS_START_RUNNER(name, verbosity)
 Starts a test runner.
#define XTESTS_START_RUNNER_WITH_STREAM(name, verbosity, stm)
 Starts a test runner.
#define XTESTS_START_RUNNER_WITH_REPORTER(name, verbosity, reporter, reporterParam)
 Starts a test runner with the given callback reporter.
#define XTESTS_START_RUNNER_WITH_REPORTER_AND_STREAM(name, verbosity, reporter, reporterParam, stm)
 Starts a test runner with the given callback reporter.
#define XTESTS_START_RUNNER_WITH_REPORTER_AND_STREAM_AND_FLAGS(name, verbosity, reporter, reporterParam, stm, flags)
 Starts a test runner with the given callback reporter.
#define XTESTS_START_RUNNER_WITH_FLAGS(name, verbosity, flags)
 Starts a test runner with the given callback reporter.
#define XTESTS_PRINT_RESULTS()
 Prints the test results of the currently executing test.
#define XTESTS_END_RUNNER()
 Ends a test runner.
#define XTESTS_ABEND(terminationMessage)
 Abnormal end of tests, and process termination.
#define XTESTS_END_RUNNER_UPDATE_EXITCODE(retCode)
 Ends a test runner, and modifies a caller-supplied exit code parameter.

Enumerations

enum  xtests_runner_flags_t {
  xtestsRunnerFlagsNoWindowsDebugString = 0x0001,
  xtestsReportOnlyNonEmptyCases = 0x0002
}
 Flags to be passed to xtests_startRunner. More...
enum  xtests_verbosity_t {
  xtestsVerbositySilent = 0,
  xtestsVerbositySummaryOnError = 1,
  xtestsVerbosityVerboseOnError = 2,
  xtestsVerbositySummaryOnSuccess = 3,
  xtestsVerbosityVerboseOnSuccess = 4
}
 The verbosity level to be applied when executing a test runner. More...


Define Documentation

#define XTESTS_ABEND ( terminationMessage   ) 

Value:

\
    XTESTS_NS_C_QUAL(xtests_abend)(terminationMessage)
Abnormal end of tests, and process termination.

 
#define XTESTS_END_RUNNER (  ) 

Value:

\
    XTESTS_NS_C_QUAL(xtests_endRunner)(NULL)
Ends a test runner.

#define XTESTS_END_RUNNER_UPDATE_EXITCODE ( retCode   ) 

Value:

\
    stlsoft_static_cast(void, XTESTS_NS_C_QUAL(xtests_endRunner)(retCode))
Ends a test runner, and modifies a caller-supplied exit code parameter.

Parameters:
retCode A pointer to a variable of type int that will receive an exit code.
Remarks:
The variable should have been initialised to EXIT_SUCCESS, and each invocation of XTESTS_END_RUNNER_UPDATE_EXITCODE() (for each separate test-runner in a given application) will only set it to EXIT_FAILURE in the case where that runner has failed one or more tests.
Examples:
c/example.c.runner/example.c.runner.c, and c/example.c.tests/example.c.tests.c.

 
#define XTESTS_PRINT_RESULTS (  ) 

Value:

\
    XTESTS_NS_C_QUAL(xtests_printRunnerResults)()
Prints the test results of the currently executing test.

Note:
This can only be invoked after a successful invocation of XTESTS_START_RUNNER() or XTESTS_START_RUNNER_WITH_REPORTER(), and before invocation of XTESTS_END_RUNNER() or XTESTS_END_RUNNER_UPDATE_EXITCODE().
Examples:
c/example.c.runner/example.c.runner.c, and c/example.c.tests/example.c.tests.c.

#define XTESTS_START_RUNNER ( name,
verbosity   ) 

Value:

\
    (0 == XTESTS_NS_C_QUAL(xtests_startRunner)((name), (verbosity), NULL, NULL, stdout, 0))
Starts a test runner.

A test runner is a logically-related group of test cases.

Parameters:
name The name of the test-runner
verbosity The verbosity (see xtests_verbosity_t) at which the runner will be executed
Examples:
c/example.c.runner/example.c.runner.c, and c/example.c.tests/example.c.tests.c.

#define XTESTS_START_RUNNER_WITH_FLAGS ( name,
verbosity,
flags   ) 

Value:

\
    (0 == XTESTS_NS_C_QUAL(xtests_startRunner)((name), (verbosity), NULL, NULL, stdout, (flags)))
Starts a test runner with the given callback reporter.

A test runner is a logically-related group of test cases.

Parameters:
name The name of the test-runner
verbosity The verbosity (see xtests_verbosity_t) at which the runner will be executed
flags The flags that moderate the runner behaviour

#define XTESTS_START_RUNNER_WITH_REPORTER ( name,
verbosity,
reporter,
reporterParam   ) 

Value:

\
    (0 == XTESTS_NS_C_QUAL(xtests_startRunner)((name), (verbosity), (reporter), (reporterParam), stdout, 0))
Starts a test runner with the given callback reporter.

A test runner is a logically-related group of test cases.

Parameters:
name The name of the test-runner
verbosity The verbosity (see xtests_verbosity_t) at which the runner will be executed
reporter The reporter instance
reporterParam A caller-supplied parameter that is passed with every callback

#define XTESTS_START_RUNNER_WITH_REPORTER_AND_STREAM ( name,
verbosity,
reporter,
reporterParam,
stm   ) 

Value:

\
    (0 == XTESTS_NS_C_QUAL(xtests_startRunner)((name), (verbosity), (reporter), (reporterParam), stm, 0))
Starts a test runner with the given callback reporter.

A test runner is a logically-related group of test cases.

Parameters:
name The name of the test-runner
verbosity The verbosity (see xtests_verbosity_t) at which the runner will be executed
reporter The reporter instance
reporterParam A caller-supplied parameter that is passed with every callback
stm The stream to which output will be written

#define XTESTS_START_RUNNER_WITH_REPORTER_AND_STREAM_AND_FLAGS ( name,
verbosity,
reporter,
reporterParam,
stm,
flags   ) 

Value:

\
    (0 == XTESTS_NS_C_QUAL(xtests_startRunner)((name), (verbosity), (reporter), (reporterParam), (stm), (flags)))
Starts a test runner with the given callback reporter.

A test runner is a logically-related group of test cases.

Parameters:
name The name of the test-runner
verbosity The verbosity (see xtests_verbosity_t) at which the runner will be executed
reporter The reporter instance
reporterParam A caller-supplied parameter that is passed with every callback
stm The stream to which output will be written
flags The flags that moderate the runner behaviour

#define XTESTS_START_RUNNER_WITH_STREAM ( name,
verbosity,
stm   ) 

Value:

\
    (0 == XTESTS_NS_C_QUAL(xtests_startRunner)((name), (verbosity), NULL, NULL, stm, 0))
Starts a test runner.

A test runner is a logically-related group of test cases.

Parameters:
name The name of the test-runner
verbosity The verbosity (see xtests_verbosity_t) at which the runner will be executed
stm The stream to which output will be written


Enumeration Type Documentation

enum xtests_runner_flags_t

Flags to be passed to xtests_startRunner.

See also:
XTESTS_START_RUNNER()

XTESTS_START_RUNNER_WITH_REPORTER()

enum xtests_verbosity_t

The verbosity level to be applied when executing a test runner.

See also:
XTESTS_START_RUNNER()

XTESTS_START_RUNNER_WITH_REPORTER()

Enumerator:
xtestsVerbositySilent  Don't say anything at any point
xtestsVerbositySummaryOnError  Show a summary, but only on error
xtestsVerbosityVerboseOnError  Give full information, but only on error
xtestsVerbositySummaryOnSuccess  Give full information on error, otherwise just summary
xtestsVerbosityVerboseOnSuccess  Give full information at all times


xTests Library documentation Matthew Wilson and Synesis Software Pty Ltd, 1999-2009 SourceForge.net Logo