Skip to content

Commit da175e9

Browse files
rw1nklerQuantamHD
authored andcommitted
Correctly propagate failures in cocotb_test rule
The previous rule implementation did not check whether the test passed or failed in the cocotb runner. The additional check introduced in this commit allows the script to inform Bazel about the actual test results. Internal-tag: [#46586] Signed-off-by: Robert Winkler <[email protected]>
1 parent e9bfe5b commit da175e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cocotb/cocotb_wrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
import argparse
16-
from cocotb.runner import get_runner
16+
from cocotb.runner import get_runner, check_results_file
1717

1818

1919
cocotb_build_flags = [
@@ -167,6 +167,6 @@ def __call__(self, parser, namespace, values, option_string=None):
167167
test_flags = filter_args(vars(args), cocotb_test_flags)
168168

169169
runner = get_runner(args.sim)
170-
171170
runner.build(**build_flags)
172-
runner.test(**test_flags),
171+
results_xml = runner.test(**test_flags)
172+
check_results_file(results_xml)

0 commit comments

Comments
 (0)