Skip to content

Commit

Permalink
[Hexagon] Expose gtest output through runtime exception (#12502)
Browse files Browse the repository at this point in the history
Expose Hexagon gtest output in CI by raising it as a runtime exception rather than printing it to stdout.
  • Loading branch information
adstraw authored Aug 30, 2022
1 parent d421e32 commit 1c32798
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/python/contrib/test_hexagon/test_run_unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

""" capture gtest output and return over FFI """

import numpy as np

import tvm
from tvm.contrib.hexagon.session import Session

Expand Down Expand Up @@ -46,4 +44,7 @@ def test_run_unit_tests(hexagon_session: Session, gtest_args):
gtest_error_code = int(gtest_error_code_and_output.splitlines()[0])
gtest_output = gtest_error_code_and_output.split("\n", 1)[-1]
print(gtest_output)
np.testing.assert_equal(gtest_error_code, 0)
if gtest_error_code != 0:
raise RuntimeError(
f"Hexagon gtest retruned non-zero error code = {gtest_error_code}:\n{gtest_output}"
)

0 comments on commit 1c32798

Please sign in to comment.