From fee508fb964fb55dc216bad9b5923710515f7a93 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Mon, 9 Jul 2018 16:40:22 +0200 Subject: [PATCH] added initial test case (does not compile!) --- CMakeLists.txt | 3 ++- test/CMakeLists.txt | 8 ++++++++ test/test_seller.cpp | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 test/CMakeLists.txt create mode 100644 test/test_seller.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 89326ec..0a43511 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,4 +17,5 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -add_subdirectory(src) \ No newline at end of file +add_subdirectory(src) +add_subdirectory(test) \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..c52571c --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,8 @@ +enable_testing() + +find_package(Boost COMPONENTS unit_test_framework REQUIRED) + +set(TEST_SOURCES test_seller.cpp) + +add_executable(testsuite ${TEST_SOURCES}) +target_link_libraries(testsuite Boost::unit_test_framework) \ No newline at end of file diff --git a/test/test_seller.cpp b/test/test_seller.cpp new file mode 100644 index 0000000..34c0b6c --- /dev/null +++ b/test/test_seller.cpp @@ -0,0 +1,10 @@ +#include "../src/core/seller.h" + +#define BOOST_TEST_MODULE seller + +#include + +BOOST_AUTO_TEST_CASE( initial_test ) { + Seller seller{}; + BOOST_TEST(seller.getUuid().is_nil() == true); +}