diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index ae9bb4e..aee5373 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -13,10 +13,10 @@ lib ole32 ; local LIBBACKTRACE_PATH = [ modules.peek : LIBBACKTRACE_PATH ] ; lib backtrace - : + : : $(LIBBACKTRACE_PATH)/lib static : - : $(LIBBACKTRACE_PATH)/include + : $(LIBBACKTRACE_PATH)/include ; @@ -89,11 +89,27 @@ test-suite stacktrace_tests [ run test.cpp : : : on .//test_impl_lib_basic $(LINKSHARED_BASIC) : basic_lib ] # Thread safety with debug symbols - [ run thread_safety_checking.cpp : : : on /boost/thread//boost_thread .//test_impl_lib_backtrace $(LINKSHARED_BT) : backtrace_lib_threaded ] - [ run thread_safety_checking.cpp : : : on /boost/thread//boost_thread .//test_impl_lib_windbg $(LINKSHARED_WIND) : windbg_lib_threaded ] - [ run thread_safety_checking.cpp : : : on /boost/thread//boost_thread .//test_impl_lib_windbg_cached $(LINKSHARED_WIND_CACHED) : windbg_cached_lib_threaded ] - [ run thread_safety_checking.cpp : : : on /boost/thread//boost_thread .//test_impl_lib_basic $(LINKSHARED_BASIC) : basic_lib_threaded ] + [ run thread_safety_checking.cpp + : : : on /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_backtrace $(LINKSHARED_BT) + : backtrace_lib_threaded ] + [ run thread_safety_checking.cpp + : : : on /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_windbg $(LINKSHARED_WIND) + : windbg_lib_threaded ] + [ run thread_safety_checking.cpp + : : : on /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_windbg_cached $(LINKSHARED_WIND_CACHED) + : windbg_cached_lib_threaded ] + [ run thread_safety_checking.cpp + : : : on /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_basic $(LINKSHARED_BASIC) + : basic_lib_threaded ] + [ run thread_safety_checking.cpp + : : : on /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_windbg + $(LINKSHARED_WIND) BOOST_STACKTRACE_TEST_COM_PREINIT_MT + : windbg_lib_threaded_com_mt ] + [ run thread_safety_checking.cpp + : : : on /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_windbg_cached + $(LINKSHARED_WIND_CACHED) BOOST_STACKTRACE_TEST_COM_PREINIT_ST + : windbg_cached_lib_threaded_com_st ] ##### Tests with disabled debug symbols ##### @@ -114,13 +130,30 @@ test-suite stacktrace_tests [ run test.cpp : : : off .//test_impl_lib_basic_no_dbg $(LINKSHARED_BASIC) : basic_lib_no_dbg ] # Thread safety without debug symbols - [ run thread_safety_checking.cpp : : : off /boost/thread//boost_thread .//test_impl_lib_backtrace_no_dbg $(LINKSHARED_BT) : backtrace_lib_no_dbg_threaded ] - [ run thread_safety_checking.cpp : : : off /boost/thread//boost_thread .//test_impl_lib_windbg_no_dbg $(LINKSHARED_WIND) : windbg_lib_no_dbg_threaded ] - [ run thread_safety_checking.cpp : : : off /boost/thread//boost_thread .//test_impl_lib_windbg_cached_no_dbg $(LINKSHARED_WIND_CACHED) : windbg_cached_lib_no_dbg_threaded ] - [ run thread_safety_checking.cpp : : : off /boost/thread//boost_thread .//test_impl_lib_basic_no_dbg $(LINKSHARED_BASIC) : basic_lib_no_dbg_threaded ] + [ run thread_safety_checking.cpp + : : : off /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_backtrace_no_dbg $(LINKSHARED_BT) + : backtrace_lib_no_dbg_threaded ] + [ run thread_safety_checking.cpp + : : : off /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_windbg_no_dbg $(LINKSHARED_WIND) + : windbg_lib_no_dbg_threaded ] + [ run thread_safety_checking.cpp + : : : off /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_windbg_cached_no_dbg $(LINKSHARED_WIND_CACHED) + : windbg_cached_lib_no_dbg_threaded ] + [ run thread_safety_checking.cpp + : : : off /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_basic_no_dbg $(LINKSHARED_BASIC) + : basic_lib_no_dbg_threaded ] + + [ run thread_safety_checking.cpp + : : : off /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_windbg + $(LINKSHARED_WIND) BOOST_STACKTRACE_TEST_COM_PREINIT_MT + : windbg_lib_threaded_com_mt ] + [ run thread_safety_checking.cpp + : : : off /boost/thread//boost_thread /boost/timer//boost_timer .//test_impl_lib_windbg_cached + $(LINKSHARED_WIND_CACHED) BOOST_STACKTRACE_TEST_COM_PREINIT_ST + : windbg_cached_lib_threaded_com_st ] ; -# Assuring that examples compile and run. Adding sources from `examples` directory to the `type_index` test suite. +# Assuring that examples compile and run. Adding sources from `examples` directory to the `type_index` test suite. for local p in [ glob ../example/*.cpp ] { local target_name = $(p[1]:B) ; diff --git a/test/thread_safety_checking.cpp b/test/thread_safety_checking.cpp index 125faab..df191f8 100644 --- a/test/thread_safety_checking.cpp +++ b/test/thread_safety_checking.cpp @@ -13,6 +13,8 @@ #include #include +#include + #ifdef BOOST_STACKTRACE_DYN_LINK # define BOOST_ST_API BOOST_SYMBOL_IMPORT #else @@ -61,7 +63,20 @@ void main_test_loop() { } } +#if defined(BOOST_STACKTRACE_TEST_COM_PREINIT_MT) || defined(BOOST_STACKTRACE_TEST_COM_PREINIT_ST) +# include +# include "dbgeng.h" +#endif + int main() { +#if defined(BOOST_STACKTRACE_TEST_COM_PREINIT_MT) + ::CoInitializeEx(0, COINIT_MULTITHREADED); +#elif defined(BOOST_STACKTRACE_TEST_COM_PREINIT_ST) + ::CoInitializeEx(0, COINIT_APARTMENTTHREADED); +#endif + + boost::timer::auto_cpu_timer t; + boost::thread t1(main_test_loop); boost::thread t2(main_test_loop); boost::thread t3(main_test_loop); @@ -71,5 +86,9 @@ int main() { t2.join(); t3.join(); +#if defined(BOOST_STACKTRACE_TEST_COM_PREINIT_MT) || defined(BOOST_STACKTRACE_TEST_COM_PREINIT_ST) + ::CoUninitialize(); +#endif + return boost::report_errors(); }