ci(tcp_transport): upgrade to Catch2 as a component

This commit is contained in:
Ivan Grokhotkov
2023-11-28 18:24:30 +01:00
parent ae3da4a383
commit b52182e14f
4 changed files with 8 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
idf_component_register(SRCS "test_socks_transport.cpp" "catch_main.cpp"
idf_component_register(SRCS "test_socks_transport.cpp"
REQUIRES tcp_transport mocked_transport
INCLUDE_DIRS "$ENV{IDF_PATH}/tools"
WHOLE_ARCHIVE)
@@ -9,4 +9,7 @@ idf_component_get_property(tcp_transport_component tcp_transport COMPONENT_LIB)
target_link_libraries(${tcp_transport_component} PUBLIC ${lwip_component} ${esp_timer_component})
target_compile_options(${COMPONENT_LIB} PUBLIC -fsanitize=address -fconcepts)
target_link_options(${COMPONENT_LIB} PUBLIC -fsanitize=address)
set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 20)
# Currently 'main' for IDF_TARGET=linux is defined in freertos component.
# Since we are using a freertos mock here, need to let Catch2 provide 'main'.
target_link_libraries(${COMPONENT_LIB} PRIVATE Catch2WithMain)

View File

@@ -1,7 +0,0 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#define CATCH_CONFIG_MAIN
#include "catch/catch.hpp"

View File

@@ -1,4 +1,3 @@
dependencies:
espressif/fmt: "^9.1.0"
idf:
version: ">=4.1.0"
espressif/catch2: "^3.4.0"

View File

@@ -16,7 +16,8 @@
#include <netdb.h>
#include "fmt/core.h"
#include "fmt/ranges.h"
#include "catch/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers_all.hpp>
#include "esp_transport.h"
#include "esp_transport_socks_proxy.h"