ci(log): upgrade to Catch2 as a component

This commit is contained in:
Ivan Grokhotkov
2023-11-27 14:34:10 +01:00
parent 88e77ba1ed
commit 33896fe67e
3 changed files with 10 additions and 6 deletions

View File

@@ -1,5 +1,8 @@
idf_component_register(SRCS "log_test.cpp" idf_component_register(SRCS "log_test.cpp"
INCLUDE_DIRS INCLUDE_DIRS "."
"." REQUIRES log
$ENV{IDF_PATH}/tools/catch WHOLE_ARCHIVE)
REQUIRES log)
# 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

@@ -0,0 +1,2 @@
dependencies:
espressif/catch2: "^3.4.0"

View File

@@ -6,13 +6,12 @@
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. CONDITIONS OF ANY KIND, either express or implied.
*/ */
#define CATCH_CONFIG_MAIN
#include <cstdio> #include <cstdio>
#include <regex> #include <regex>
#include <iostream> #include <iostream>
#include "esp_log.h" #include "esp_log.h"
#include "catch.hpp" #include <catch2/catch_test_macros.hpp>
using namespace std; using namespace std;