Skip to content

Commit 28d28fd

Browse files
Also allow filtering by RAM size
1 parent 88c42ba commit 28d28fd

File tree

6 files changed

+25
-8
lines changed

6 files changed

+25
-8
lines changed

storage/blockdevice/tests/TESTS/blockdevice/heap_block_device/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ mbed_greentea_add_test(
88
main.cpp
99
TEST_REQUIRED_LIBS
1010
mbed-storage-blockdevice
11+
NEEDED_RAM_KIB 6
1112
)

storage/blockdevice/tests/TESTS/blockdevice/mbr_block_device/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ mbed_greentea_add_test(
88
main.cpp
99
TEST_REQUIRED_LIBS
1010
mbed-storage-blockdevice
11+
NEEDED_RAM_KIB 10
1112
)

storage/blockdevice/tests/TESTS/blockdevice/util_block_device/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ mbed_greentea_add_test(
88
main.cpp
99
TEST_REQUIRED_LIBS
1010
mbed-storage-blockdevice
11+
NEEDED_RAM_KIB 10
1112
)

storage/kvstore/tests/TESTS/kvstore/general_tests_phase_1/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mbed_greentea_add_test(
1010
mbed-storage-kvstore-general_tests_phase_1
1111
TEST_SKIPPED
1212
${TEST_SKIPPED}
13-
MIN_FLASH_BYTES 140000
13+
NEEDED_FLASH_KIB 140
1414
TEST_SOURCES
1515
main.cpp
1616
TEST_REQUIRED_LIBS

storage/kvstore/tests/TESTS/kvstore/general_tests_phase_2/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mbed_greentea_add_test(
1010
mbed-storage-kvstore-general_tests_phase_2
1111
TEST_SKIPPED
1212
${TEST_SKIPPED}
13-
MIN_FLASH_BYTES 140000
13+
NEEDED_FLASH_KIB 140
1414
TEST_SOURCES
1515
main.cpp
1616
TEST_REQUIRED_LIBS

tools/cmake/mbed_greentea.cmake

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ set(MBED_GREENTEA_SERIAL_PORT "" CACHE STRING "Serial port name to talk to the M
1313
# HOST_TESTS_DIR - Path to the "host_tests" directory. If a relative path is provided, it will be
1414
# interpreted relative to the source directory.
1515
# TEST_SKIPPED - Reason if suite is skipped
16-
# NEEDED_FLASH_BYTES - Minimum flash size, in bytes, needed to run this test. Test will be skipped if flash
16+
# NEEDED_FLASH_KIB - Minimum flash size, in kiB, needed to run this test. Test will be skipped if flash
17+
# size is known and is less than this.
18+
# NEEDED_RAM_KIB - Minimum RAM size, in kiB, needed to run this test. Test will be skipped if RAM bank 0
1719
# size is known and is less than this.
1820
#
1921
# calling the macro:
@@ -33,7 +35,8 @@ set(MBED_GREENTEA_SERIAL_PORT "" CACHE STRING "Serial port name to talk to the M
3335
# mbed-xyz
3436
# HOST_TESTS_DIR
3537
# ${CMAKE_CURRENT_LIST_DIR}/host_tests
36-
# NEEDED_FLASH_BYTES 140000
38+
# NEEDED_FLASH_KIB 130
39+
# NEEDED_RAM_KIB 10
3740
# TEST_SKIPPED
3841
# ${skip_reason}
3942
# )
@@ -43,7 +46,8 @@ function(mbed_greentea_add_test)
4346
set(singleValueArgs
4447
TEST_NAME
4548
TEST_SKIPPED
46-
NEEDED_FLASH_BYTES
49+
NEEDED_FLASH_KIB
50+
NEEDED_RAM_KIB
4751
)
4852
set(multipleValueArgs
4953
TEST_INCLUDE_DIRS
@@ -62,10 +66,20 @@ function(mbed_greentea_add_test)
6266
message(FATAL_ERROR "Will not be able to run greentea tests without MBED_GREENTEA_SERIAL_PORT defined!")
6367
endif()
6468

65-
if(NOT "${MBED_GREENTEA_NEEDED_FLASH_BYTES}" STREQUAL "")
69+
if(NOT "${MBED_GREENTEA_NEEDED_FLASH_KIB}" STREQUAL "")
70+
math(EXPR NEEDED_FLASH_BYTES "${MBED_GREENTEA_NEEDED_FLASH_KIB} * 1024")
6671
if("${MBED_CONFIG_DEFINITIONS}" MATCHES "MBED_ROM_SIZE=((0x[0-9A-Fa-f]+)|([0-9]+))")
67-
if(${CMAKE_MATCH_1} LESS ${MBED_GREENTEA_NEEDED_FLASH_BYTES})
68-
set(MBED_GREENTEA_TEST_SKIPPED "Not enough flash space!")
72+
if(${CMAKE_MATCH_1} LESS NEEDED_FLASH_BYTES)
73+
set(MBED_GREENTEA_TEST_SKIPPED "Not enough flash space! Need at least ${MBED_GREENTEA_NEEDED_FLASH_KIB} kiB for this test.")
74+
endif()
75+
endif()
76+
endif()
77+
78+
if(NOT "${MBED_GREENTEA_NEEDED_RAM_KIB}" STREQUAL "")
79+
math(EXPR NEEDED_RAM_BYTES "${MBED_GREENTEA_NEEDED_RAM_KIB} * 1024")
80+
if("${MBED_CONFIG_DEFINITIONS}" MATCHES "MBED_RAM_SIZE=((0x[0-9A-Fa-f]+)|([0-9]+))")
81+
if(${CMAKE_MATCH_1} LESS NEEDED_RAM_BYTES)
82+
set(MBED_GREENTEA_TEST_SKIPPED "Not enough RAM space! Need at least ${MBED_GREENTEA_NEEDED_RAM_KIB} kiB for this test.")
6983
endif()
7084
endif()
7185
endif()

0 commit comments

Comments
 (0)