diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 153b522..71adeed 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -4,14 +4,14 @@ add_custom_target(tests) add_compile_definitions(UNITTEST) # include catch_discover_tests function from Catch2 -include(${Catch2_SOURCE_DIR}/contrib/Catch.cmake) +include(${Catch2_SOURCE_DIR}/extras/Catch.cmake) add_library(catch_main ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cpp) -target_link_libraries(catch_main Catch2::Catch2) +target_link_libraries(catch_main Catch2::Catch2WithMain) # registers given target as a catch test function(add_catch_test target) - target_link_libraries(${target} catch_main Catch2::Catch2) + target_link_libraries(${target} catch_main Catch2::Catch2WithMain) catch_discover_tests(${target}) add_dependencies(tests ${target}) endfunction() diff --git a/tests/unit/application/test_application.cpp b/tests/unit/application/test_application.cpp index ffb8b7c..21b7e88 100644 --- a/tests/unit/application/test_application.cpp +++ b/tests/unit/application/test_application.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "application.h" #include #include "../modules/stubs/stub_serial.h" diff --git a/tests/unit/application/test_registers.cpp b/tests/unit/application/test_registers.cpp index 5958966..735571c 100644 --- a/tests/unit/application/test_registers.cpp +++ b/tests/unit/application/test_registers.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "registers.h" #include "modules/globals.h" #include "../modules/stubs/stub_eeprom.h" diff --git a/tests/unit/hal/circular_buffer/test_circular_buffer.cpp b/tests/unit/hal/circular_buffer/test_circular_buffer.cpp index f35d25e..6b23b86 100644 --- a/tests/unit/hal/circular_buffer/test_circular_buffer.cpp +++ b/tests/unit/hal/circular_buffer/test_circular_buffer.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "circular_buffer.h" using Catch::Matchers::Equals; @@ -85,7 +85,7 @@ TEST_CASE("circular_buffer::wrap_around", "[circular_buffer]") { // loop to test the internal cursor wrap-around logic // the number of loops needs to be equal or greater than the index type for (auto loop = 0; loop != 256; ++loop) { - INFO("loop " << loop) + INFO("loop " << loop); // ensure we can fill the buffer for (auto i = 0; i != size; ++i) { diff --git a/tests/unit/hal/progmem/test_progmem.cpp b/tests/unit/hal/progmem/test_progmem.cpp index 14bf9c5..94eb7d0 100644 --- a/tests/unit/hal/progmem/test_progmem.cpp +++ b/tests/unit/hal/progmem/test_progmem.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "progmem.h" using Catch::Matchers::Equals; diff --git a/tests/unit/logic/cut_filament/test_cut_filament.cpp b/tests/unit/logic/cut_filament/test_cut_filament.cpp index 5c42cc0..18ac283 100644 --- a/tests/unit/logic/cut_filament/test_cut_filament.cpp +++ b/tests/unit/logic/cut_filament/test_cut_filament.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../../../../src/modules/buttons.h" #include "../../../../src/modules/finda.h" diff --git a/tests/unit/logic/eject_filament/test_eject_filament.cpp b/tests/unit/logic/eject_filament/test_eject_filament.cpp index 23bb494..00b15a2 100644 --- a/tests/unit/logic/eject_filament/test_eject_filament.cpp +++ b/tests/unit/logic/eject_filament/test_eject_filament.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../../../../src/modules/buttons.h" #include "../../../../src/modules/finda.h" diff --git a/tests/unit/logic/failing_tmc/test_failing_tmc.cpp b/tests/unit/logic/failing_tmc/test_failing_tmc.cpp index c7bee44..73af815 100644 --- a/tests/unit/logic/failing_tmc/test_failing_tmc.cpp +++ b/tests/unit/logic/failing_tmc/test_failing_tmc.cpp @@ -2,7 +2,7 @@ // As a base for this test, unload_filament was chosen. // Moreover, I didn't want to spoil the unit tests of the state machines themself with this. -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../../../../src/modules/buttons.h" #include "../../../../src/modules/finda.h" diff --git a/tests/unit/logic/feed_to_bondtech/test_feed_to_bondtech.cpp b/tests/unit/logic/feed_to_bondtech/test_feed_to_bondtech.cpp index 33103ef..96ea95a 100644 --- a/tests/unit/logic/feed_to_bondtech/test_feed_to_bondtech.cpp +++ b/tests/unit/logic/feed_to_bondtech/test_feed_to_bondtech.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../../../../src/modules/buttons.h" #include "../../../../src/modules/finda.h" diff --git a/tests/unit/logic/feed_to_finda/test_feed_to_finda.cpp b/tests/unit/logic/feed_to_finda/test_feed_to_finda.cpp index f4fbe34..32f3eec 100644 --- a/tests/unit/logic/feed_to_finda/test_feed_to_finda.cpp +++ b/tests/unit/logic/feed_to_finda/test_feed_to_finda.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../../../../src/modules/buttons.h" #include "../../../../src/modules/finda.h" diff --git a/tests/unit/logic/homing/test_homing.cpp b/tests/unit/logic/homing/test_homing.cpp index 3ce128f..7e7440b 100644 --- a/tests/unit/logic/homing/test_homing.cpp +++ b/tests/unit/logic/homing/test_homing.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../../../../src/modules/buttons.h" #include "../../../../src/modules/finda.h" diff --git a/tests/unit/logic/load_filament/test_load_filament.cpp b/tests/unit/logic/load_filament/test_load_filament.cpp index cb5d1a4..7e69e78 100644 --- a/tests/unit/logic/load_filament/test_load_filament.cpp +++ b/tests/unit/logic/load_filament/test_load_filament.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../../../../src/modules/buttons.h" #include "../../../../src/modules/finda.h" diff --git a/tests/unit/logic/stubs/main_loop_stub.cpp b/tests/unit/logic/stubs/main_loop_stub.cpp index 34ee0c9..ee49fc8 100644 --- a/tests/unit/logic/stubs/main_loop_stub.cpp +++ b/tests/unit/logic/stubs/main_loop_stub.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "main_loop_stub.h" #include "homing.h" diff --git a/tests/unit/logic/tool_change/test_tool_change.cpp b/tests/unit/logic/tool_change/test_tool_change.cpp index fda5b60..8f3ee54 100644 --- a/tests/unit/logic/tool_change/test_tool_change.cpp +++ b/tests/unit/logic/tool_change/test_tool_change.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../../../../src/modules/buttons.h" #include "../../../../src/modules/finda.h" diff --git a/tests/unit/logic/unload_filament/test_unload_filament.cpp b/tests/unit/logic/unload_filament/test_unload_filament.cpp index 5276180..3d44b65 100644 --- a/tests/unit/logic/unload_filament/test_unload_filament.cpp +++ b/tests/unit/logic/unload_filament/test_unload_filament.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../../../../src/modules/buttons.h" #include "../../../../src/modules/finda.h" diff --git a/tests/unit/logic/unload_to_finda/test_unload_to_finda.cpp b/tests/unit/logic/unload_to_finda/test_unload_to_finda.cpp index ff411e8..998ba82 100644 --- a/tests/unit/logic/unload_to_finda/test_unload_to_finda.cpp +++ b/tests/unit/logic/unload_to_finda/test_unload_to_finda.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include diff --git a/tests/unit/modules/buttons/test_buttons.cpp b/tests/unit/modules/buttons/test_buttons.cpp index fe25777..90ceebf 100644 --- a/tests/unit/modules/buttons/test_buttons.cpp +++ b/tests/unit/modules/buttons/test_buttons.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../stubs/stub_adc.h" #include "../stubs/stub_timebase.h" #include "buttons.h" diff --git a/tests/unit/modules/leds/test_leds.cpp b/tests/unit/modules/leds/test_leds.cpp index c8ad37b..15a19de 100644 --- a/tests/unit/modules/leds/test_leds.cpp +++ b/tests/unit/modules/leds/test_leds.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "leds.h" #include "shr16.h" #include "../stubs/stub_timebase.h" diff --git a/tests/unit/modules/motion/test_motion.cpp b/tests/unit/modules/motion/test_motion.cpp index 7603fa5..6efc765 100644 --- a/tests/unit/modules/motion/test_motion.cpp +++ b/tests/unit/modules/motion/test_motion.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "motion.h" using namespace modules::motion; diff --git a/tests/unit/modules/protocol/test_protocol.cpp b/tests/unit/modules/protocol/test_protocol.cpp index 4b4a086..70b631a 100644 --- a/tests/unit/modules/protocol/test_protocol.cpp +++ b/tests/unit/modules/protocol/test_protocol.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../logic/error_codes.h" #include "../logic/progress_codes.h" #include "protocol.h" diff --git a/tests/unit/modules/pulse_gen/test_pulse_gen.cpp b/tests/unit/modules/pulse_gen/test_pulse_gen.cpp index 1fd6412..d447031 100644 --- a/tests/unit/modules/pulse_gen/test_pulse_gen.cpp +++ b/tests/unit/modules/pulse_gen/test_pulse_gen.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "pulse_gen.h" #include "../pins.h" #include diff --git a/tests/unit/modules/speed_table/test_speed_table.cpp b/tests/unit/modules/speed_table/test_speed_table.cpp index f0223e8..8011959 100644 --- a/tests/unit/modules/speed_table/test_speed_table.cpp +++ b/tests/unit/modules/speed_table/test_speed_table.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "speed_table.h" #include diff --git a/tests/unit/modules/stubs/stub_eeprom.cpp b/tests/unit/modules/stubs/stub_eeprom.cpp index 97b0109..3a2a933 100644 --- a/tests/unit/modules/stubs/stub_eeprom.cpp +++ b/tests/unit/modules/stubs/stub_eeprom.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../../../../src/hal/eeprom.h" #include "stub_eeprom.h" diff --git a/tests/unit/modules/timebase/test_timebase.cpp b/tests/unit/modules/timebase/test_timebase.cpp index 672418e..d295568 100644 --- a/tests/unit/modules/timebase/test_timebase.cpp +++ b/tests/unit/modules/timebase/test_timebase.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "timebase.h" #include "../stubs/stub_timebase.h" diff --git a/tests/unit/modules/user_input/test_user_input.cpp b/tests/unit/modules/user_input/test_user_input.cpp index 37e0792..54ce4b5 100644 --- a/tests/unit/modules/user_input/test_user_input.cpp +++ b/tests/unit/modules/user_input/test_user_input.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" #include "../stubs/stub_adc.h" #include "../stubs/stub_timebase.h" #include "buttons.h" diff --git a/tests/unit/system_test.cpp b/tests/unit/system_test.cpp index ae76e09..4ccecfa 100644 --- a/tests/unit/system_test.cpp +++ b/tests/unit/system_test.cpp @@ -1,4 +1,4 @@ -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp" TEST_CASE("type tests", "[system]") { REQUIRE(sizeof(uint64_t) == 8); diff --git a/tests/unit/test_main.cpp b/tests/unit/test_main.cpp index 75a6112..ae21725 100644 --- a/tests/unit/test_main.cpp +++ b/tests/unit/test_main.cpp @@ -1,3 +1,2 @@ -#define CATCH_CONFIG_MAIN //#define CATCH_CONFIG_ENABLE_BENCHMARKING -#include "catch2/catch.hpp" +#include "catch2/catch_all.hpp"