]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | / Copyright (c) 2003 Boost.Test contributors | |
3 | / | |
4 | / Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | /] | |
7 | ||
8 | [section:test_module_runner_overview Test module runner] | |
9 | ||
10 | A ['test module runner] is an ['orchestrator] or a ['driver] that, given the test tree, ensures the test tree is initialized, tests are executed and necessary reports generated. It performs the following operations: | |
11 | ||
12 | * initialize the test module using the supplied [link boost_test.adv_scenarios.test_module_init_overview ['initialization function]]; | |
13 | * select output media for the test log and the test results report; | |
14 | * execute test cases as specified by run-time parameters; | |
15 | * produce the test results report; | |
16 | * generate the appropriate return code. | |
17 | ||
18 | The __UTF__ comes with the default test runner. There is no need to call it explicitly. The default generated test module's [link boost_test.adv_scenarios.entry_point_overview entry point] invokes the default test runner. The default test runner is declared with the following signature: | |
19 | ||
20 | ``` | |
21 | namespace boost { namespace unit_test { | |
22 | ||
23 | typedef bool (*init_unit_test_func)(); | |
24 | ||
25 | int unit_test_main( init_unit_test_func init_func, int argc, char* argv[] ); | |
26 | ||
27 | } } | |
28 | ``` | |
29 | ||
30 | The test runner may return one of the following values: | |
31 | ||
32 | [table | |
33 | [[Value][Meaning]] | |
34 | [[`boost::exit_success`][ | |
35 | * No errors occurred during testing, or | |
36 | * the success result was forced with command-line argument `--[link boost_test.utf_reference.rt_param_reference.result_code `result_code`]=no`.]] | |
37 | [[`boost::exit_test_failure`][ | |
38 | * Non-fatal errors detected and no uncaught exceptions were thrown during testing, or | |
39 | * the initialization of the __UTF__ failed. ]] | |
40 | [[`boost::exit_exception_failure`][ | |
41 | * Fatal errors were detected, or | |
42 | * uncaught exceptions thrown during testing. ]] | |
43 | ] | |
44 | ||
45 | An advanced test runner may provide additional features, including interactive GUI interfaces, test coverage and profiling support. | |
46 | ||
47 | [endsect] [/section:test_module_runner_overview] |