diff options
author | Carlos Chinchilla <cachinchilla@google.com> | 2023-12-11 23:03:17 +0000 |
---|---|---|
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-12-11 23:03:17 +0000 |
commit | ed6838928252163f4ab15f154fea02c2fccdd688 (patch) | |
tree | e944d762a0a167faf1f5d603cd8a3102a40293a5 /pw_unit_test | |
parent | 869da39148d337306eae1ce0ec365aa1abb9d818 (diff) | |
download | pigweed-ed6838928252163f4ab15f154fea02c2fccdd688.tar.gz |
pw_unit_test: Use googletest backend as a dep
Keep the pw_unit_test_GOOGLETEST_BACKEND flag in GN as a way to point to
the googletest target (default: //third_party/googletest). This allows
users to use the pw_unit_test:googletest backend with their own
googletest backend.
Bug: 315351886
Change-Id: Ib21c5767b28d1cd0e5951159fe39fdde9ea3c38f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/184656
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Carlos Chinchilla <cachinchilla@google.com>
Reviewed-by: Taylor Cramer <cramertj@google.com>
Reviewed-by: Ben Lawson <benlawson@google.com>
Diffstat (limited to 'pw_unit_test')
-rw-r--r-- | pw_unit_test/BUILD.gn | 5 | ||||
-rw-r--r-- | pw_unit_test/test.gni | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/pw_unit_test/BUILD.gn b/pw_unit_test/BUILD.gn index cb7d553dc..7ee27f126 100644 --- a/pw_unit_test/BUILD.gn +++ b/pw_unit_test/BUILD.gn @@ -121,7 +121,7 @@ if (pw_unit_test_BACKEND != "") { public_configs = [ ":googletest_public_overrides_include_path" ] public = [ "googletest_public_overrides/pw_unit_test/framework_backend.h" ] - public_deps = [ "$dir_pw_third_party/googletest" ] + public_deps = [ pw_unit_test_GOOGLETEST_BACKEND ] } } @@ -289,6 +289,9 @@ if (pw_unit_test_BACKEND == "$dir_pw_unit_test:light") { public = [ "public/pw_unit_test/static_library_support.h" ] sources = [ "static_library_support.cc" ] } +} else { + group("static_library_support") { + } } pw_executable("test_rpc_server") { diff --git a/pw_unit_test/test.gni b/pw_unit_test/test.gni index 926177c2e..79b8aa1ec 100644 --- a/pw_unit_test/test.gni +++ b/pw_unit_test/test.gni @@ -30,13 +30,15 @@ declare_args() { # Usage: toolchain-controlled only pw_unit_test_BACKEND = "$dir_pw_unit_test:light" - # Warning: Deprecated build argument. - # When using the gooogletest backend, set pw_unit_test_BACKEND to - # //pw_unit_test:googletest instead. + # The GoogleTest library target. This is not a pw_unit_test backend (anymore). + # Use this to depend on the GoogleTest library directly *WITHOUT* using the + # pw_unit_test facade. The //pw_unit_test:googletest backend depends on this + # library target. + # Defaults to //third_party/googletest. # # Type: string (GN path to a source set) # Usage: toolchain-controlled only - pw_unit_test_GOOGLETEST_BACKEND = "" + pw_unit_test_GOOGLETEST_BACKEND = "$dir_pw_third_party/googletest" # Implementation of a main function for ``pw_test`` unit test binaries. Must # be set to an appropriate target for the pw_unit_test backend. |