Skip to content

Commit 6409efd

Browse files
authored
Merge pull request #12051 from AnttiKauppila/unittest_config_improvement
Unittest configuration mechanism improved
2 parents 66eb594 + aac3437 commit 6409efd

File tree

35 files changed

+315
-175
lines changed

35 files changed

+315
-175
lines changed

UNITTESTS/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ foreach(testfile ${unittest-file-list})
158158
set(unittest-includes ${unittest-includes-base})
159159
set(unittest-sources)
160160
set(unittest-test-sources)
161+
set(unittest-test-flags)
161162

162163
# Get source files
163164
include("${testfile}")
@@ -184,6 +185,8 @@ foreach(testfile ${unittest-file-list})
184185
add_library("${TEST_SUITE_NAME}.${LIB_NAME}" STATIC ${unittest-sources})
185186
target_include_directories("${TEST_SUITE_NAME}.${LIB_NAME}" PRIVATE
186187
${unittest-includes})
188+
target_compile_options("${TEST_SUITE_NAME}.${LIB_NAME}" PRIVATE
189+
${unittest-test-flags})
187190
set(LIBS_TO_BE_LINKED ${LIBS_TO_BE_LINKED} "${TEST_SUITE_NAME}.${LIB_NAME}")
188191

189192
# Append lib build directory to list
@@ -195,6 +198,8 @@ foreach(testfile ${unittest-file-list})
195198
add_executable(${TEST_SUITE_NAME} ${unittest-test-sources})
196199
target_include_directories(${TEST_SUITE_NAME} PRIVATE
197200
${unittest-includes})
201+
target_compile_options(${TEST_SUITE_NAME} PRIVATE
202+
${unittest-test-flags})
198203

199204
# Link the executable with the libraries.
200205
target_link_libraries(${TEST_SUITE_NAME} ${LIBS_TO_BE_LINKED})

UNITTESTS/drivers/PwmOut/unittest.cmake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ set(unittest-test-sources
2323
stubs/pwmout_api_stub.c
2424
)
2525

26-
# defines
27-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEVICE_PWMOUT")
28-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEVICE_PWMOUT")
26+
set(unittest-test-flags
27+
-DDEVICE_PWMOUT
28+
)
29+

