bazel tests: delete TestMode and other test junk

The only differences in the test modes, BUILD and SKYLARK, were:
- the name of the Mutability, which is insignificant.
- whether "BUILD dialect checks", such as no def, no f(**kwargs),
  are applied. These are moved from syntax.EvaluationTest to packages.PackageFactoryTest.
- whether validation errors were reported as events or a thrown exception.
  Now it's always an exception.
- whether the validator gets the 'isBuildFile' flag.
  This affects a small (and diminishing) set of things,
  which should be checked directly.

The ModalTestCase hierarchy (base, BUILD only, Skylark only, both modes)
has been flattened into a single class, Scenario.

EvaluationTestCase:
- newStarlarkThreadWithSkylarkOptions is now setSemantics (stateful)
- inline the code formerly in TestMode and simplify newStarlarkThread et al.
- make bad dependencies on build-base explicit. (They are revealed, but not new.)
- hide fields
- simplify exec().

SkylarkEvaluationTest:
- break "extends EvaluationTest" edge:
  There's no need to duplicate the whole suite for both modes;
  nearly every test was independent of mode (and one suspects most
  were added with no knowledge of the intended design).
- move tests of FlagGuardedValue into StarlarkFlagGuardingTest.
  (They were the only tests to use the 'builtins' parameter, now removed.)
PiperOrigin-RevId: 294451364
13 files changed
tree: 6ac9db024ff4ddf336f9a517c875a213fcd8f388
  1. .bazelci/
  2. examples/
  3. scripts/
  4. site/
  5. src/
  6. third_party/
  7. tools/
  8. .bazelrc
  9. .gitattributes
  10. .gitignore
  11. AUTHORS
  12. BUILD
  13. CHANGELOG.md
  14. CODEOWNERS
  15. combine_distfiles.py
  16. combine_distfiles_to_tar.sh
  17. compile.sh
  18. CONTRIBUTING.md
  19. CONTRIBUTORS
  20. distdir.bzl
  21. ISSUE_TEMPLATE.md
  22. LICENSE
  23. README.md
  24. WORKSPACE
README.md

Bazel

{Fast, Correct} - Choose two

Build and test software of any size, quickly and reliably.

  • Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.

  • One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.

  • Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.

  • Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.

Getting Started

Documentation

Contributing to Bazel

See CONTRIBUTING.md

Build status