@@ -53,23 +53,17 @@ declare_args() {
53
53
template (" chip_test_suite" ) {
54
54
_suite_name = target_name
55
55
56
- # Ensures that the common library has sources containing both common
57
- # and individual unit tests.
58
- if (! defined (invoker .sources )) {
59
- invoker .sources = []
60
- }
61
56
if (! defined (invoker .test_sources )) {
62
57
invoker .test_sources = []
63
58
}
64
- invoker .sources += invoker .test_sources
65
59
66
60
if (chip_build_test_static_libraries ) {
67
61
_target_type = " static_library"
68
62
} else {
69
63
_target_type = " source_set"
70
64
}
71
65
target (_target_type , " ${ _suite_name } .lib" ) {
72
- forward_variables_from (invoker , " *" , [ " tests" ])
66
+ forward_variables_from (invoker , " *" , [ " tests" , " test_sources " , ])
73
67
74
68
output_dir = " ${ root_out_dir } /lib"
75
69
@@ -108,10 +102,8 @@ template("chip_test_suite") {
108
102
" configs" ,
109
103
])
110
104
111
- # Link to the common library for this test suite.
112
- if (chip_link_tests ) {
113
- public_deps += [ " :${ _suite_name } .lib" ]
114
- }
105
+ # Link to the common lib for this suite so we get its `sources`.
106
+ public_deps += [ " :${ _suite_name } .lib" ]
115
107
116
108
# Set variables that the platform executable may need.
117
109
if (test_executable_output_name != " " ) {
@@ -135,11 +127,6 @@ template("chip_test_suite") {
135
127
foreach (_test , tests ) {
136
128
deps += [ " :${ _test } " ]
137
129
}
138
-
139
- # Add the common library if none of the above tests did.
140
- if (! chip_link_tests ) {
141
- deps += [ " :${ _suite_name } .lib" ]
142
- }
143
130
}
144
131
145
132
if (chip_pw_run_tests ) {
0 commit comments