UNITTESTS/drivers/Watchdog/unittest.cmake

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ set(unittest-sources
1717

1818
# Test files
1919
set(unittest-test-sources
20-
drivers/Watchdog/test_watchdog.cpp
21-
stubs/mbed_critical_stub.c
20+
drivers/Watchdog/test_watchdog.cpp
21+
stubs/mbed_critical_stub.c
2222
stubs/mbed_assert_stub.cpp
2323
stubs/watchdog_api_stub.c
2424
)
2525

26-
# defines
27-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1")
28-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEVICE_WATCHDOG -DMBED_WDOG_ASSERT=1")
26+
set(unittest-test-flags
27+
-DDEVICE_WATCHDOG
28+
-DMBED_WDOG_ASSERT=1
29+
)

UNITTESTS/empty_baseline/unittest.cmake

Lines changed: 69 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,78 @@ set(unittest-includes ${unittest-includes}
1212
)
1313

1414
set(unittest-sources
15-
../features/device_key/source/DeviceKey.cpp
16-
../components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp
17-
../components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.cpp
18-
../components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.cpp
19-
../components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp
20-
../components/storage/blockdevice/COMPONENT_RSPIF/SPIFReducedBlockDevice.cpp
21-
../components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp
22-
../components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp
23-
../features/storage/filesystem/Dir.cpp
24-
../features/storage/filesystem/FileSystem.cpp
25-
../features/storage/filesystem/File.cpp
26-
../features/storage/kvstore/global_api/kvstore_global_api.cpp
27-
../features/storage/kvstore/securestore/SecureStore.cpp
28-
../features/storage/kvstore/kv_map/KVMap.cpp
29-
../features/storage/kvstore/tdbstore/TDBStore.cpp
30-
../features/storage/kvstore/direct_access_devicekey/DirectAccessDevicekey.cpp
31-
../features/storage/kvstore/conf/kv_config.cpp
32-
../features/storage/kvstore/filesystemstore/FileSystemStore.cpp
33-
../features/storage/system_storage/SystemStorage.cpp
34-
../features/storage/blockdevice/ChainingBlockDevice.cpp
35-
../features/storage/blockdevice/ReadOnlyBlockDevice.cpp
36-
../features/storage/blockdevice/SlicingBlockDevice.cpp
37-
../features/storage/blockdevice/MBRBlockDevice.cpp
38-
../features/storage/blockdevice/HeapBlockDevice.cpp
39-
../features/storage/blockdevice/FlashSimBlockDevice.cpp
40-
../features/storage/blockdevice/ObservingBlockDevice.cpp
41-
../features/storage/blockdevice/ProfilingBlockDevice.cpp
42-
../features/storage/blockdevice/BufferedBlockDevice.cpp
43-
../features/storage/blockdevice/ExhaustibleBlockDevice.cpp
15+
../features/device_key/source/DeviceKey.cpp
16+
../components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp
17+
../components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.cpp
18+
../components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.cpp
19+
../components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp
20+
../components/storage/blockdevice/COMPONENT_RSPIF/SPIFReducedBlockDevice.cpp
21+
../components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp
22+
../components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp
23+
../features/storage/filesystem/Dir.cpp
24+
../features/storage/filesystem/FileSystem.cpp
25+
../features/storage/filesystem/File.cpp
26+
../features/storage/kvstore/global_api/kvstore_global_api.cpp
27+
../features/storage/kvstore/securestore/SecureStore.cpp
28+
../features/storage/kvstore/kv_map/KVMap.cpp
29+
../features/storage/kvstore/tdbstore/TDBStore.cpp
30+
../features/storage/kvstore/direct_access_devicekey/DirectAccessDevicekey.cpp
31+
../features/storage/kvstore/conf/kv_config.cpp
32+
../features/storage/kvstore/filesystemstore/FileSystemStore.cpp
33+
../features/storage/system_storage/SystemStorage.cpp
34+
../features/storage/blockdevice/ChainingBlockDevice.cpp
35+
../features/storage/blockdevice/ReadOnlyBlockDevice.cpp
36+
../features/storage/blockdevice/SlicingBlockDevice.cpp
37+
../features/storage/blockdevice/MBRBlockDevice.cpp
38+
../features/storage/blockdevice/HeapBlockDevice.cpp
39+
../features/storage/blockdevice/FlashSimBlockDevice.cpp
40+
../features/storage/blockdevice/ObservingBlockDevice.cpp
41+
../features/storage/blockdevice/ProfilingBlockDevice.cpp
42+
../features/storage/blockdevice/BufferedBlockDevice.cpp
43+
../features/storage/blockdevice/ExhaustibleBlockDevice.cpp
4444
)
4545

4646
set(unittest-test-sources
4747
empty_baseline/empty_baseline.cpp
4848
)
4949

50-
set(DEVICE_FLAGS "-DDEVICE_ANALOGIN -DDEVICE_ANALOGOUT -DDEVICE_CAN -DDEVICE_ETHERNET -DDEVICE_FLASH -DDEVICE_I2C -DDEVICE_I2CSLAVE -DDEVICE_I2C_ASYNCH -DDEVICE_INTERRUPTIN -DDEVICE_LPTICKER -DDEVICE_PORTIN -DDEVICE_PORTINOUT -DDEVICE_PORTOUT -DDEVICE_PWMOUT -DDEVICE_QSPI -DDEVICE_SERIAL -DDEVICE_SERIAL_ASYNCH -DDEVICE_SERIAL_FC -DDEVICE_SPI -DDEVICE_SPISLAVE -DDEVICE_SPI_ASYNCH -DDEVICE_FLASH -DCOMPONENT_FLASHIAP")
51-
set(CONF_FLAGS "-DMBED_CONF_PLATFORM_CTHUNK_COUNT_MAX=10 -DMBED_CONF_DATAFLASH_SPI_FREQ=1 -DMBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS=0 -DMBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE=0 -DMBED_CONF_QSPIF_QSPI_FREQ=1 -DMBED_CONF_QSPIF_QSPI_MIN_READ_SIZE=1 -DMBED_CONF_QSPIF_QSPI_MIN_PROG_SIZE=1 -DMBED_LFS_READ_SIZE=64 -DMBED_LFS_PROG_SIZE=64 -DMBED_LFS_BLOCK_SIZE=512 -DMBED_LFS_LOOKAHEAD=512 -DFLASHIAP_APP_ROM_END_ADDR=0x80000 -DMBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE=1024 -DMBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS=0x80000 -DMBED_CONF_STORAGE_STORAGE_TYPE=default")
52-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DEVICE_FLAGS} ${CONF_FLAGS}")
53-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DEVICE_FLAGS} ${CONF_FLAGS}")
50+
set(unittest-test-flags
51+
-DDEVICE_ANALOGIN
52+
-DDEVICE_ANALOGOUT
53+
-DDEVICE_CAN
54+
-DDEVICE_ETHERNET
55+
-DDEVICE_FLASH
56+
-DDEVICE_I2C
57+
-DDEVICE_I2CSLAVE
58+
-DDEVICE_I2C_ASYNCH
59+
-DDEVICE_INTERRUPTIN
60+
-DDEVICE_LPTICKER
61+
-DDEVICE_PORTIN
62+
-DDEVICE_PORTINOUT
63+
-DDEVICE_PORTOUT
64+
-DDEVICE_PWMOUT
65+
-DDEVICE_QSPI
66+
-DDEVICE_SERIAL
67+
-DDEVICE_SERIAL_ASYNCH
68+
-DDEVICE_SERIAL_FC
69+
-DDEVICE_SPI
70+
-DDEVICE_SPISLAVE
71+
-DDEVICE_SPI_ASYNCH
72+
-DCOMPONENT_FLASHIAP
73+
-DMBED_CONF_PLATFORM_CTHUNK_COUNT_MAX=10
74+
-DMBED_CONF_DATAFLASH_SPI_FREQ=1
75+
-DMBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS=0
76+
-DMBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE=0
77+
-DMBED_CONF_QSPIF_QSPI_FREQ=1
78+
-DMBED_CONF_QSPIF_QSPI_MIN_READ_SIZE=1
79+
-DMBED_CONF_QSPIF_QSPI_MIN_PROG_SIZE=1
80+
-DMBED_LFS_READ_SIZE=64
81+
-DMBED_LFS_PROG_SIZE=64
82+
-DMBED_LFS_BLOCK_SIZE=512
83+
-DMBED_LFS_LOOKAHEAD=512
84+
-DFLASHIAP_APP_ROM_END_ADDR=0x80000
85+
-DMBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE=1024
86+
-DMBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS=0x80000
87+
-DMBED_CONF_STORAGE_STORAGE_TYPE=default
88+
-DMBED_CONF_FAT_CHAN_FF_MAX_SS=4096
89+
)

