Skip to content

Commit af57648

Browse files
committed
fix #744
1 parent bb21236 commit af57648

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

toolchain/mfc/test/test.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
nFAIL = 0
2020
nPASS = 0
2121
nSKIP = 0
22+
errors = []
2223

2324
def __filter(cases_) -> typing.List[TestCase]:
2425
cases = cases_[:]
@@ -61,6 +62,7 @@ def __filter(cases_) -> typing.List[TestCase]:
6162
def test():
6263
# pylint: disable=global-statement, global-variable-not-assigned
6364
global nFAIL, nPASS, nSKIP
65+
global errors
6466

6567
cases = list_cases()
6668

@@ -125,6 +127,9 @@ def test():
125127
[ sched.Task(ppn=case.ppn, func=handle_case, args=[case], load=case.get_cell_count()) for case in cases ],
126128
ARG("jobs"), ARG("gpus"))
127129

130+
for e in errors:
131+
cons.print(e)
132+
128133
cons.print()
129134
cons.unindent()
130135
cons.print(f"\nTest Summary: [bold green]{nPASS}[/bold green] passed, [bold red]{nFAIL}[/bold red] failed, [bold yellow]{nSKIP}[/bold yellow] skipped.")
@@ -216,6 +221,7 @@ def _handle_case(case: TestCase, devices: typing.Set[int]):
216221
def handle_case(case: TestCase, devices: typing.Set[int]):
217222
# pylint: disable=global-statement, global-variable-not-assigned
218223
global nFAIL, nPASS, nSKIP
224+
global errors
219225

220226
nAttempts = 0
221227

@@ -228,9 +234,11 @@ def handle_case(case: TestCase, devices: typing.Set[int]):
228234
except Exception as exc:
229235
if nAttempts < ARG("max_attempts"):
230236
cons.print(f"[bold yellow] Attempt {nAttempts}: Failed test {case.get_uuid()}. Retrying...[/bold yellow]")
237+
errors.append(f"[bold yellow] Attempt {nAttempts}: Failed test {case.get_uuid()}. Retrying...[/bold yellow]")
231238
continue
232239
nFAIL += 1
233240
cons.print(f"[bold red]Failed test {case} after {nAttempts} attempt(s).[/bold red]")
234-
cons.print(f"{exc}")
241+
errors.append(f"[bold red]Failed test {case} after {nAttempts} attempt(s).[/bold red]")
242+
errors.append(f"{exc}")
235243

236244
return

0 commit comments

Comments
 (0)