fix: Use catch from component manager

The version present on idf repo was failing to compile.
Simple fix is to update to latest supported provided by component manager.
This commit is contained in:
Euripedes Rocha
2024-05-22 14:58:58 +02:00
parent ef12b615e1
commit 53e0cc75ee
3 changed files with 10 additions and 4 deletions

View File

@ -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)

View File

@ -0,0 +1,6 @@
## IDF Component Manager Manifest File
dependencies:
espressif/catch2: "^3.5.2"
## Required IDF version
idf:
version: ">=5.0.0"

View File

@ -9,8 +9,7 @@
#include <string_view>
#include <type_traits>
#include "esp_transport.h"
#define CATCH_CONFIG_MAIN // This tells the catch header to generate a main
#include "catch.hpp"
#include <catch2/catch_test_macros.hpp>
#include "mqtt_client.h"
extern "C" {