diff --git a/host_test/main/CMakeLists.txt b/host_test/main/CMakeLists.txt index a6e5c7a..9e5347b 100644 --- a/host_test/main/CMakeLists.txt +++ b/host_test/main/CMakeLists.txt @@ -1,9 +1,10 @@ idf_component_register(SRCS "test_mqtt_client.cpp" - INCLUDE_DIRS "$ENV{IDF_PATH}/tools/catch" - REQUIRES cmock mqtt esp_timer esp_hw_support http_parser log) + REQUIRES cmock mqtt esp_timer esp_hw_support http_parser log + WHOLE_ARCHIVE) target_compile_options(${COMPONENT_LIB} PUBLIC -fsanitize=address -fconcepts) target_link_options(${COMPONENT_LIB} PUBLIC -fsanitize=address) +target_link_libraries(${COMPONENT_LIB} PUBLIC Catch2::Catch2WithMain) idf_component_get_property(mqtt mqtt COMPONENT_LIB) target_compile_definitions(${mqtt} PRIVATE SOC_WIFI_SUPPORTED=1) diff --git a/host_test/main/idf_component.yml b/host_test/main/idf_component.yml new file mode 100644 index 0000000..6efd693 --- /dev/null +++ b/host_test/main/idf_component.yml @@ -0,0 +1,6 @@ +## IDF Component Manager Manifest File +dependencies: + espressif/catch2: "^3.5.2" + ## Required IDF version + idf: + version: ">=5.0.0" diff --git a/host_test/main/test_mqtt_client.cpp b/host_test/main/test_mqtt_client.cpp index 116a609..8963df0 100644 --- a/host_test/main/test_mqtt_client.cpp +++ b/host_test/main/test_mqtt_client.cpp @@ -9,8 +9,7 @@ #include #include #include "esp_transport.h" -#define CATCH_CONFIG_MAIN // This tells the catch header to generate a main -#include "catch.hpp" +#include #include "mqtt_client.h" extern "C" {