Skip to content

Commit

Permalink
update Catch2 header and targets
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch authored and christian-rauch committed Jun 17, 2024
1 parent 8f0f753 commit 70c219d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/pango_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ endif()

if(BUILD_TESTS)
add_executable(test_uris ${CMAKE_CURRENT_LIST_DIR}/tests/tests_uri.cpp)
target_link_libraries(test_uris PRIVATE Catch2::Catch2 ${COMPONENT})
target_link_libraries(test_uris PRIVATE Catch2::Catch2WithMain ${COMPONENT})
catch_discover_tests(test_uris)
endif()
4 changes: 4 additions & 0 deletions components/pango_core/tests/tests_uri.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#define CATCH_CONFIG_MAIN
#if __has_include(<catch2/catch.hpp>)
#include <catch2/catch.hpp>
#else
#include <catch2/catch_test_macros.hpp>
#endif

#include <string>
#include <limits>
Expand Down
2 changes: 1 addition & 1 deletion components/pango_vars/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/include"

if(BUILD_TESTS)
add_executable(test_vars ${CMAKE_CURRENT_LIST_DIR}/tests/test_all.cpp)
target_link_libraries(test_vars PRIVATE Catch2::Catch2 ${COMPONENT})
target_link_libraries(test_vars PRIVATE Catch2::Catch2WithMain ${COMPONENT})
catch_discover_tests(test_vars)
endif()
4 changes: 4 additions & 0 deletions components/pango_vars/tests/test_all.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#define CATCH_CONFIG_MAIN
#if __has_include(<catch2/catch.hpp>)
#include <catch2/catch.hpp>
#else
#include <catch2/catch_test_macros.hpp>
#endif

#include <pangolin/var/var.h>
#include <pangolin/var/varextra.h>
Expand Down
4 changes: 2 additions & 2 deletions components/pango_video/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ target_sources(${COMPONENT} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/include/pangoli

if(BUILD_TESTS)
add_executable(test_video_uris ${CMAKE_CURRENT_LIST_DIR}/tests/tests_video_uri.cpp)
target_link_libraries(test_video_uris PRIVATE Catch2::Catch2 ${COMPONENT})
target_link_libraries(test_video_uris PRIVATE Catch2::Catch2WithMain ${COMPONENT})
catch_discover_tests(test_video_uris)
add_executable(test_video_loading ${CMAKE_CURRENT_LIST_DIR}/tests/tests_video_loading.cpp)
target_link_libraries(test_video_loading PRIVATE Catch2::Catch2 ${COMPONENT})
target_link_libraries(test_video_loading PRIVATE Catch2::Catch2WithMain ${COMPONENT})
catch_discover_tests(test_video_loading)
endif()
4 changes: 4 additions & 0 deletions components/pango_video/tests/tests_video_loading.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#define CATCH_CONFIG_MAIN
#if __has_include(<catch2/catch.hpp>)
#include <catch2/catch.hpp>
#else
#include <catch2/catch_test_macros.hpp>
#endif

#include <pangolin/video/video.h>
#include <pangolin/factory/factory_registry.h>
Expand Down
4 changes: 4 additions & 0 deletions components/pango_video/tests/tests_video_uri.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#define CATCH_CONFIG_MAIN
#if __has_include(<catch2/catch.hpp>)
#include <catch2/catch.hpp>
#else
#include <catch2/catch_test_macros.hpp>
#endif

#include <string>
#include <limits>
Expand Down

0 comments on commit 70c219d

Please sign in to comment.