Skip to content

Commit fb8862e

Browse files
committed
SWPROT-8953: zpc: Use zwave testfrawework for generating mocks
It will fail to generate mocks: applications/zpc/components/zwave/zwave_transports/s2/s2_inclusion_mock.c Note that it is possible that libs2 tf is more up to date than the one from UnifySDK-1.6. To avoid duplication of it, it would be desirable to maintain this project in a single place. For the record if applied alone some tests will/can fail: The following tests did not run: 188 - zwave_smartstart_management_test (Disabled) The following tests FAILED: 1 - unify_build (Failed) 160 - zwave_command_class_switch_multilevel_test (Failed) 201 - binding_cluster_mapper_test (Failed) So we will have to adjust this in a zpc specific change Origin: #13 Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
1 parent fd51859 commit fb8862e

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ if(NOT DEFINED COMMON_LOCATION)
1313
set(COMMON_LOCATION "${UNIFYSDK_SOURCE_DIR}")
1414
endif()
1515

16+
if(BUILD_TESTING)
17+
include(${CMAKE_SOURCE_DIR}/components/testframework/target_add_unittest.cmake)
18+
include(cmake/include/unittest.cmake)
19+
endif()
20+
1621
# ##############################################################################
1722
# Global includes
1823
# ##############################################################################

applications/zpc/CMakeLists.txt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,12 @@ include(${COMMON_PATH}/cmake/include/zap.cmake)
3333
include(${COMMON_PATH}/cmake/include/unittest.cmake)
3434
include(${COMMON_PATH}/cmake/include/version_file.cmake)
3535

36-
set(DEFAULT_UNIFY-TESTFRAMEWORK_PATH
37-
${COMMON_PATH}/components/testframework)
38-
if(EXISTS ${UNIFY-TESTFRAMEWORK_LOCATION})
39-
set(UNIFY-TESTFRAMEWORK_PATH ${UNIFY-TESTFRAMEWORK_LOCATION})
40-
else()
41-
set(UNIFY-TESTFRAMEWORK_PATH ${DEFAULT_UNIFY-TESTFRAMEWORK_PATH})
42-
endif()
36+
# Overload test system with downstream one (patched for z-wave ?)
37+
set(UNIFY-TESTFRAMEWORK_PATH
38+
${CMAKE_SOURCE_DIR}/components/testframework)
39+
message(STATUS "Using: ${UNIFY-TESTFRAMEWORK_PATH}")
4340
if(NOT EXISTS ${UNIFY-TESTFRAMEWORK_PATH})
44-
message(FATAL_ERROR "Path to unify testframework does not exist")
45-
else()
46-
message(STATUS "Found unify testframwork: ${UNIFY-TESTFRAMEWORK_PATH}")
41+
message(FATAL_ERROR "Path to unify testframework does not exist: ${UNIFY-TESTFRAMEWORK_PATH}")
4742
endif()
4843

4944
include(${UNIFY-TESTFRAMEWORK_PATH}/add_mock.cmake)

applications/zpc/components/ucl_mqtt/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ if(BUILD_TESTING)
2626
# Unit tests
2727
add_subdirectory(test)
2828

29+
include_directories(
30+
${CMAKE_SOURCE_DIR}/include
31+
)
2932
# Mocks
3033
add_mock(ucl_mqtt_mock include/ucl_mqtt.h)
3134
target_interface_libraries(ucl_mqtt_mock zpc_utils)

0 commit comments

Comments
 (0)