gentoo/dev-libs/boost/files/unit-test-main.cpp
Holger Hoffstätte 934c344dc3
dev-libs/boost: wire up USE=test/test-full
This adds the initial bits to run boost's test suites,
all of which are different. We filter out failing tests
and make everything work with the same options as the regular
build, which required some creative hackery to run legacy
tests that were missing a main().

Closes: https://bugs.gentoo.org/953468
Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Part-of: https://github.com/gentoo/gentoo/pull/41616
Closes: https://github.com/gentoo/gentoo/pull/41616
Signed-off-by: Sam James <sam@gentoo.org>
2025-04-27 13:17:04 +01:00

20 lines
607 B
C++

/*
A synthetic main() to bootstrap an old-style test suite.
This seems to be necessary for older tests suites when enforcing
building against boost as shared library.
Further details can be found at:
https://www.boost.org/doc/libs/1_88_0/libs/test/doc/html/boost_test/adv_scenarios/obsolete_init_func.html
*/
bool init_master_suite(void)
{
test_suite* master = &::boost::unit_test::framework::master_test_suite();
master->add(init_unit_test_suite(0, nullptr));
return true;
}
int main(int argc, char* argv[])
{
return ::boost::unit_test::unit_test_main(init_master_suite, argc, argv);
}