Boost test

From Yefu's notes
Jump to: navigation, search

Main:

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE "Assertions"
#include <boost/test/unit_test.hpp>

No main:

#include <boost/test/unit_test.hpp>

BOOST_AUTO_TEST_SUITE(MyColorTests)

BOOST_AUTO_TEST_CASE( free_test_function )
{
  BOOST_TEST( true /* test assertion */ );
}

BOOST_AUTO_TEST_SUITE_END()

CMakeLists.txt

enable_testing()
add_executable(test_thumnail ${Thumnail_TEST_SOURCES})
target_link_libraries(test_thumnail LINK_PUBLIC ${AWSSDK_LINK_LIBRARIES} ${ImageMagick_LIBRARIES} ${Boost_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY} )
add_test(NAME tt COMMAND test_thumnail)