Skip to content

Commit 29d9bea

Browse files
committed
prevent multiple main()s in case of dynamic linking of boost testing
1 parent f2c7a72 commit 29d9bea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libs/network/test/http/server_async_run_stop_concurrency.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#define BOOST_TEST_MODULE HTTP Asynchronous Server Tests
2+
#ifdef BOOST_TEST_DYN_LINK
3+
#define BOOST_TEST_NO_MAIN
4+
#endif /* BOOST_TEST_DYN_LINK */
25

36
#include <boost/network/include/http/server.hpp>
47
#include <boost/test/unit_test.hpp>
@@ -135,3 +138,6 @@ int main(int argc, char * argv[]) {
135138

136139
return 0;
137140
}
141+
#ifdef BOOST_TEST_DYN_LINK
142+
#undef BOOST_TEST_NO_MAIN
143+
#endif /* BOOST_TEST_DYN_LINK */

0 commit comments

Comments
 (0)