feat(cxx): run c++ tests for esp32c61 and esp32p4

This commit is contained in:
Alexey Lapshin
2025-05-16 18:00:26 +07:00
parent e82d51a9ee
commit e521d37f6f
12 changed files with 32 additions and 38 deletions

View File

@@ -2,6 +2,6 @@
components/cxx/test_apps: components/cxx/test_apps:
enable: enable:
- if: IDF_TARGET in ["esp32", "esp32c3"] - if: IDF_TARGET in ["esp32", "esp32c3", "esp32c61", "esp32p4"]
temporary: true temporary: true
reason: the other targets are not tested yet reason: the other targets are not tested yet

View File

@@ -1,2 +1,2 @@
| Supported Targets | ESP32 | ESP32-C3 | | Supported Targets | ESP32 | ESP32-C3 | ESP32-C61 | ESP32-P4 |
| ----------------- | ----- | -------- | | ----------------- | ----- | -------- | --------- | -------- |

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@@ -13,12 +13,10 @@
- 88 bytes are allocated by pthread_setspecific() to init internal lock - 88 bytes are allocated by pthread_setspecific() to init internal lock
- some more memory... - some more memory...
*/ */
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32C61 || CONFIG_IDF_TARGET_ESP32P4
#define LEAKS (300) #define LEAKS (128) /* real: 72 */
#elif CONFIG_IDF_TARGET_ESP32S2 #elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32C3
#define LEAKS (800) #define LEAKS (448) /* real: 396 */
#elif CONFIG_IDF_TARGET_ESP32C3
#define LEAKS (700)
#else #else
#error "unknown target in CXX tests, can't set leaks threshold" #error "unknown target in CXX tests, can't set leaks threshold"
#endif #endif

View File

@@ -6,6 +6,6 @@ from pytest_embedded_idf.utils import idf_parametrize
@pytest.mark.generic @pytest.mark.generic
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) @idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
def test_cxx_exception(dut: Dut) -> None: def test_cxx_exception(dut: Dut) -> None:
dut.run_all_single_board_cases() dut.run_all_single_board_cases()

View File

@@ -1,2 +1,2 @@
| Supported Targets | ESP32 | ESP32-C3 | | Supported Targets | ESP32 | ESP32-C3 | ESP32-C61 | ESP32-P4 |
| ----------------- | ----- | -------- | | ----------------- | ----- | -------- | --------- | -------- |

View File

@@ -6,7 +6,7 @@ from pytest_embedded_idf.utils import idf_parametrize
@pytest.mark.generic @pytest.mark.generic
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) @idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
def test_cxx_noexcept_out_of_range(dut: Dut) -> None: def test_cxx_noexcept_out_of_range(dut: Dut) -> None:
dut.expect_exact('Press ENTER to see the list of tests') dut.expect_exact('Press ENTER to see the list of tests')
dut.write('1') dut.write('1')
@@ -15,7 +15,7 @@ def test_cxx_noexcept_out_of_range(dut: Dut) -> None:
@pytest.mark.generic @pytest.mark.generic
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) @idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
def test_cxx_noexcept_bad_alloc(dut: Dut) -> None: def test_cxx_noexcept_bad_alloc(dut: Dut) -> None:
dut.expect_exact('Press ENTER to see the list of tests') dut.expect_exact('Press ENTER to see the list of tests')
dut.write('2') dut.write('2')

View File

@@ -1,2 +1,2 @@
| Supported Targets | ESP32 | ESP32-C3 | | Supported Targets | ESP32 | ESP32-C3 | ESP32-C61 | ESP32-P4 |
| ----------------- | ----- | -------- | | ----------------- | ----- | -------- | --------- | -------- |

View File

