Skip to content

Commit e521d37

Browse files
committed
feat(cxx): run c++ tests for esp32c61 and esp32p4
1 parent e82d51a commit e521d37

File tree

12 files changed

+32
-38
lines changed

12 files changed

+32
-38
lines changed

components/cxx/test_apps/.build-test-rules.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
components/cxx/test_apps:
44
enable:
5-
- if: IDF_TARGET in ["esp32", "esp32c3"]
5+
- if: IDF_TARGET in ["esp32", "esp32c3", "esp32c61", "esp32p4"]
66
temporary: true
77
reason: the other targets are not tested yet
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| Supported Targets | ESP32 | ESP32-C3 |
2-
| ----------------- | ----- | -------- |
1+
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C61 | ESP32-P4 |
2+
| ----------------- | ----- | -------- | --------- | -------- |

components/cxx/test_apps/exception/main/test_exception.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -13,12 +13,10 @@
1313
- 88 bytes are allocated by pthread_setspecific() to init internal lock
1414
- some more memory...
1515
*/
16-
#if CONFIG_IDF_TARGET_ESP32
17-
#define LEAKS (300)
18-
#elif CONFIG_IDF_TARGET_ESP32S2
19-
#define LEAKS (800)
20-
#elif CONFIG_IDF_TARGET_ESP32C3
21-
#define LEAKS (700)
16+
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32C61 || CONFIG_IDF_TARGET_ESP32P4
17+
#define LEAKS (128) /* real: 72 */
18+
#elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32C3
19+
#define LEAKS (448) /* real: 396 */
2220
#else
2321
#error "unknown target in CXX tests, can't set leaks threshold"
2422
#endif

components/cxx/test_apps/exception/pytest_cxx_exception.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77

88
@pytest.mark.generic
9-
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target'])
9+
@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
1010
def test_cxx_exception(dut: Dut) -> None:
1111
dut.run_all_single_board_cases()
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| Supported Targets | ESP32 | ESP32-C3 |
2-
| ----------------- | ----- | -------- |
1+
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C61 | ESP32-P4 |
2+
| ----------------- | ----- | -------- | --------- | -------- |

components/cxx/test_apps/exception_no_except/pytest_cxx_exception_no_except.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
@pytest.mark.generic
9-
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target'])
9+
@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
1010
def test_cxx_noexcept_out_of_range(dut: Dut) -> None:
1111
dut.expect_exact('Press ENTER to see the list of tests')
1212
dut.write('1')
@@ -15,7 +15,7 @@ def test_cxx_noexcept_out_of_range(dut: Dut) -> None:
1515

1616

1717
@pytest.mark.generic
18-
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target'])
18+
@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
1919
def test_cxx_noexcept_bad_alloc(dut: Dut) -> None:
2020
dut.expect_exact('Press ENTER to see the list of tests')
2121
dut.write('2')
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| Supported Targets | ESP32 | ESP32-C3 |
2-
| ----------------- | ----- | -------- |
1+
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C61 | ESP32-P4 |
2+
| ----------------- | ----- | -------- | --------- | -------- |

components/cxx/test_apps/general/main/test_cxx_general.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,16 @@ TEST_CASE("static initialization guards work as expected", "[misc]")
108108
TEST_ASSERT_NOT_NULL(s_slow_init_sem);
109109
int task_count = 0;
110110
// four tasks competing for static initialization of one object
111-
task_count += start_slow_init_task<1>(0, PRO_CPU_NUM);
112-
#if CONFIG_FREERTOS_NUMBER_OF_CORES == 2
113-
task_count += start_slow_init_task<1>(1, APP_CPU_NUM);
114-
#endif
111+
for (int i = 0; i < CONFIG_FREERTOS_NUMBER_OF_CORES; i++) {
112+
task_count += start_slow_init_task<1>(i, i);
113+
}
115114
task_count += start_slow_init_task<1>(2, PRO_CPU_NUM);
116115
task_count += start_slow_init_task<1>(3, tskNO_AFFINITY);
117116

118117
// four tasks competing for static initialization of another object
119-
task_count += start_slow_init_task<2>(0, PRO_CPU_NUM);
120-
#if CONFIG_FREERTOS_NUMBER_OF_CORES == 2
121-
task_count += start_slow_init_task<2>(1, APP_CPU_NUM);
122-
#endif
118+
for (int i = 0; i < CONFIG_FREERTOS_NUMBER_OF_CORES; i++) {
119+
task_count += start_slow_init_task<2>(i, i);
120+
}
123121
task_count += start_slow_init_task<2>(2, PRO_CPU_NUM);
124122
task_count += start_slow_init_task<2>(3, tskNO_AFFINITY);
125123

components/cxx/test_apps/general/pytest_cxx_general.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99

1010
@pytest.mark.generic
1111
@pytest.mark.parametrize('config', configurations, indirect=True)
12-
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target'])
12+
@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
1313
def test_cxx_static_init_non_pod(dut: Dut) -> None:
1414
dut.run_all_single_board_cases(name=['can use static initializers for non-POD types'])
1515

1616

1717
@pytest.mark.generic
1818
@pytest.mark.parametrize('config', configurations, indirect=True)
19-
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target'])
19+
@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
2020
def test_cxx_misc(dut: Dut) -> None:
2121
dut.run_all_single_board_cases(group='misc')
2222

2323

2424
@pytest.mark.generic
2525
@pytest.mark.parametrize('config', configurations, indirect=True)
26-
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target'])
26+
@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32c61', 'esp32p4'], indirect=['target'])
2727
def test_cxx_stack_smash(dut: Dut) -> None:
2828
dut.expect_exact('Press ENTER to see the list of tests')
2929
dut.write('"stack smashing protection CXX"')
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| Supported Targets | ESP32 | ESP32-C3 |
2-
| ----------------- | ----- | -------- |
1+
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C61 | ESP32-P4 |
2+
| ----------------- | ----- | -------- | --------- | -------- |

0 commit comments

Comments
 (0)