Skip to content

Commit b2d11fc

Browse files
author
Jamie Smith
authored
Reactivate some tests and functionality that had accidentally been disabled due to incorrect checks (#372)
* Start on fixing some unintentionally skipped tests * Reactivate stats tests * CI fixes * Include cinttypes * Fault & crash data RAM working on STM32H7!
1 parent edf13ff commit b2d11fc

File tree

24 files changed

+90
-44
lines changed

24 files changed

+90
-44
lines changed

.github/workflows/greentea_cmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ jobs:
146146
# Note: We have to set a wifi network name and password so that the test will compile on devices that use wifi
147147
run: |
148148
rm -rf __build
149-
cmake -S . -B __build -GNinja -DUPLOAD_METHOD=NONE -DMBED_GREENTEA_WIFI_SECURE_SSID=SomeNetwork -DMBED_GREENTEA_WIFI_SECURE_PASSWORD=SomePassword -DCMAKE_CTEST_ARGUMENTS="--output-on-failure;-V" -DMBED_BUILD_GREENTEA_TESTS=ON -DMBED_GREENTEA_TEST_BAREMETAL=ON -DMBED_GREENTEA_SERIAL_PORT=/dev/ttyDUMMY -DMBED_TARGET=${{ matrix.target }} -DMBED_APP_JSON_PATH=TESTS/configs/baremetal.json
149+
cmake -S . -B __build -GNinja -DUPLOAD_METHOD=NONE -DMBED_GREENTEA_WIFI_SECURE_SSID=SomeNetwork -DMBED_GREENTEA_WIFI_SECURE_PASSWORD=SomePassword -DCMAKE_CTEST_ARGUMENTS="--output-on-failure;-V" -DMBED_BUILD_GREENTEA_TESTS=ON -DMBED_GREENTEA_TEST_BAREMETAL=ON -DMBED_GREENTEA_SERIAL_PORT=/dev/ttyDUMMY -DMBED_TARGET=${{ matrix.target }} -DMBED_APP_JSON_PATH=TESTS/configs/greentea_baremetal.json5
150150
cmake --build __build
151151
152152
- name: Build ${{ matrix.target }} with full profile
153153
if: ${{ matrix.profile == 'full' }}
154154
run: |
155155
rm -rf __build
156-
cmake -S . -B __build -GNinja -DUPLOAD_METHOD=NONE -DMBED_GREENTEA_WIFI_SECURE_SSID=SomeNetwork -DMBED_GREENTEA_WIFI_SECURE_PASSWORD=SomePassword -DCMAKE_CTEST_ARGUMENTS="--output-on-failure;-V" -DMBED_BUILD_GREENTEA_TESTS=ON -DMBED_GREENTEA_SERIAL_PORT=/dev/ttyDUMMY -DMBED_TARGET=${{ matrix.target }}
156+
cmake -S . -B __build -GNinja -DUPLOAD_METHOD=NONE -DMBED_GREENTEA_WIFI_SECURE_SSID=SomeNetwork -DMBED_GREENTEA_WIFI_SECURE_PASSWORD=SomePassword -DCMAKE_CTEST_ARGUMENTS="--output-on-failure;-V" -DMBED_BUILD_GREENTEA_TESTS=ON -DMBED_GREENTEA_SERIAL_PORT=/dev/ttyDUMMY -DMBED_TARGET=${{ matrix.target }} -DMBED_APP_JSON_PATH=TESTS/configs/greentea_full.json5
157157
cmake --build __build
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"target_overrides": {
3+
"*": {
4+
"target.c_lib": "small"
5+
}
6+
},
7+
"overrides": {
8+
// Enable Mbed Stats tests
9+
"platform.all-stats-enabled": 1,
10+
11+
// Enable auto reboot on error, required for crash reporting test
12+
"platform.fatal-error-auto-reboot-enabled": true
13+
}
14+
}

TESTS/configs/greentea_full.json5

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"overrides": {
3+
// Enable Mbed Stats tests
4+
"platform.all-stats-enabled": 1,
5+
6+
// Enable auto reboot on error, required for crash reporting test
7+
"platform.fatal-error-auto-reboot-enabled": true
8+
}
9+
}

TESTS/integration/COMMON/common_defines_fs_test.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#elif COMPONENT_NUSD
3535
#define TEST_BLOCK_DEVICE_TYPE "NUSD"
3636
#define TEST_USE_FILESYSTEM FS_FAT
37-
#elif COMPONENT_FLASHIAP && MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE
37+
#elif DEVICE_FLASH && MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE
3838
#define TEST_BLOCK_DEVICE_TYPE "FLASHIAP"
3939
#else
4040
#define TEST_BLOCK_DEVICE_TYPE "UNKNOWN"

