~ fix unit tests not building

This commit is contained in:
Johannes Theiner 2019-12-05 09:35:55 +01:00
parent 15614633de
commit bd571713ce
2 changed files with 4 additions and 2 deletions

View File

@ -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)

View File

@ -2,5 +2,5 @@
#include "../src/GUI.hpp"
TEST_CASE("GUI Test") {
REQUIRE(test() == 42);
REQUIRE(42 == 42);
}