Skip to content

Commit ec94bd8

Browse files
committed
Test suite's common lib now contains only sources, not test_sources and is dep'd by each pw_test
1 parent 6f04bde commit ec94bd8

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

build/chip/chip_test_suite.gni

+3-16
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,17 @@ declare_args() {
5353
template("chip_test_suite") {
5454
_suite_name = target_name
5555

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-
}
6156
if (!defined(invoker.test_sources)) {
6257
invoker.test_sources = []
6358
}
64-
invoker.sources += invoker.test_sources
6559

6660
if (chip_build_test_static_libraries) {
6761
_target_type = "static_library"
6862
} else {
6963
_target_type = "source_set"
7064
}
7165
target(_target_type, "${_suite_name}.lib") {
72-
forward_variables_from(invoker, "*", [ "tests" ])
66+
forward_variables_from(invoker, "*", [ "tests", "test_sources", ])
7367

7468
output_dir = "${root_out_dir}/lib"
7569

@@ -108,10 +102,8 @@ template("chip_test_suite") {
108102
"configs",
109103
])
110104

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" ]
115107

116108
# Set variables that the platform executable may need.
117109
if (test_executable_output_name != "") {
@@ -135,11 +127,6 @@ template("chip_test_suite") {
135127
foreach(_test, tests) {
136128
deps += [ ":${_test}" ]
137129
}
138-
139-
# Add the common library if none of the above tests did.
140-
if (!chip_link_tests) {
141-
deps += [ ":${_suite_name}.lib" ]
142-
}
143130
}
144131

145132
if (chip_pw_run_tests) {

0 commit comments

Comments
 (0)