Ticket #12604: test.cpp

File test.cpp, 1.4 KB (added by anonymous, 6 years ago)
Line 
1#define BOOST_TEST_NO_MAIN
2#define BOOST_TEST_ALTERNATIVE_INIT_API
3
4#include <boost/test/included/unit_test.hpp>
5
6
7void method() {
8 BOOST_TEST( true /* test assertion */ );
9}
10
11bool init() {
12 using boost::unit_test::test_suite;
13 test_suite* ts = BOOST_TEST_SUITE("TTTT");
14 ts->add(BOOST_TEST_CASE(&method));
15 ::boost::unit_test::framework::master_test_suite().add( ts );
16 return true;
17}
18
19int main(int argc, char* argv[]) {
20 using boost::unit_test::test_suite;
21 char* targv[] = {"T"};
22 int exit_code =
23 ::boost::unit_test::unit_test_main( &init,
24 1,
25 targv
26 );
27 return exit_code;
28}