A rust_test_suite(srcs=[]) should be empty. (#2966)

This can arise when srcs is a glob that currently matches no files.
The target may nevertheless be useful for regularity across libraries,
and to future-proof against newly-added test files being ignored.

Previously, we hit the special-case handling of `test_suite(tests=[])`:

> If the tests attribute is unspecified or empty, the rule will default
> to including all test rules in the current BUILD file that are not
> tagged as manual. These rules are still subject to tag filtering.

We can't directly turn this behavior off, so this patch uses tag
filtering to avoid including those default tests.
6 files changed
tree: 5885a324f7ea6dbaa501e2d72a577e3912cb20e1
  1. .bazelci/
  2. .bcr/
  3. .github/
  4. bindgen/
  5. cargo/
  6. crate_universe/
  7. docs/
  8. examples/
  9. ffi/
  10. nix/
  11. proto/
  12. rust/
  13. test/
  14. tools/
  15. util/
  16. wasm_bindgen/
  17. .bazelignore
  18. .bazelrc
  19. .bazelversion
  20. .clang-format
  21. .clippy.toml
  22. .envrc
  23. .gitattributes
  24. .gitignore
  25. .prettierrc.toml
  26. .rustfmt.toml
  27. ARCHITECTURE.md
  28. AUTHORS
  29. BUILD.bazel
  30. buildifier
  31. CODEOWNERS
  32. COMPATIBILITY.md
  33. CONTRIBUTING.md
  34. CONTRIBUTORS
  35. LICENSE.txt
  36. MODULE.bazel
  37. README.md
  38. version.bzl
  39. WORKSPACE.bazel
README.md

Rust Rules

  • Postsubmit Build status

Overview

This repository provides rules for building Rust projects with Bazel.

Community

General discussions and announcements take place in the GitHub Discussions, but there are additional places where community members gather to discuss rules_rust.

Documentation

Please refer to the full documentation.