Skip to content

Commit

Permalink
Same as previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
feasel0 committed Aug 8, 2024
1 parent ce9a5ca commit 1719556
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions build/chip/chip_test_suite.gni
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,60 @@ template("chip_test_suite") {
tests += [ _test_name ]
}

# Deprecated usage (user-defined driver)
if (defined(invoker.tests)) {
foreach(_test, invoker.tests) {
_test_output_dir = "${root_out_dir}/tests"
if (defined(invoker.output_dir)) {
_test_output_dir = invoker.output_dir
}

pw_test(_test) {
# Forward certain varibles from the invoker.
forward_variables_from(invoker,
[
"deps",
"public_deps",
"cflags",
"configs",
])

# Link to the common library for this test suite.
if (chip_link_tests) {
public_deps += [ ":${_suite_name}.lib" ]
}

# Set variables that the platform executable may need.
if (test_executable_output_name != "") {
output_name = test_executable_output_name + _test_name + test_executable_output_name_suffix
}
ldflags = test_executable_ldflags

# Add the individual test source file (e.g. "TestSomething.cpp") and its driver.
sources = [
"${_test}.cpp",
"${_test}Driver.cpp",
]

test_main = ""
output_dir = _test_output_dir
}
tests += [ _test ]
}
}

group(_suite_name) {
deps = []

# Add each individual unit test.
foreach(_test, tests) {
deps += [ ":${_test}" ]
}

# Add the common library if none of the above tests did.
if (!chip_link_tests) {
deps += [ ":${_suite_name}.lib" ]
}
}

if (chip_pw_run_tests) {
Expand Down

0 comments on commit 1719556

Please sign in to comment.