Skip to content

Commit f32ccc2

Browse files
author
Yuanfang Chen
committed
[lit] fix a bug in 4cd1c96
Only report failure for tests that actually runs.
1 parent 1231a2c commit f32ccc2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/utils/lit/lit/formats/googletest.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,16 @@ def remove_gtest(tests):
228228
selected_tests = remove_gtest(selected_tests)
229229
has_failure = False
230230
for test in gtests:
231-
if test.isFailure():
232-
has_failure = True
233-
234-
# In case gtest has bugs such that no JSON file was emitted.
231+
# In case gtest has bugs such that no JSON file was emitted. Or, a selected
232+
# test is not found.
235233
if not os.path.exists(test.gtest_json_file):
236234
selected_tests.append(test)
237235
discovered_tests.append(test)
238236
continue
239237

238+
if test.isFailure():
239+
has_failure = True
240+
240241
start_time = test.result.start or 0.0
241242

242243
# Load json file to retrieve results.

0 commit comments

Comments
 (0)