mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:21:21 +01:00
Refactor lit testing to generate per-file tests. (#1063)
This switches to generating per-file targets such as `//executable_semantics/testdata:tuple/equality_false.carbon.test`, instead of one test covering all files. Essentially this relies on bazel instead of lit to handle test parallelization.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
# Exceptions. See /LICENSE for license information.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
load("//bazel/testing:lit_test.bzl", "lit_test")
|
||||
load("@mypy_integration//:mypy.bzl", "mypy_test")
|
||||
|
||||
package(default_visibility = [
|
||||
@@ -23,16 +22,6 @@ cc_binary(
|
||||
],
|
||||
)
|
||||
|
||||
lit_test(
|
||||
name = "executable_semantics_lit_test",
|
||||
data = [
|
||||
":executable_semantics",
|
||||
"@llvm-project//llvm:FileCheck",
|
||||
"@llvm-project//llvm:not",
|
||||
],
|
||||
test_dir = "testdata",
|
||||
)
|
||||
|
||||
py_binary(
|
||||
name = "gen_rtti",
|
||||
srcs = ["gen_rtti.py"],
|
||||
|
||||
@@ -111,11 +111,7 @@ To explain this boilerplate:
|
||||
### Useful commands
|
||||
|
||||
- `./update_checks.py` -- Updates expected output.
|
||||
- `bazel test :executable_semantics_lit_test --test_output=errors` -- Runs
|
||||
tests and prints any errors.
|
||||
- `bazel test :executable_semantics_lit_test --test_output=errors --test_arg=--filter=basic_syntax/.*`
|
||||
-- Only runs tests in the `basic_syntax` directory; `--filter` is a regular
|
||||
expression.
|
||||
- `bazel test ... --test_output=errors` -- Runs tests and prints any errors.
|
||||
|
||||
## Experimental feature: Delimited Continuations
|
||||
|
||||
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
# Exceptions. See /LICENSE for license information.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
load("//bazel/testing:lit.bzl", "glob_lit_tests")
|
||||
|
||||
glob_lit_tests(
|
||||
data = [
|
||||
"//executable_semantics",
|
||||
"@llvm-project//llvm:FileCheck",
|
||||
"@llvm-project//llvm:not",
|
||||
],
|
||||
driver = "lit.cfg.py",
|
||||
test_file_exts = ["carbon"],
|
||||
)
|
||||
@@ -29,7 +29,7 @@ def _get_tests() -> Set[str]:
|
||||
tests = set()
|
||||
for root, _, files in os.walk(_TESTDATA):
|
||||
for f in files:
|
||||
if f == "lit.cfg.py":
|
||||
if f in {"lit.cfg.py", "BUILD"}:
|
||||
# Ignore the lit config.
|
||||
continue
|
||||
if os.path.splitext(f)[1] == ".carbon":
|
||||
|
||||
Reference in New Issue
Block a user