This post is a continuation to Boost Unit Test Framework with Multiple Sources
When the following piece of code (borrowed from the aforementioned post)
// test_main.cpp
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE Main
#include <boost/test/unit_test.hpp>
// test1.cpp
#define BOOST_TEST_DYN_LINK
#ifdef STAND_ALONE
# define BOOST_TEST_MODULE Main
#endif
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(test1_suite)
BOOST_AUTO_TEST_CASE(Test1)
{
BOOST_CHECK(2<1);
}
BOOST_AUTO_TEST_SUITE_END()
// test2.cpp
#define BOOST_TEST_DYN_LINK
#ifdef STAND_ALONE
# define BOOST_TEST_MODULE Main
#endif
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(test2_suite)
BOOST_AUTO_TEST_CASE(Test1)
{
BOOST_CHECK(1<2);
}
BOOST_AUTO_TEST_SUITE_END()
is compiled, (as suggested) with
$ g++ test_main.cpp test1.cpp test2.cpp -lboost_unit_test_framework -o tests
How do I achieve this using Boost.Build (to compile and test from multiple sources for Boost Unit Test Framework using Boost.Build)?