Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced nlunit-test with pw_unit_test in src/access/tests/ #29682

Merged
merged 4 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions build/chip/chip_test_suite.gni
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ assert(chip_build_tests)
#
# public_deps = [
# "${chip_root}/src/lib/foo", # add dependencies here
# "${nlunit_test_root}:nlunit-test",
# ]
# }
#
Expand All @@ -57,7 +56,6 @@ assert(chip_build_tests)
#
# public_deps = [
# "${chip_root}/src/lib/foo", # add dependencies here
# "${nlunit_test_root}:nlunit-test",
# ]
#
# tests = [
Expand Down Expand Up @@ -94,6 +92,8 @@ template("chip_test_suite") {
public_deps = []
}

deps = [ dir_pw_unit_test ]

if (current_os != "zephyr" && current_os != "mbed") {
# Depend on stdio logging, and have it take precedence over the default platform backend
public_deps += [ "${chip_root}/src/platform/logging:force_stdio" ]
Expand All @@ -106,6 +106,11 @@ template("chip_test_suite") {
foreach(_test, invoker.test_sources) {
_test_name = string_replace(_test, ".cpp", "")

_test_output_dir = "${root_out_dir}/tests"
if (defined(invoker.output_dir)) {
_test_output_dir = invoker.output_dir
}

pw_test(_test_name) {
forward_variables_from(invoker,
[
Expand All @@ -116,13 +121,19 @@ template("chip_test_suite") {
])
public_deps += [ ":${_suite_name}.lib" ]
sources = [ _test ]
output_dir = _test_output_dir
}
tests += [ _test_name ]
}
}

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_variables_from(invoker,
[
Expand All @@ -137,6 +148,7 @@ template("chip_test_suite") {
"${_test}.cpp",
"${_test}Driver.cpp",
]
output_dir = _test_output_dir
}
tests += [ _test ]
}
Expand Down Expand Up @@ -164,7 +176,7 @@ template("chip_test_suite") {
}
}

# TODO: remove this once transition away from nlunit-test is completed
# TODO [PW_MIGRATION]: remove this once transition away from nlunit-test is completed
template("chip_test_suite_using_nltest") {
_suite_name = target_name

Expand Down
9 changes: 3 additions & 6 deletions src/access/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,18 @@

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/nlunit_test.gni")
import("//build_overrides/pigweed.gni")

import("${chip_root}/build/chip/chip_test_suite.gni")

chip_test_suite_using_nltest("tests") {
chip_test_suite("tests") {
output_name = "libaccesstest"

test_sources = [ "TestAccessControl.cpp" ]

cflags = [ "-Wconversion" ]

public_deps = [
"${chip_root}/src/access",
"${chip_root}/src/lib/support:test_utils",
"${chip_root}/src/lib/support:testing_nlunit",
"${nlunit_test_root}:nlunit-test",
"${dir_pw_unit_test}",
]
}
Loading
Loading