@@ -108,18 +108,16 @@ TEST_CASE("static initialization guards work as expected", "[misc]")
TEST_ASSERT_NOT_NULL(s_slow_init_sem); TEST_ASSERT_NOT_NULL(s_slow_init_sem);
int task_count = 0; int task_count = 0;
// four tasks competing for static initialization of one object // four tasks competing for static initialization of one object
task_count += start_slow_init_task<1>(0, PRO_CPU_NUM); for (int i = 0; i < CONFIG_FREERTOS_NUMBER_OF_CORES; i++) {
#if CONFIG_FREERTOS_NUMBER_OF_CORES == 2 task_count += start_slow_init_task<1>(i, i);
task_count += start_slow_init_task<1>(1, APP_CPU_NUM); }
#endif
task_count += start_slow_init_task<1>(2, PRO_CPU_NUM); task_count += start_slow_init_task<1>(2, PRO_CPU_NUM);
task_count += start_slow_init_task<1>(3, tskNO_AFFINITY); task_count += start_slow_init_task<1>(3, tskNO_AFFINITY);
// four tasks competing for static initialization of another object // four tasks competing for static initialization of another object
task_count += start_slow_init_task<2>(0, PRO_CPU_NUM); for (int i = 0; i < CONFIG_FREERTOS_NUMBER_OF_CORES; i++) {
#if CONFIG_FREERTOS_NUMBER_OF_CORES == 2 task_count += start_slow_init_task<2>(i, i);
task_count += start_slow_init_task<2>(1, APP_CPU_NUM); }
#endif
task_count += start_slow_init_task<2>(2, PRO_CPU_NUM); task_count += start_slow_init_task<2>(2, PRO_CPU_NUM);
task_count += start_slow_init_task<2>(3, tskNO_AFFINITY); task_count += start_slow_init_task<2>(3, tskNO_AFFINITY);

View File

@@ -9,21 +9,21 @@ configurations = ['noexcept', 'exceptions_rtti']
@pytest.mark.generic @pytest.mark.generic
@pytest.mark.parametrize('config', configurations, indirect=True) @pytest.mark.parametrize('config', configurations, indirect=True)
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) @idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
def test_cxx_static_init_non_pod(dut: Dut) -> None: def test_cxx_static_init_non_pod(dut: Dut) -> None:
dut.run_all_single_board_cases(name=['can use static initializers for non-POD types']) dut.run_all_single_board_cases(name=['can use static initializers for non-POD types'])
@pytest.mark.generic @pytest.mark.generic
@pytest.mark.parametrize('config', configurations, indirect=True) @pytest.mark.parametrize('config', configurations, indirect=True)
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) @idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
def test_cxx_misc(dut: Dut) -> None: def test_cxx_misc(dut: Dut) -> None:
dut.run_all_single_board_cases(group='misc') dut.run_all_single_board_cases(group='misc')
@pytest.mark.generic @pytest.mark.generic
@pytest.mark.parametrize('config', configurations, indirect=True) @pytest.mark.parametrize('config', configurations, indirect=True)
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) @idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
def test_cxx_stack_smash(dut: Dut) -> None: def test_cxx_stack_smash(dut: Dut) -> None:
dut.expect_exact('Press ENTER to see the list of tests') dut.expect_exact('Press ENTER to see the list of tests')
dut.write('"stack smashing protection CXX"') dut.write('"stack smashing protection CXX"')

View File

@@ -1,2 +1,2 @@
| Supported Targets | ESP32 | ESP32-C3 | | Supported Targets | ESP32 | ESP32-C3 | ESP32-C61 | ESP32-P4 |
| ----------------- | ----- | -------- | | ----------------- | ----- | -------- | --------- | -------- |

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@@ -14,12 +14,10 @@
- 88 bytes are allocated by pthread_setspecific() to init internal lock - 88 bytes are allocated by pthread_setspecific() to init internal lock
- some more memory... - some more memory...
*/ */
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32C61 || CONFIG_IDF_TARGET_ESP32P4
#define LEAKS (300) #define LEAKS (128) /* real: 72 */
#elif CONFIG_IDF_TARGET_ESP32S2 #elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32C3
#define LEAKS (800) #define LEAKS (448) /* real: 396 */
#elif CONFIG_IDF_TARGET_ESP32C3
#define LEAKS (700)
#else #else
#error "unknown target in CXX tests, can't set leaks threshold" #error "unknown target in CXX tests, can't set leaks threshold"
#endif #endif

View File

@@ -6,6 +6,6 @@ from pytest_embedded_idf.utils import idf_parametrize
@pytest.mark.generic @pytest.mark.generic
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) @idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
def test_cxx_rtti(dut: Dut) -> None: def test_cxx_rtti(dut: Dut) -> None:
dut.run_all_single_board_cases() dut.run_all_single_board_cases()