UNITTESTS/events/equeue/unittest.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ set(unittest-test-sources
2020
stubs/EqueuePosix_stub.c
2121
)
2222

23-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -DEQUEUE_PLATFORM_POSIX")
24-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -DEQUEUE_PLATFORM_POSIX")
23+
set(unittest-test-flags
24+
-pthread
25+
-DEQUEUE_PLATFORM_POSIX
26+
)
27+

UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,10 @@ set(unittest-test-sources
4545
stubs/ConditionVariable_stub.cpp
4646
stubs/Mutex_stub.cpp
4747
)
48+
49+
set(unittest-test-flags
50+
-DDEVICE_SERIAL=1
51+
-DDEVICE_INTERRUPTIN=1
52+
-DMBED_CONF_CELLULAR_USE_SMS=1
53+
-DMBED_CONF_NSAPI_DEFAULT_CELLULAR_APN=NULL
54+
)

UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,17 @@ set(unittest-test-sources
4848
stubs/Mutex_stub.cpp
4949
)
5050

51-
# defines
52-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEVICE_SERIAL=1 -DDEVICE_INTERRUPTIN=1 -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_APN=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PLMN=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN=NULL")
53-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200")
54-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEVICE_SERIAL=1 -DDEVICE_INTERRUPTIN=1 -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_APN=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PLMN=NULL -DMBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN=NULL")
55-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200")
51+
set(unittest-test-flags
52+
-DDEVICE_SERIAL=1
53+
-DDEVICE_INTERRUPTIN=1
54+
-DMBED_CONF_NSAPI_DEFAULT_CELLULAR_APN=NULL
55+
-DMBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME=NULL
56+
-DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD=NULL
57+
-DMBED_CONF_NSAPI_DEFAULT_CELLULAR_PLMN=NULL
58+
-DMBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN=NULL
59+
-DMDMTXD=NC
60+
-DMDMRXD=NC
61+
-DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200
62+
-DMBED_CONF_CELLULAR_USE_SMS=1
63+
)
5664

