# Unit tests for LogView. # LogView itself is an executable, so it cannot be linked into a test binary. # The non-GUI sources under test are compiled directly into the test executable # instead. GoogleTest is resolved once in the top-level CMakeLists.txt. set(logview_under_test ${CMAKE_CURRENT_SOURCE_DIR}/../logger.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../LogViewField.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../LogViewXdrElement.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../LogViewXdrStandardType.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../LogViewTetraTelegramsParser.cpp ) add_executable(LogViewTests ${CMAKE_CURRENT_SOURCE_DIR}/../../unittest_main.cpp LogViewFieldTest.cpp LogViewTetraTelegramsParserTest.cpp ${logview_under_test} ) target_include_directories(LogViewTests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/.. ) target_link_libraries(LogViewTests PRIVATE NGLLogger Qt6::Core GTest::gtest ) include(GoogleTest) gtest_discover_tests(LogViewTests)