diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-03-22 12:31:16 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-03-24 23:44:20 -0400 |
commit | 0b0c1d760bd4d2370a82b672accdb025a3f09fbd (patch) | |
tree | dfca72350ad5c09656f3d15e28c7f86098e6c67b | |
parent | 0507840b9d31c7707484dc8c0670b4f2029ad558 (diff) | |
download | haskell-wip/testsuite-fixes.tar.gz |
testsuite: Check test stats only after test correctnesswip/testsuite-fixes
Ticket #19576 noted that a test that failed in correctness (e.g. due to
stderr mismatch) *and* failed due to a metrics change would report
misleading stats. This was due to the testsuite driver *first* checking
stats, before checking for correctness. Fix this.
Closes #19576.
-rw-r--r-- | testsuite/driver/testlib.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index b0a19329cb..caa1bb1ed0 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1626,11 +1626,6 @@ def simple_build(name: Union[TestName, str], # ToDo: if the sub-shell was killed by ^C, then exit - if isCompilerStatsTest(): - statsResult = check_stats(TestName(name), way, in_testdir(stats_file), opts.stats_range_fields) - if badResult(statsResult): - return statsResult - if should_fail: if exit_code == 0: stderr_contents = actual_stderr_path.read_text(encoding='UTF-8', errors='replace') @@ -1640,6 +1635,11 @@ def simple_build(name: Union[TestName, str], stderr_contents = actual_stderr_path.read_text(encoding='UTF-8', errors='replace') return failBecause('exit code non-0', stderr=stderr_contents) + if isCompilerStatsTest(): + statsResult = check_stats(TestName(name), way, in_testdir(stats_file), opts.stats_range_fields) + if badResult(statsResult): + return statsResult + return passed() # ----------------------------------------------------------------------------- |