@@ -34,20 +34,24 @@ include(toolchain)
34
34
35
35
project (chip-open-iot-sdk-unit-tests LANGUAGES C CXX ASM)
36
36
37
+
37
38
include (sdk)
38
39
include (chip)
39
40
include (linker)
40
41
41
42
add_subdirectory (${OPEN_IOT_SDK_EXAMPLE_COMMON} /app ./app_build)
42
43
43
44
file (STRINGS test_components.txt TEST_NAMES_FROM_FILE)
45
+ # TODO [PW_MIGRATION] Remove the following variable once the migration to pw_unit_test is complete.
46
+ file (STRINGS test_components_nl.txt TEST_NAMES_FROM_FILE_NL)
44
47
45
48
target_compile_definitions (openiotsdk-startup
46
49
PRIVATE
47
50
IOT_SDK_APP_MAIN_STACK_SIZE=20480
48
51
)
49
52
50
- foreach (TEST_NAME IN LISTS TEST_NAMES_FROM_FILE)
53
+ # TODO [PW_MIGRATION] Remove the following targets once the migration to pw_unit_test is complete.
54
+ foreach (TEST_NAME IN LISTS TEST_NAMES_FROM_FILE_NL)
51
55
set (APP_TARGET ${TEST_NAME} _ns)
52
56
add_executable (${APP_TARGET} )
53
57
target_include_directories (${APP_TARGET}
@@ -56,6 +60,34 @@ foreach(TEST_NAME IN LISTS TEST_NAMES_FROM_FILE)
56
60
${CHIP_ROOT} /third_party/nlunit-test /repo/src
57
61
)
58
62
63
+ target_sources (${APP_TARGET}
64
+ PRIVATE
65
+ main/main_ns_nl.cpp
66
+ )
67
+
68
+ target_link_libraries (${APP_TARGET}
69
+ openiotsdk-startup
70
+ openiotsdk-app
71
+ )
72
+
73
+ # Link the *whole-archives* to keep the static test objects.
74
+ target_link_options (${APP_TARGET}
75
+ PUBLIC
76
+ -Wl,--whole-archive "${CMAKE_CURRENT_BINARY_DIR} /chip_build/lib/lib${TEST_NAME} .a"
77
+ -Wl,--no -whole-archive)
78
+
79
+ set_target_link(${APP_TARGET} )
80
+ sdk_post_build(${APP_TARGET} )
81
+ endforeach ()
82
+
83
+ foreach (TEST_NAME IN LISTS TEST_NAMES_FROM_FILE)
84
+ set (APP_TARGET ${TEST_NAME} _ns)
85
+ add_executable (${APP_TARGET} )
86
+ target_include_directories (${APP_TARGET}
87
+ PRIVATE
88
+ main/include
89
+ )
90
+
59
91
target_sources (${APP_TARGET}
60
92
PRIVATE
61
93
main/main_ns.cpp
@@ -70,6 +102,7 @@ foreach(TEST_NAME IN LISTS TEST_NAMES_FROM_FILE)
70
102
target_link_options (${APP_TARGET}
71
103
PUBLIC
72
104
-Wl,--whole-archive "${CMAKE_CURRENT_BINARY_DIR} /chip_build/lib/lib${TEST_NAME} .a"
105
+ "${CMAKE_CURRENT_BINARY_DIR} /chip_build/lib/libPWTestsWrapper.a"
73
106
-Wl,--no -whole-archive)
74
107
75
108
set_target_link(${APP_TARGET} )
0 commit comments