]>
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 | ||
9 | [section:link_references Build scenarios and behaviors] | |
10 | ||
11 | [section:link_boost_test_main_macro `BOOST_TEST_MAIN`] | |
12 | ||
13 | When defined, this macro creates a stub for the test module initialization (the main entry part). This | |
14 | macro also expands properly into a `main` function in case the shared library variant of the __UTF__ is used. | |
15 | ||
16 | ||
17 | [caution This macro should | |
18 | ||
19 | # be defined before any inclusion directive to __UTF__ headers | |
20 | # be defined exactly for one compilation unit of your test module | |
21 | ||
22 | ] | |
23 | ||
24 | [tip The macro __BOOST_TEST_MODULE__ should be preferred] | |
25 | ||
26 | [endsect] | |
27 | ||
28 | [section:link_boost_test_module_macro `BOOST_TEST_MODULE`] | |
29 | Serves the same purpose as the macro __BOOST_TEST_MAIN__ but, in addition, defines the name of the master test suite. | |
30 | ||
31 | [caution As __BOOST_TEST_MAIN__, this macro should | |
32 | ||
33 | # be defined before any inclusion directive to __UTF__ headers | |
34 | # be defined exactly for one compilation unit of your test module | |
35 | ||
36 | ] | |
37 | ||
38 | An example may be found [link ref_BOOST_TEST_MODULE here]. | |
39 | ||
40 | [endsect] | |
41 | ||
42 | ||
43 | [section:link_boost_test_alternative_init_macro `BOOST_TEST_ALTERNATIVE_INIT_API`] | |
44 | ||
45 | [endsect] | |
46 | ||
47 | [section:link_boost_test_no_lib `BOOST_TEST_NO_LIB`] | |
48 | Define this flag to prevent auto-linking. | |
49 | [note The same flag is used for the __UTF__ and the __PEM__ components.] | |
50 | [endsect] | |
51 | ||
52 | [section:link_boost_test_dyn_link `BOOST_TEST_DYN_LINK`] | |
53 | Define this flag to link against the __UTF__ shared library. | |
54 | [note The same flag is used for the __UTF__ and the __PEM__ components.] | |
55 | [endsect] | |
56 | ||
57 | [section:link_boost_test_no_main `BOOST_TEST_NO_MAIN`] | |
58 | Prevents the auto generation of the test module initialization functions. This macro is particularly relevant for | |
59 | manually registered tests in conjunction with dynamic variant of the __UTF__. When defined, a `main` function | |
60 | registering all the tests should be implemented. | |
61 | ||
62 | An example of a module initialization would be | |
63 | `` | |
64 | #define __BOOST_TEST_NO_MAIN__ | |
65 | #include <boost/test/unit_test.hpp> | |
66 | ||
67 | // a function in another compilation unit registering tests under the master test suite. | |
68 | void register_some_tests_manually(test_suite* test); | |
69 | ||
70 | bool registering_all_tests() | |
71 | { | |
72 | test_suite* test_master_suite = &boost::unit_test::framework::master_test_suite(); | |
73 | register_some_tests_manually(test_master_suite); | |
74 | ||
75 | // register any other tests function or test suite to the master test suite | |
76 | // ... | |
77 | return true; | |
78 | } | |
79 | ||
80 | int main(int argc, char* argv[]) | |
81 | { | |
82 | return ::boost::unit_test::unit_test_main(®istering_all_tests, argc, argv); | |
83 | } | |
84 | `` | |
85 | [endsect] | |
86 | ||
87 | [section:config_disable_alt_stack `BOOST_TEST_DISABLE_ALT_STACK`] | |
88 | Disables the support of the alternative stack. | |
89 | ||
90 | Define this macro before the inclusion of any __UTF__ header to disable the support | |
91 | of the [@http://www.gnu.org/software/libc/manual/html_node/Signal-Stack.html alternative stack], | |
92 | in case your compiler does not support it and the __UTF__ cannot automatically guess the lack of support. | |
93 | ||
94 | See [link boost_test.utf_reference.rt_param_reference.use_alt_stack `use_alt_stack`] | |
95 | and [macroref BOOST_TEST_DISABLE_ALT_STACK `BOOST_TEST_DISABLE_ALT_STACK`] for more details. | |
96 | [endsect] | |
97 | ||
98 | [endsect] |