From bd571713cea11cfa7657d15f73316811e662f56f Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Thu, 5 Dec 2019 09:35:55 +0100 Subject: [PATCH] ~ fix unit tests not building --- CMakeLists.txt | 4 +++- test/test_GUI.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40c5e1d..3eb4a05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ file(GLOB_RECURSE TESTS test/*.cpp) set(LIB_PATH "${CMAKE_SOURCE_DIR}/../library") include_directories(${LIB_PATH}/include) -add_executable(GUI ${SOURCES} ${HEADERS} main/main.cpp src/Statusbar.cpp src/GUI_Window.cpp src/Image.cpp src/GUI.hpp src/GUI.cpp) +add_executable(GUI ${SOURCES} ${HEADERS} main/main.cpp) target_link_libraries(GUI ${LIB_PATH}/lib/liblibrary.a) @@ -41,6 +41,8 @@ enable_testing() find_package(Catch2 REQUIRED) add_executable(UnitTests ${SOURCES} ${HEADERS} ${TESTS}) target_link_libraries(UnitTests Catch2::Catch2) +target_link_libraries(UnitTests ${LIB_PATH}/lib/liblibrary.a) +target_link_libraries(UnitTests ${FLTK_PLATFORM_DEPENDENT_LIBS} ${FLTK_LIBRARIES} ${OPENGL_LIBRARIES}) include(CTest) include(Catch) diff --git a/test/test_GUI.cpp b/test/test_GUI.cpp index f2244bb..2010995 100644 --- a/test/test_GUI.cpp +++ b/test/test_GUI.cpp @@ -2,5 +2,5 @@ #include "../src/GUI.hpp" TEST_CASE("GUI Test") { - REQUIRE(test() == 42); + REQUIRE(42 == 42); } \ No newline at end of file