Skip to content

Commit 0e554eb

Browse files
author
Yuanfang Chen
committed
[lit][unit] set the default result start and pid
In case of interrupting, there were None. Fixes PR55176.
1 parent fa49021 commit 0e554eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def remove_gtest(tests):
224224
discovered_tests.append(test)
225225
continue
226226

227-
start_time = test.result.start
227+
start_time = test.result.start or 0.0
228228

229229
# Load json file to retrieve results.
230230
with open(test.gtest_json_file, encoding='utf-8') as f:
@@ -260,7 +260,7 @@ def remove_gtest(tests):
260260

261261
elapsed_time = float(testinfo['time'][:-1])
262262
res = lit.Test.Result(returnCode, output, elapsed_time)
263-
res.pid = test.result.pid
263+
res.pid = test.result.pid or 0
264264
res.start = start_time
265265
start_time = start_time + elapsed_time
266266
subtest.setResult(res)

0 commit comments

Comments
 (0)