Update CMake integration for Catch v3.1.0
parent
12bd495c06
commit
6248ce93d7
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
#include "application.h"
|
||||
#include <stdint.h>
|
||||
#include "../modules/stubs/stub_serial.h"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
#include "progmem.h"
|
||||
|
||||
using Catch::Matchers::Equals;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
#include "../../../../src/modules/buttons.h"
|
||||
#include "../../../../src/modules/finda.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
#include "../../../../src/modules/buttons.h"
|
||||
#include "../../../../src/modules/finda.h"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
#include "../../../../src/modules/buttons.h"
|
||||
#include "../../../../src/modules/finda.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
#include "../../../../src/modules/buttons.h"
|
||||
#include "../../../../src/modules/finda.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
#include "../../../../src/modules/buttons.h"
|
||||
#include "../../../../src/modules/finda.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
#include "../../../../src/modules/buttons.h"
|
||||
#include "../../../../src/modules/finda.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
#include "main_loop_stub.h"
|
||||
#include "homing.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
#include "../../../../src/modules/buttons.h"
|
||||
#include "../../../../src/modules/finda.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
#include "../../../../src/modules/buttons.h"
|
||||
#include "../../../../src/modules/finda.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
#include <functional>
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
#include "leds.h"
|
||||
#include "shr16.h"
|
||||
#include "../stubs/stub_timebase.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
#include "motion.h"
|
||||
|
||||
using namespace modules::motion;
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
#include "pulse_gen.h"
|
||||
#include "../pins.h"
|
||||
#include <stdio.h>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
#include "speed_table.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
#include "../../../../src/hal/eeprom.h"
|
||||
#include "stub_eeprom.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
#include "timebase.h"
|
||||
#include "../stubs/stub_timebase.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
||||
TEST_CASE("type tests", "[system]") {
|
||||
REQUIRE(sizeof(uint64_t) == 8);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
#define CATCH_CONFIG_MAIN
|
||||
//#define CATCH_CONFIG_ENABLE_BENCHMARKING
|
||||
#include "catch2/catch.hpp"
|
||||
#include "catch2/catch_all.hpp"
|
||||
|
|
|
|||
Loading…
Reference in New Issue