Skip to content

Commit

Permalink
tests: Also save files if tests has failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Wallbraker committed Sep 4, 2019
1 parent 627a853 commit d8a99a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/deqp/tests/info.volt
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,14 @@ fn printResultsToStdout(ref opts: PrintOptions, suites: Suite[])
}
}

fn printResultFromGroup(ref opts: PrintOptions, suite: Suite, tests: Test[], retval: i32, start: u32, end: u32, time: string)
fn printResultFromGroup(ref opts: PrintOptions, suite: Suite, tests: Test[],
retval: i32, hasFailedTests: bool,
start: u32, end: u32, time: string)
{
if (!opts.groups) {
return;
}

hasFailedTests: bool;
foreach (test; tests) {
hasFailedTests |= test.hasFailed();
}

if (retval != 0) {
prefix := opts.getExclamation();

Expand Down
10 changes: 8 additions & 2 deletions src/deqp/tests/runner.volt
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,17 @@ private:
ms := watt.convClockFreq(timeStop - timeStart, watt.ticksPerSecond, 1000);
time := watt.format(" (%s.%03ss)", ms / 1000, ms % 1000);

hasFailedTests: bool;
foreach (test; tests) {
hasFailedTests |= test.hasFailed();
}

printResultFromGroup(ref opts, suite, tests, retval, start, end, time);
printResultFromGroup(ref opts, suite, tests,
retval, hasFailedTests,
start, end, time);

// If the test run didn't complete.
if (retval != 0) {
if (retval != 0 || hasFailedTests) {
// Write out the tests to a file, for debugging.
writeTestsToFile();

Expand Down

0 comments on commit d8a99a9

Please sign in to comment.