Merge branch 'fix_host_test' into 'master'

fix: Use catch from component manager

See merge request espressif/esp-mqtt!210
This commit is contained in:
Rocha Euripedes
2024-05-22 22:15:21 +08:00
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" {