[Git][ghc/ghc][master] testsuite: Move no_lint to the top level, tweak hie002

Marge Bot gitlab at gitlab.haskell.org
Fri Apr 10 23:29:03 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
723062ed by Ömer Sinan Ağacan at 2020-04-10T09:18:14+03:00
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

- - - - -


3 changed files:

- testsuite/driver/testlib.py
- testsuite/tests/hiefile/should_compile/all.T
- testsuite/tests/perf/compiler/all.T


Changes:

=====================================
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 )
 


=====================================
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'])


=====================================
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',



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/723062edf6191084a99787d3f235183cf6b7d051

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/723062edf6191084a99787d3f235183cf6b7d051
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200410/53ae673c/attachment-0001.html>


More information about the ghc-commits mailing list