1+ # SPDX-License-Identifier: BSD-3-Clause
2+ # Copyright (c) 2025-2025, The OpenROAD Authors
3+
14"""Instantiate a regression test based on .py or .tcl
25files using resources in //test:regression_resources"""
36
@@ -12,11 +15,17 @@ def _pop(kwargs, key, default):
1215def regression_test (
1316 name ,
1417 ** kwargs ):
15- test_files = native .glob ([name + "." + ext for ext in [
16- # TODO once Python is supported, add the .py files to the
17- # "py",
18- "tcl" ,
19- ]])
18+ # TODO: we should _not_ have the magic to figure out if tcl or py exists
19+ # in here but rather in the BUILD file and just pass the resulting
20+ # name = "foo-tcl", test_file = "foo.tcl" to this regression test macro.
21+ test_files = native .glob (
22+ [name + "." + ext for ext in [
23+ # TODO once Python is supported, add the .py files to the
24+ # "py",
25+ "tcl" ,
26+ ]],
27+ allow_empty = True , # Allow to be empty; see also TODO above.
28+ )
2029 for test_file in test_files :
2130 ext = test_file .split ("." )[- 1 ]
2231 native .sh_test (
@@ -27,7 +36,6 @@ def regression_test(
2736 #
2837 # https://bazel.build/reference/be/common-definitions#test.size
2938 size = _pop (kwargs , "size" , "small" ),
30- timeout = _pop (kwargs , "timeout" , "moderate" ),
3139 srcs = ["//test:bazel_test.sh" ],
3240 args = [],
3341 data = [
0 commit comments