diff --git a/components/esp_rom/test_apps/.build-test-rules.yml b/components/esp_rom/test_apps/.build-test-rules.yml index 15492a369e..1eb663e797 100644 --- a/components/esp_rom/test_apps/.build-test-rules.yml +++ b/components/esp_rom/test_apps/.build-test-rules.yml @@ -1,6 +1,10 @@ # 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: - if: IDF_TARGET in ["esp32", "esp32c2"] temporary: false diff --git a/components/esp_rom/test_apps/linux_rom_apis/main/CMakeLists.txt b/components/esp_rom/test_apps/linux_rom_apis/main/CMakeLists.txt index f0f082fde3..baaac73170 100644 --- a/components/esp_rom/test_apps/linux_rom_apis/main/CMakeLists.txt +++ b/components/esp_rom/test_apps/linux_rom_apis/main/CMakeLists.txt @@ -1,5 +1,8 @@ idf_component_register(SRCS "rom_test.cpp" - INCLUDE_DIRS - "." - $ENV{IDF_PATH}/tools/catch - REQUIRES esp_rom) + INCLUDE_DIRS "." + REQUIRES esp_rom + WHOLE_ARCHIVE) + +# 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) diff --git a/components/esp_rom/test_apps/linux_rom_apis/main/idf_component.yml b/components/esp_rom/test_apps/linux_rom_apis/main/idf_component.yml new file mode 100644 index 0000000000..f7982136b9 --- /dev/null +++ b/components/esp_rom/test_apps/linux_rom_apis/main/idf_component.yml @@ -0,0 +1,2 @@ +dependencies: + espressif/catch2: "^3.4.0" diff --git a/components/esp_rom/test_apps/linux_rom_apis/main/rom_test.cpp b/components/esp_rom/test_apps/linux_rom_apis/main/rom_test.cpp index 664f8a6548..96654d8443 100644 --- a/components/esp_rom/test_apps/linux_rom_apis/main/rom_test.cpp +++ b/components/esp_rom/test_apps/linux_rom_apis/main/rom_test.cpp @@ -15,7 +15,6 @@ Note that the printf function is roughly tested in the log host test. */ -#define CATCH_CONFIG_MAIN #include #include #include @@ -24,12 +23,10 @@ #include "esp_rom_crc.h" #include "esp_rom_md5.h" -#include "catch.hpp" +#include 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. TEST_CASE("esp_rom printf returns correct char num") {