UNITTESTS/features/cellular/framework/AT/at_cellularsms/unittest.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ set(unittest-test-sources
3232
stubs/Mutex_stub.cpp
3333
)
3434

35-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_CELLULAR_USE_SMS=1")
36-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_CELLULAR_USE_SMS=1")
37-
38-
35+
set(unittest-test-flags
36+
-DMBED_CONF_CELLULAR_USE_SMS=1
37+
)

UNITTESTS/features/cellular/framework/AT/athandler/unittest.cmake

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set(unittest-includes ${unittest-includes}
1010
../features/cellular/framework/common
1111
../features/cellular/framework/AT
1212
../features/frameworks/mbed-client-randlib/mbed-client-randlib
13-
13+
1414
)
1515

1616
# Source files
@@ -41,5 +41,9 @@ set(unittest-test-sources
4141
stubs/rtx_mutex_stub.c
4242
)
4343

44-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_CELLULAR_DEBUG_AT=true -DOS_STACK_SIZE=2048")
45-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_CELLULAR_DEBUG_AT=true -DOS_STACK_SIZE=2048")
44+
set(unittest-test-flags
45+
-DMBED_CONF_CELLULAR_DEBUG_AT=true
46+
-DOS_STACK_SIZE=2048
47+
-DDEVICE_SERIAL=1
48+
-DDEVICE_INTERRUPTIN=1
49+
)

UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ set(unittest-test-sources
4545
stubs/Mutex_stub.cpp
4646
)
4747

48-
# defines
49-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1 -DMBED_CONF_CELLULAR_CONTROL_PLANE_OPT=0")
50-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1 -DMBED_CONF_CELLULAR_CONTROL_PLANE_OPT=0")
48+
set(unittest-test-flags
49+
-DMDMRTS=PTC0
50+
-DMDMCTS=PTC1
51+
-DMDMTXD=NC
52+
-DMDMRXD=NC
53+
-DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200
54+
-DCELLULAR_DEVICE=myCellularDevice
55+
-DDEVICE_SERIAL_FC=1
56+
-DMBED_CONF_CELLULAR_CONTROL_PLANE_OPT=0
57+
-DDEVICE_SERIAL=1
58+
-DDEVICE_INTERRUPTIN=1
59+
-DMBED_CONF_CELLULAR_USE_SMS=1
60+
)

UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ set(unittest-test-sources
3737
stubs/Mutex_stub.cpp
3838
)
3939

40+
set(unittest-test-flags
41+
-DMDMRTS=PTC0
42+
-DMDMCTS=PTC1
43+
-DMDMTXD=NC
44+
-DMDMRXD=NC
45+
-DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200
46+
-DCELLULAR_DEVICE=myCellularDevice
47+
-DDEVICE_SERIAL_FC=1
48+
-DDEVICE_SERIAL=1
49+
-DDEVICE_INTERRUPTIN=1
50+
)
51+
4052
# defines
41-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1")
53+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ")
4254
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1")

UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ set(unittest-test-sources
4242
stubs/Mutex_stub.cpp
4343
)
4444

45-
# defines
46-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1 -DMBED_CONF_RTOS_PRESENT=1")
47-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMDMRTS=PTC0 -DMDMCTS=PTC1 -DMDMTXD=NC -DMDMRXD=NC -DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 -DCELLULAR_DEVICE=myCellularDevice -DDEVICE_SERIAL_FC=1 -DMBED_CONF_RTOS_PRESENT=1")
45+
set(unittest-test-flags
46+
-DMDMRTS=PTC0
47+
-DMDMCTS=PTC1
48+
-DMDMTXD=NC
49+
-DMDMRXD=NC
50+
-DMBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200
51+
-DCELLULAR_DEVICE=myCellularDevice
52+
-DDEVICE_SERIAL_FC=1
53+
-DMBED_CONF_RTOS_PRESENT=1
54+
-DDEVICE_SERIAL=1
55+
-DDEVICE_INTERRUPTIN=1
56+
-DMBED_CONF_CELLULAR_USE_SMS=1
57+
)

UNITTESTS/features/lorawan/loramac/unittest.cmake

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,21 @@ set(unittest-test-sources
4343
stubs/Mutex_stub.cpp
4444
)
4545

