diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2020-04-07 12:06:32 +0300 |
---|---|---|
committer | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2020-04-10 09:18:14 +0300 |
commit | 723062edf6191084a99787d3f235183cf6b7d051 (patch) | |
tree | 9502c2868b2d71cb500ba3968eb5d11f05915e06 | |
parent | 75a185dc2a648ab1f592d401daa5efcacb451c83 (diff) | |
download | haskell-723062edf6191084a99787d3f235183cf6b7d051.tar.gz |
testsuite: Move no_lint to the top level, tweak hie002
- We don't want to benchmark linting so disable lints in hie002 perf
test
- Move no_lint to the top-level to be able to use it in tests other than
those in `testsuite/tests/perf/compiler`.
- Filter out -dstg-lint in no_lint.
- hie002 allocation numbers on 32-bit are unstable, so skip it on 32-bit
Metric Decrease:
hie002
ManyConstructors
T12150
T12234
T13035
T1969
T4801
T9233
T9961
-rw-r--r-- | testsuite/driver/testlib.py | 6 | ||||
-rw-r--r-- | testsuite/tests/hiefile/should_compile/all.T | 10 | ||||
-rw-r--r-- | testsuite/tests/perf/compiler/all.T | 5 |
3 files changed, 14 insertions, 7 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 5c7a1bd8d7..535e31e110 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -116,6 +116,12 @@ def expect_fail( name, opts ): # future. opts.expect = 'fail'; +def no_lint( name, opts ): + """Disable Core, STG and Cmm lints. Useful when testing compiler perf.""" + opts.compiler_always_flags = \ + [opt for opt in opts.compiler_always_flags \ + if opt not in ['-dcore-lint', '-dstg-lint', '-dcmm-lint']] + def reqlib( lib ): return lambda name, opts, l=lib: _reqlib (name, opts, l ) diff --git a/testsuite/tests/hiefile/should_compile/all.T b/testsuite/tests/hiefile/should_compile/all.T index fe0d6d74eb..a98a042ca0 100644 --- a/testsuite/tests/hiefile/should_compile/all.T +++ b/testsuite/tests/hiefile/should_compile/all.T @@ -1,6 +1,12 @@ test('hie001', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) -test('hie002', collect_compiler_stats('bytes allocated',10), - compile, ['-fno-code -fwrite-ide-info']) +test('hie002', + [# Allocation numbers unstable on 32-bit, skip: + when(wordsize(32), skip), + # No linting in perf tests: + no_lint, + collect_compiler_stats('bytes allocated',10)], + compile, + ['-fno-code -fwrite-ide-info']) test('hie003', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) test('hie004', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) test('hie005', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 15f351a51b..5a865fdd14 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -1,10 +1,5 @@ # Tests that call 'collect_compiler_stats' are skipped when debugging is on. # See testsuite/driver/testlib.py. - -def no_lint(name, opts): - opts.compiler_always_flags = \ - [opt for opt in opts.compiler_always_flags if opt != '-dcore-lint' and opt != '-dcmm-lint'] - setTestOpts(no_lint) test('T1969', |