diff --git a/connectivity/lorawan/tests/UNITTESTS/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/CMakeLists.txt new file mode 100644 index 0000000000..9efa3167f2 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(features) diff --git a/connectivity/lorawan/tests/UNITTESTS/features/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/CMakeLists.txt new file mode 100644 index 0000000000..11270973b3 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(lorawan) diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/CMakeLists.txt new file mode 100644 index 0000000000..68ab2ebc2b --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(lorawaninterface) +add_subdirectory(loraphyus915) +add_subdirectory(loraphykr920) +add_subdirectory(loraphyin865) +add_subdirectory(loraphyeu868) +add_subdirectory(loraphyeu433) +add_subdirectory(loraphycn779) +add_subdirectory(loraphycn470) +add_subdirectory(loraphyau915) +add_subdirectory(loraphyas923) +add_subdirectory(loraphy) +add_subdirectory(loramaccrypto) +add_subdirectory(loramaccommand) +add_subdirectory(loramacchannelplan) +add_subdirectory(loramac) +add_subdirectory(lorawantimer) +add_subdirectory(lorawanstack) diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramac/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramac/CMakeLists.txt new file mode 100644 index 0000000000..471c436070 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramac/CMakeLists.txt @@ -0,0 +1,44 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loramac-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_ADR_ON=true + MBED_CONF_LORA_PUBLIC_NETWORK=true + MBED_CONF_LORA_NB_TRIALS=2 + MBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + MBED_CONF_LORA_DUTY_CYCLE_ON=true + MBED_CONF_LORA_MAX_SYS_RX_ERROR=10 + MBED_CONF_LORA_TX_MAX_SIZE=255 + MBED_CONF_LORA_DEVICE_ADDRESS=0x00000000 +) + +target_compile_options(${TEST_NAME} + PRIVATE + "-DMBED_CONF_LORA_NWKSKEY={0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}" + "-DMBED_CONF_LORA_NWKSKEY={0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}" + "-DMBED_CONF_LORA_APPSKEY={0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}" + "-DMBED_CONF_LORA_APPSKEY={0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}" +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/mac/LoRaMac.cpp + Test_LoRaMac.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramacchannelplan/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramacchannelplan/CMakeLists.txt new file mode 100644 index 0000000000..63928bfae7 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramacchannelplan/CMakeLists.txt @@ -0,0 +1,29 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loramac-channel-plan-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_TX_MAX_SIZE=255 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/mac/LoRaMacChannelPlan.cpp + Test_LoRaMacChannelPlan.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccommand/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccommand/CMakeLists.txt new file mode 100644 index 0000000000..9a93feba3e --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccommand/CMakeLists.txt @@ -0,0 +1,29 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loramac-command-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_TX_MAX_SIZE=255 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/mac/LoRaMacCommand.cpp + Test_LoRaMacCommand.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccrypto/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccrypto/CMakeLists.txt new file mode 100644 index 0000000000..4ab65c6569 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccrypto/CMakeLists.txt @@ -0,0 +1,29 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loramac-crypto-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_TX_MAX_SIZE=255 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/mac/LoRaMacCrypto.cpp + Test_LoRaMacCrypto.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphy/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphy/CMakeLists.txt new file mode 100644 index 0000000000..f4dae3d71e --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphy/CMakeLists.txt @@ -0,0 +1,33 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loraphy-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_WAKEUP_TIME=5 + MBED_CONF_LORA_DUTY_CYCLE_ON_JOIN=true + MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 + MBED_CONF_LORA_TX_MAX_SIZE=255 + MBED_CONF_LORA_NB_TRIALS=2 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/phy/LoRaPHY.cpp + Test_LoRaPHY.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyas923/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyas923/CMakeLists.txt new file mode 100644 index 0000000000..aeff45c056 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyas923/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loraphy-as923-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + MBED_CONF_LORA_TX_MAX_SIZE=255 + MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/phy/LoRaPHYAS923.cpp + Test_LoRaPHYAS923.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyau915/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyau915/CMakeLists.txt new file mode 100644 index 0000000000..479491adb6 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyau915/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loraphy-au915-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + MBED_CONF_LORA_TX_MAX_SIZE=255 + MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + +target_compile_options(${TEST_NAME} + PRIVATE + "-DMBED_CONF_LORA_FSB_MASK={0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}" + "-DMBED_CONF_LORA_FSB_MASK={0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}" +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/phy/LoRaPHYAU915.cpp + Test_LoRaPHYAU915.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn470/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn470/CMakeLists.txt new file mode 100644 index 0000000000..e67ef1c9ad --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn470/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loraphy-cn470-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + MBED_CONF_LORA_TX_MAX_SIZE=255 + MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + +target_compile_options(${TEST_NAME} + PRIVATE + "-DMBED_CONF_LORA_FSB_MASK_CHINA={0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}" + "-DMBED_CONF_LORA_FSB_MASK_CHINA={0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}" +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/phy/LoRaPHYCN470.cpp + Test_LoRaPHYCN470.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn779/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn779/CMakeLists.txt new file mode 100644 index 0000000000..7a59436f5c --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn779/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loraphy-cn779-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + MBED_CONF_LORA_TX_MAX_SIZE=255 + MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/phy/LoRaPHYCN779.cpp + Test_LoRaPHYCN779.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu433/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu433/CMakeLists.txt new file mode 100644 index 0000000000..913dae3979 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu433/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loraphy-eu433-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + MBED_CONF_LORA_TX_MAX_SIZE=255 + MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/phy/LoRaPHYEU433.cpp + Test_LoRaPHYEU433.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu868/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu868/CMakeLists.txt new file mode 100644 index 0000000000..febdec3391 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu868/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loraphy-eu868-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + MBED_CONF_LORA_TX_MAX_SIZE=255 + MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/phy/LoRaPHYEU868.cpp + Test_LoRaPHYEU868.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyin865/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyin865/CMakeLists.txt new file mode 100644 index 0000000000..8fb2940e36 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyin865/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loraphy-in865-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + MBED_CONF_LORA_TX_MAX_SIZE=255 + MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/phy/LoRaPHYIN865.cpp + Test_LoRaPHYIN865.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphykr920/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphykr920/CMakeLists.txt new file mode 100644 index 0000000000..be56ff856f --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphykr920/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loraphy-kr920-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + MBED_CONF_LORA_TX_MAX_SIZE=255 + MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/phy/LoRaPHYKR920.cpp + Test_LoRaPHYKR920.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyus915/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyus915/CMakeLists.txt new file mode 100644 index 0000000000..3e94d6ee1b --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyus915/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-loraphy-us915-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH=5 + MBED_CONF_LORA_TX_MAX_SIZE=255 + MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 +) + +target_compile_options(${TEST_NAME} + PRIVATE + "-DMBED_CONF_LORA_FSB_MASK={0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}" + "-DMBED_CONF_LORA_FSB_MASK={0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}" +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/phy/LoRaPHYUS915.cpp + Test_LoRaPHYUS915.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawaninterface/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawaninterface/CMakeLists.txt new file mode 100644 index 0000000000..489cece0c1 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawaninterface/CMakeLists.txt @@ -0,0 +1,30 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-lorawan-interface-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_PHY=EU868 + MBED_CONF_LORA_TX_MAX_SIZE=255 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/source/LoRaWANInterface.cpp + Test_LoRaWANInterface.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawanstack/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawanstack/CMakeLists.txt new file mode 100644 index 0000000000..3f678713c5 --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawanstack/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-lorawan-stack-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + MBED_CONF_LORA_OVER_THE_AIR_ACTIVATION=true + MBED_CONF_LORA_AUTOMATIC_UPLINK_MESSAGE=true + MBED_CONF_LORA_TX_MAX_SIZE=255 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/source/LoRaWANStack.cpp + Test_LoRaWANStack.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan") diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/CMakeLists.txt new file mode 100644 index 0000000000..9efdd076cf --- /dev/null +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/CMakeLists.txt @@ -0,0 +1,30 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(TEST_NAME lorawan-lorawan-timer-unittest) + +add_executable(${TEST_NAME}) + +target_compile_definitions(${TEST_NAME} + PRIVATE + NDEBUG=1 + MBED_CONF_LORA_TX_MAX_SIZE=255 +) + +target_sources(${TEST_NAME} + PRIVATE + ${mbed-os_SOURCE_DIR}/connectivity/lorawan/system/LoRaWANTimer.cpp + Test_LoRaWANTimer.cpp +) + +target_link_libraries(${TEST_NAME} + PRIVATE + mbed-headers + mbed-stubs + mbed-stubs-headers + gmock_main +) + +add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) + +set_tests_properties(${TEST_NAME} PROPERTIES LABELS "lorawan")