pw_build/cmake: Deprecate pw_auto_add_module_tests
Now that it's no longer in use, the pw_auto_add_module_tests
Cmake function is deprecated in favor of direct use of pw_add_test.
Change-Id: I265dc415fce1730dcf5d78918c2257864b32fec5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/119890
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
diff --git a/pw_build/pigweed.cmake b/pw_build/pigweed.cmake
index af806c6..dedd6da 100644
--- a/pw_build/pigweed.cmake
+++ b/pw_build/pigweed.cmake
@@ -122,50 +122,6 @@
endforeach()
endmacro()
-# Creates a test for each source file ending in _test. Tests with mutliple .cc
-# files or different dependencies than the module will not work correctly.
-#
-# Args:
-#
-# PRIVATE_DEPS - dependencies to apply to all tests
-# GROUPS - groups in addition to MODULE to which to add these tests
-#
-function(pw_auto_add_module_tests MODULE)
- pw_parse_arguments(
- NUM_POSITIONAL_ARGS
- 1
- MULTI_VALUE_ARGS
- PRIVATE_DEPS
- GROUPS
- )
-
- file(GLOB cc_tests *_test.cc)
-
- foreach(test IN LISTS cc_tests)
- get_filename_component(test_name "${test}" NAME_WE)
-
- # Find a .c test corresponding with the test .cc file, if any.
- file(GLOB c_test "${test_name}.c" "${test_name}_c.c")
-
- pw_add_test("${MODULE}.${test_name}"
- SOURCES
- "${test}"
- ${c_test}
- PRIVATE_DEPS
- ${arg_PRIVATE_DEPS}
- GROUPS
- "${MODULE}"
- ${arg_GROUPS}
- )
- # Generator expressions are not targets, ergo cannot be passed via the
- # public pw_add_test_generic API.
- target_link_libraries("${MODULE}.${test_name}.lib"
- PRIVATE
- "$<TARGET_NAME_IF_EXISTS:${MODULE}>"
- )
- endforeach()
-endfunction(pw_auto_add_module_tests)
-
# pw_target_link_targets: CMake target only form of target_link_libraries.
#
# Helper wrapper around target_link_libraries which only supports CMake targets