46-
# defines
47-
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_RTOS_PRESENT=1")
48-
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_RTOS_PRESENT=1")
49-
50-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_ADR_ON=true -DMBED_CONF_LORA_PUBLIC_NETWORK=true -DMBED_CONF_LORA_NB_TRIALS=2 -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5")
51-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_ADR_ON=true -DMBED_CONF_LORA_PUBLIC_NETWORK=true -DMBED_CONF_LORA_NB_TRIALS=2 -DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5")
46+
set(unittest-test-flags
47+
-DMBED_CONF_LORA_ADR_ON=true
48+
-DMBED_CONF_LORA_PUBLIC_NETWORK=true
49+
-DMBED_CONF_LORA_NB_TRIALS=2
50+
-DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5
51+
-DMBED_CONF_LORA_DUTY_CYCLE_ON=true
52+
-DMBED_CONF_LORA_MAX_SYS_RX_ERROR=10
53+
-DMBED_CONF_LORA_TX_MAX_SIZE=255
54+
-DMBED_CONF_LORA_DEVICE_ADDRESS=0x00000000
55+
)
5256

53-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_DUTY_CYCLE_ON=true -DMBED_CONF_LORA_MAX_SYS_RX_ERROR=10 -DMBED_CONF_LORA_NWKSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"")
54-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_DUTY_CYCLE_ON=true -DMBED_CONF_LORA_MAX_SYS_RX_ERROR=10 -DMBED_CONF_LORA_NWKSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"")
57+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_NWKSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"")
58+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_NWKSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"")
5559

5660
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_APPSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"")
5761
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_APPSKEY=\"{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\"")
5862

59-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_DEVICE_ADDRESS=\"0x00000000\"")
60-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_DEVICE_ADDRESS=\"0x00000000\"")
6163

UNITTESTS/features/lorawan/loramacchannelplan/unittest.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ set(unittest-test-sources
3535
stubs/LoRaPHY_stub.cpp
3636
)
3737

38-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_TX_MAX_SIZE=255")
39-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_TX_MAX_SIZE=255")
38+
set(unittest-test-flags
39+
-DMBED_CONF_LORA_TX_MAX_SIZE=255
40+
)

UNITTESTS/features/lorawan/loramaccommand/unittest.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ set(unittest-test-sources
3636
stubs/LoRaPHY_stub.cpp
3737
)
3838

39+
set(unittest-test-flags
40+
-DMBED_CONF_LORA_TX_MAX_SIZE=255
41+
)

UNITTESTS/features/lorawan/loramaccrypto/unittest.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ set(unittest-test-sources
4040

4141
)
4242

43+
set(unittest-test-flags
44+
-DMBED_CONF_LORA_TX_MAX_SIZE=255
45+
)

UNITTESTS/features/lorawan/loraphy/unittest.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ set(unittest-test-sources
3636
stubs/mbed_assert_stub.cpp
3737
)
3838

39+
set(unittest-test-flags
40+
-DMBED_CONF_LORA_WAKEUP_TIME=5
41+
-DMBED_CONF_LORA_DUTY_CYCLE_ON_JOIN=true
42+
-DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8
43+
-DMBED_CONF_LORA_TX_MAX_SIZE=255
44+
-DMBED_CONF_LORA_NB_TRIALS=2
45+
)
3946

40-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 -DMBED_CONF_LORA_DUTY_CYCLE_ON_JOIN=true -DMBED_CONF_LORA_WAKEUP_TIME=5")
41-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 -DMBED_CONF_LORA_DUTY_CYCLE_ON_JOIN=true -DMBED_CONF_LORA_WAKEUP_TIME=5")

UNITTESTS/features/lorawan/loraphyas923/unittest.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,9 @@ set(unittest-test-sources
3838

3939
)
4040

41+
set(unittest-test-flags
42+
-DMBED_CONF_LORA_TX_MAX_SIZE=255
43+
-DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5
44+
-DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8
45+
)
46+

UNITTESTS/features/lorawan/loraphyau915/unittest.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ set(unittest-test-sources
3838

3939
)
4040

41+
set(unittest-test-flags
42+
-DMBED_CONF_LORA_TX_MAX_SIZE=255
43+
-DMBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5
44+
-DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8
45+
)
46+
4147
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_FSB_MASK=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"")
4248
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_FSB_MASK=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"")
4349

0 commit comments

Comments
 (0)