* Enable unittest.suite to accept partial calls of rules
This permits using `unittest.suite` with test rules that have nondefault
attributes, while retaining compatibility with current usage.
For instance, this permits setting a `timeout` on each test in a
`unittest.suite`. Previously, all tests in a `unittest.suite` would
have the default timeout, with no good way to alter this. This
made it hard to eliminate all the warnings produced from using the
`--test_verbose_timeout_warnings` bazel option.
While timeouts were the motivation, the solution here is not specific
to timeouts. It will permit arbitrary additional arguments to the test
rules in a `unittest.suite`.
Fixes #98
* Respond to review feedback.
* Document a breaking change in bazel that this code needs to be aware of.
In this commit:
- change unittest.bzl to declare a named output
file instead of relying on the deprecated [1]
default output name (ctx.outputs.executable).
- define a new toolchain_type and toolchain rules
for cmd.exe and for Bash (basically Windows and
non-Windows)
- register the new toolchains in workspace.bzl
- let unittest.make-created test rules require the
new toolchain_type
- write the test output script as a Windows batch
script or as a Shell script, depending on the
selected toolchain
This PR enables the Bazel team to break the Bash
dependency (for test execution) on Windows, and
can run Starlark unittests with the new,
Windows-native test wrapper (still under
development).
See https://github.com/bazelbuild/bazel/issues/5508
As more things are added, lib.bzl is an anti-pattern as the cost of loading
it actually just keeps increasing and most things will never use everything
out of it. The pattern the should be used is to directly import the modules
one uses.
Buildifier 0.12.0 includes initial support for reformatting .bzl files.
- Reformat all the bzl files.
- Expand the travis check to check the .bzl files also.