Skip to content

Commit fdf2cf8

Browse files
committed
[UR][Tests] Print all CTS outputs (from gtest) in CI
1 parent 7c8617b commit fdf2cf8

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

test/conformance/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ In the future, when all bugs are fixed, and the tests pass,
88
this solution will no longer be necessary.
99
When you fix any test, the match file must be updated
1010
Empty match files indicate that there are no failing tests
11-
in a particular group for the corresponding adapter.
11+
in a particular group for the corresponding adapter.

test/conformance/cts_exe.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
88
99
"""
10+
# Printing conformance test output from gtest and checking failed tests with match files.
11+
# The match files contain tests that are expected to fail.
1012

1113
import sys
1214
from argparse import ArgumentParser
@@ -18,18 +20,24 @@
1820

1921
parser = ArgumentParser()
2022
parser.add_argument("--test_command", help="Ctest test case")
21-
2223
args = parser.parse_args()
24+
2325
result = subprocess.Popen([args.test_command, '--gtest_brief=1'], stdout = subprocess.PIPE, text = True) # nosec B603
2426

2527
pat = re.compile(r'\[( )*FAILED( )*\]')
26-
for line in result.stdout.readlines():
28+
output_list = []
29+
for line in result.stdout:
30+
output_list.append(line)
2731
if pat.search(line):
2832
test_case = line.split(" ")[5]
2933
test_case = test_case.rstrip(',')
3034
print(test_case)
3135

32-
result.communicate()
33-
rc = result.returncode
36+
rc = result.wait()
3437
if rc < 0:
35-
print(signal.strsignal(abs(result.returncode)))
38+
print(signal.strsignal(abs(rc)))
39+
40+
print("#### GTEST_OUTPUT ####", file=sys.stderr)
41+
for output in output_list:
42+
print(output, file=sys.stderr)
43+
print("#### GTEST_OUTPUT_END ####", file=sys.stderr)

0 commit comments

Comments
 (0)