Skip to content

Commit

Permalink
pw_unit_test: Marking pw_disableable_target as exportable and internal
Browse files Browse the repository at this point in the history
Change-Id: Ib06fbbee8792f3261dd74492fbd1b015652df3d0
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/122370
Reviewed-by: Wyatt Hepler <[email protected]>
Commit-Queue: Brian Barcenas <[email protected]>
Commit-Queue: Wyatt Hepler <[email protected]>
  • Loading branch information
Brian Barcenas authored and CQ Bot Account committed Dec 2, 2022
1 parent 08b29a1 commit 7818d3b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pw_unit_test/test.gni
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ if (pw_unit_test_EXECUTABLE_TARGET_TYPE != "pw_executable" &&
# <target_name>.DISABLED and creates an empty <target_name> group. This can be
# used to conditionally create targets without having to conditionally add them
# to groups. This results in simpler BUILD.gn files.
template("_pw_disableable_target") {
template("pw_internal_disableable_target") {
assert(defined(invoker.enable_if),
"`enable_if` is required for _pw_disableable_target")
"`enable_if` is required for pw_internal_disableable_target")
assert(defined(invoker.target_type),
"`target_type` is required for _pw_disableable_target")
"`target_type` is required for pw_internal_disableable_target")

if (invoker.enable_if) {
_actual_target_name = target_name
Expand Down Expand Up @@ -206,7 +206,7 @@ template("pw_test") {
}

# The unit test code as a source_set.
_pw_disableable_target("$target_name.lib") {
pw_internal_disableable_target("$target_name.lib") {
target_type = "pw_source_set"
enable_if = _test_is_enabled
forward_variables_from(invoker, "*", [ "metadata" ])
Expand All @@ -225,7 +225,7 @@ template("pw_test") {
}
}

_pw_disableable_target(_test_target_name) {
pw_internal_disableable_target(_test_target_name) {
target_type = pw_unit_test_EXECUTABLE_TARGET_TYPE
enable_if = _test_is_enabled

Expand Down

0 comments on commit 7818d3b

Please sign in to comment.