Skip to content

Commit

Permalink
Migrate from catch2 2.* to 3.*
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro committed Nov 5, 2024
1 parent b9ce739 commit df3fc4f
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
osqp_TAG: v0.6.3
vcpkg_robotology_TAG: v0.0.3
Catch2_TAG: v2.13.9
Catch2_TAG: v3.0.1
# Overwrite the VCPKG_INSTALLATION_ROOT env variable defined by GitHub Actions to point to our vcpkg
VCPKG_INSTALLATION_ROOT: C:\robotology\vcpkg

Expand Down
9 changes: 1 addition & 8 deletions cmake/AddOsqpEigenUnitTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ if (OSQPEIGEN_RUN_Valgrind_tests)
separate_arguments(MEMCHECK_COMMAND_COMPLETE)
endif()

if (OSQPEIGEN_COMPILE_tests)
configure_file(cmake/Catch2Main.cpp.in ${CMAKE_BINARY_DIR}/Testing/Catch2Main.cpp)
add_library(CatchTestMain ${CMAKE_BINARY_DIR}/Testing/Catch2Main.cpp)
target_link_libraries(CatchTestMain PUBLIC Catch2::Catch2)
endif()


function(add_osqpeigen_test)

if(OSQPEIGEN_COMPILE_tests)
Expand All @@ -57,7 +50,7 @@ function(add_osqpeigen_test)
add_executable(${targetname}
"${unit_test_files}")

target_link_libraries(${targetname} PRIVATE CatchTestMain ${${prefix}_LINKS})
target_link_libraries(${targetname} PRIVATE Catch2::Catch2WithMain ${${prefix}_LINKS})
target_compile_definitions(${targetname} PRIVATE CATCH_CONFIG_FAST_COMPILE CATCH_CONFIG_DISABLE_MATCHERS)
target_compile_features(${targetname} PUBLIC cxx_std_14)

Expand Down
9 changes: 0 additions & 9 deletions cmake/Catch2Main.cpp.in

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/OsqpEigenDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()

#---------------------------------------------
## Optional Dependencies
find_package(Catch2 QUIET)
find_package(Catch2 3.0.1 QUIET)
checkandset_optional_dependency(Catch2)

find_package(VALGRIND QUIET)
Expand Down
2 changes: 1 addition & 1 deletion tests/MPCTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Catch2
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

// OsqpEigen
#include <OsqpEigen/OsqpEigen.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/MPCUpdateMatricesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Catch2
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

// OsqpEigen
#include <OsqpEigen/OsqpEigen.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/QPTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Catch2
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <OsqpEigen/OsqpEigen.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/SparseMatrixTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Catch2
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <OsqpEigen/OsqpEigen.h>
#include <osqp.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/UpdateMatricesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Catch2
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

// OsqpEigen
#include <OsqpEigen/OsqpEigen.h>
Expand Down

0 comments on commit df3fc4f

Please sign in to comment.