Skip to content

Commit

Permalink
fix: Use catch from component manager
Browse files Browse the repository at this point in the history
The version present on idf repo was failing to compile.
Simple fix is to update to latest supported provided by component manager.
  • Loading branch information
euripedesrocha committed May 22, 2024
1 parent ef12b61 commit 53e0cc7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions host_test/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 6 additions & 0 deletions host_test/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## IDF Component Manager Manifest File
dependencies:
espressif/catch2: "^3.5.2"
## Required IDF version
idf:
version: ">=5.0.0"
3 changes: 1 addition & 2 deletions host_test/main/test_mqtt_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 53e0cc7

Please sign in to comment.