[/
 / Copyright (c) 2003 Boost.Test contributors 
 /
 / Distributed under the Boost Software License, Version 1.0. (See accompanying
 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 /]

[section:single_header_customizations Single-header variant customizations] 

[section:entry_point Customizing the module's entry point]

In this usage variant, in your single translation unit, you need to define macros __BOOST_TEST_NO_MAIN__ and
__BOOST_TEST_ALTERNATIVE_INIT_API__ (their values are irrelevant) prior to including any of the framework's headers.
Next, you have to define your custom entry point, and invoke the default [link
boost_test.adv_scenarios.test_module_runner_overview test runner] `unit_test_main` manually with the default [link
boost_test.adv_scenarios.test_module_init_overview initialization function] `init_unit_test` as argument.


[bt_example custom_main..using custom entry point..run-fail]

In the above example, a custom entry point was selected because the test module, in addition to command line arguments
needs to obtain also the information about environment variables.

[note The above example also illustrates that it makes sense to define both __BOOST_TEST_MODULE__ and
__BOOST_TEST_NO_MAIN__. This way, no `main` is generated by the framework, but the specified name is assigned to the
[link boost_test.tests_organization.test_suite.master_test_suite Master Test Suite].]

[note The reason for defining __BOOST_TEST_ALTERNATIVE_INIT_API__ is described [link
boost_test.adv_scenarios.obsolete_init_func here].]


[endsect] [/section:entry_point]

[section:init_func Customizing the module's initialization function]

In this usage variant, you do not define macro __BOOST_TEST_MODULE__ and instead provide the definition of function
`init_unit_test`. This is going to be the custom initialization function. The default [link
boost_test.adv_scenarios.test_module_runner_overview test runner] will use it to initialize the test module.


[bt_example custom_init..using custom initialization function..run-fail]

[note Because we overwrote the default initialization function, it does no longer assign any name to the [link
boost_test.tests_organization.test_suite.master_test_suite master test suite]. Therefore the default name ("Master Test
Suite") is used.]

[note The reason for defining __BOOST_TEST_ALTERNATIVE_INIT_API__ is described [link
boost_test.adv_scenarios.obsolete_init_func here].]



[endsect] [/section:init_func]

[endsect] [/section:single_header_customizations]