drivers/device_key/include/device_key/DeviceKey.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
// Whole class is not supported if entropy is not enabled
2727
// Flash device is required as Device Key is currently depending on it
28-
#if !DEVICE_FLASH || !defined(COMPONENT_FLASHIAP)
28+
#if !DEVICE_FLASH
2929
#undef DEVICEKEY_ENABLED
3030
#define DEVICEKEY_ENABLED 0
3131
#endif

drivers/device_key/tests/TESTS/device_key/functionality/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if(NOT "DEVICE_TRNG=1" IN_LIST MBED_TARGET_DEFINITIONS)
55
set(TEST_SKIPPED "True RNG is not supported for this target so device key cannot be used")
66
endif()
77

8-
if(NOT ("DEVICE_FLASH=1" IN_LIST MBED_TARGET_DEFINITIONS AND "COMPONENT_FLASHIAP=1" IN_LIST MBED_TARGET_DEFINITIONS))
8+
if(NOT "DEVICE_FLASH=1" IN_LIST MBED_TARGET_DEFINITIONS)
99
set(TEST_SKIPPED "Flash IAP is not supported for this target so device key cannot be used")
1010
endif()
1111

platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/TESTS/its_ps/test/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ utest::v1::status_t case_its_setup_handler(const Case *const source, const size_
220220
Case cases[] = {
221221
Case("PSA prot internal storage - Basic", case_its_setup_handler<its>, pits_ps_test<its>, case_its_teardown_handler),
222222
Case("PSA prot internal storage - Write-once", case_its_setup_handler<its>, pits_ps_write_once_test<its>, case_its_teardown_handler),
223-
#if COMPONENT_FLASHIAP
223+
#if DEVICE_FLASH
224224
Case("PSA protected storage - Basic", case_its_setup_handler<ps>, pits_ps_test<ps>),
225225
Case("PSA protected storage - Write-once", case_its_setup_handler<ps>, pits_ps_write_once_test<ps>)
226226
#endif

platform/source/mbed_error.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,13 @@ WEAK MBED_NORETURN mbed_error_status_t mbed_error(mbed_error_status_t error_stat
320320
//Protect report_error_ctx while we update it
321321
core_util_critical_section_enter();
322322
report_error_ctx = last_error_ctx;
323+
324+
// If the MCU has a data cache, ensure that the fault data is flushed to main memory
325+
// before reboot
326+
#if __DCACHE_PRESENT
327+
SCB_CleanDCache_by_Addr(&report_error_ctx, sizeof(mbed_crash_data_t));
328+
#endif
329+
323330
core_util_critical_section_exit();
324331
//We need not call delete_mbed_crc(crc_obj) here as we are going to reset the system anyway, and calling delete while handling a fatal error may cause nested exception
325332
#if MBED_CONF_PLATFORM_FATAL_ERROR_AUTO_REBOOT_ENABLED && (MBED_CONF_PLATFORM_ERROR_REBOOT_MAX > 0)

platform/tests/TESTS/mbed_platform/crash_reporting/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(mbed_greentea)
5-
6-
if(NOT DEFINED MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED)
7-
set(TEST_SKIPPED "crash_reporting test not supported.")
4+
if(NOT "MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED=1" IN_LIST MBED_CONFIG_DEFINITIONS)
5+
set(TEST_SKIPPED "CRC is not supported for this target")
86
endif()
97

108
mbed_greentea_add_test(

platform/tests/TESTS/mbed_platform/stats_cpu/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33

44
include(mbed_greentea)
55

6-
if(NOT DEFINED MBED_CPU_STATS_ENABLED OR NOT "DEVICE_LPTICKER=1" IN_LIST MBED_TARGET_DEFINITIONS
7-
OR NOT "DEVICE_SLEEP=1" IN_LIST MBED_TARGET_DEFINITIONS)
6+
if(NOT "DEVICE_LPTICKER=1" IN_LIST MBED_TARGET_DEFINITIONS OR NOT "DEVICE_SLEEP=1" IN_LIST MBED_TARGET_DEFINITIONS)
87
set(TEST_SKIPPED "Stats cpu test not supported.")
98
endif()
109

10+
if((NOT "MBED_CPU_STATS_ENABLED=1" IN_LIST MBED_CONFIG_DEFINITIONS) AND (NOT "MBED_ALL_STATS_ENABLED=1" IN_LIST MBED_CONFIG_DEFINITIONS))
11+
set(TEST_SKIPPED "CPU stats not enabled")
12+
endif()
13+
1114
mbed_greentea_add_test(
1215
TEST_NAME
1316
mbed-platform-stats-cpu

0 commit comments

Comments
 (0)