ci(esp_rom): upgrade to Catch2 as a component, enable CI build

This commit is contained in:
Ivan Grokhotkov
2023-11-27 14:31:16 +01:00
parent 79a2c15477
commit 8e81bbe014
4 changed files with 15 additions and 9 deletions

View File

@@ -1,6 +1,10 @@
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps # Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
components/esp_rom/test_apps: components/esp_rom/test_apps/linux_rom_apis:
enable:
- if: IDF_TARGET == "linux"
components/esp_rom/test_apps/rom_tests:
disable_test: disable_test:
- if: IDF_TARGET in ["esp32", "esp32c2"] - if: IDF_TARGET in ["esp32", "esp32c2"]
temporary: false temporary: false

View File

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

@@ -15,7 +15,6 @@
Note that the printf function is roughly tested in the log host test. Note that the printf function is roughly tested in the log host test.
*/ */
#define CATCH_CONFIG_MAIN
#include <cstdio> #include <cstdio>
#include <regex> #include <regex>
#include <cstring> #include <cstring>
@@ -24,12 +23,10 @@
#include "esp_rom_crc.h" #include "esp_rom_crc.h"
#include "esp_rom_md5.h" #include "esp_rom_md5.h"
#include "catch.hpp" #include <catch2/catch_test_macros.hpp>
using namespace std; using namespace std;
static const char *TEST_TAG = "test";
// ESP_LOG_EARLY functions are tested in the log host tests and also test rom printf. // ESP_LOG_EARLY functions are tested in the log host tests and also test rom printf.
TEST_CASE("esp_rom printf returns correct char num") TEST_CASE("esp_rom printf returns correct char num")
{ {