[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: gnu: ghc-8.6: Fix tests by patch
From: |
guix-commits |
Subject: |
01/01: gnu: ghc-8.6: Fix tests by patch |
Date: |
Thu, 25 Jul 2019 05:36:26 -0400 (EDT) |
rob pushed a commit to branch wip-haskell-updates
in repository guix.
commit 9aa27012701ade0a79a2d081cd97620f8d3b8b1c
Author: Robert Vollmert <address@hidden>
Date: Thu Jul 25 11:33:20 2019 +0200
gnu: ghc-8.6: Fix tests by patch
The previous substitute*-based patching was based on
misunderstanding the test library.
* gnu/packages/patches/ghc-8.6.5-skip-tests.patch: New patch.
* gnu/local.mk: Add it.
* gnu/packages/haskell.scm (ghc-8.6): Skip tests via patch.
---
gnu/local.mk | 1 +
gnu/packages/haskell.scm | 22 +---
gnu/packages/patches/ghc-8.6.5-skip-tests.patch | 128 ++++++++++++++++++++++++
3 files changed, 133 insertions(+), 18 deletions(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index c2b6f14..28aa960 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -849,6 +849,7 @@ dist_patch_DATA =
\
%D%/packages/patches/gdm-CVE-2018-14424.patch \
%D%/packages/patches/geoclue-config.patch \
%D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \
+ %D%/packages/patches/ghc-8.6.5-skip-tests.patch \
%D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch
\
%D%/packages/patches/ghc-haddock-library-unbundle.patch \
%D%/packages/patches/ghostscript-no-header-id.patch \
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index b2e8941..d832a28 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -589,6 +589,8 @@ interactive environment for the functional language
Haskell.")
("ghostscript" ,ghostscript) ; for tests
;; GHC 8.6.5 must be built with GHC >= 8.2.
("ghc-bootstrap" ,ghc-8.4)
+ ;; test patch must be applied after unpacking test suite
+ ("ghc-tests-patch" ,(car (search-patches "ghc-8.6.5-skip-tests.patch")))
("ghc-testsuite"
,(origin
(method url-fetch)
@@ -637,24 +639,8 @@ interactive environment for the functional language
Haskell.")
"--strip-components=1")
#t))
(add-after 'unpack-testsuite 'skip-tests
- (lambda _
- (define (modify-test file-name test-name modifier)
- (let ((pattern (string-append "^test\\('" test-name "',"))
- (replace (string-append "test('" test-name "', " modifier
",")))
- (substitute* file-name ((pattern) replace))))
-
- ;; These two tests refer to the root user, which doesn't exist.
- (modify-test "libraries/unix/tests/all.T" "T8108" "expect_fail")
- (modify-test "libraries/unix/tests/libposix/all.T" "posix010"
"expect_fail")
-
- ;; Several unexpected stat test failures, mark fragile
- (modify-test "testsuite/tests/perf/compiler/all.T" "T5631"
"fragile(-1)")
- (modify-test "testsuite/tests/perf/compiler/all.T" "parsing001"
"fragile(-1)")
- (modify-test "testsuite/tests/perf/haddock/all.T" "haddock.base"
"fragile(-1)")
- (modify-test "testsuite/tests/perf/haddock/all.T" "haddock.Cabal"
"fragile(-1)")
- (modify-test "testsuite/tests/perf/should_run/all.T" "T9203"
"fragile(-1)")
-
- #t))
+ (lambda* (#:key inputs #:allow-other-keys)
+ (invoke "patch" "-p1" (assoc-ref inputs "ghc-tests-patch"))))
;; This phase patches the 'ghc-pkg' command so that it sorts the list
;; of packages in the binary cache it generates.
(add-before 'build 'fix-ghc-pkg-nondeterminism
diff --git a/gnu/packages/patches/ghc-8.6.5-skip-tests.patch
b/gnu/packages/patches/ghc-8.6.5-skip-tests.patch
new file mode 100644
index 0000000..d93e5e0
--- /dev/null
+++ b/gnu/packages/patches/ghc-8.6.5-skip-tests.patch
@@ -0,0 +1,128 @@
+diff -ur a/ghc-8.6.5/libraries/unix/tests/all.T
b/ghc-8.6.5/libraries/unix/tests/all.T
+--- a/ghc-8.6.5/libraries/unix/tests/all.T 2019-07-25 10:33:26.860000000
+0200
++++ b/ghc-8.6.5/libraries/unix/tests/all.T 2019-07-25 10:38:49.348000000
+0200
+@@ -71,4 +71,4 @@
+ test('processGroup002', normal, compile_and_run, ['-package unix'])
+ test('executeFile001', omit_ways(prof_ways), compile_and_run, ['-package
unix'])
+
+-test('T8108', normal, compile_and_run, ['-package unix'])
++test('T8108', skip, compile_and_run, ['-package unix'])
+diff -ur a/ghc-8.6.5/libraries/unix/tests/libposix/all.T
b/ghc-8.6.5/libraries/unix/tests/libposix/all.T
+--- a/ghc-8.6.5/libraries/unix/tests/libposix/all.T 2019-07-25
10:33:26.856000000 +0200
++++ b/ghc-8.6.5/libraries/unix/tests/libposix/all.T 2019-07-25
10:39:15.292000000 +0200
+@@ -11,6 +11,6 @@
+
+ test('posix006', reqlib('unix'), compile_and_run, [''])
+ test('posix009', [ omit_ways(threaded_ways), reqlib('unix') ],
compile_and_run, [''])
+-test('posix010', reqlib('unix'), compile_and_run, [''])
++test('posix010', [ skip, reqlib('unix') ], compile_and_run, [''])
+
+ test('posix014', [ reqlib('unix') ], compile_and_run, [''])
+diff -ur a/ghc-8.6.5/testsuite/tests/perf/compiler/all.T
b/ghc-8.6.5/testsuite/tests/perf/compiler/all.T
+--- a/ghc-8.6.5/testsuite/tests/perf/compiler/all.T 2019-07-25
10:33:31.052000000 +0200
++++ b/ghc-8.6.5/testsuite/tests/perf/compiler/all.T 2019-07-25
10:42:03.368000000 +0200
+@@ -28,7 +28,8 @@
+ # really changed, then you know there's an issue.
+
+ test('T1969',
+- [# expect_broken(12437),
++ [skip,
++ # expect_broken(12437),
+ compiler_stats_num_field('peak_megabytes_allocated', # Note [residency]
+ [(wordsize(32), 30, 15),
+ # 2010-05-17 14 (x86/Windows)
+@@ -157,7 +158,7 @@
+ conf_3294 = skip
+
+ test('T3294',
+- [
++ [skip,
+ compiler_stats_num_field('max_bytes_used', # Note [residency]
+ [(wordsize(32), 28686588, 15),
+ # 17725476 (x86/OS X)
+@@ -405,7 +406,8 @@
+ ['$MAKE -s --no-print-directory T4007'])
+
+ test('T5030',
+- [compiler_stats_num_field('bytes allocated',
++ [skip,
++ compiler_stats_num_field('bytes allocated',
+ [(wordsize(32), 345668088, 10),
+ # previous: 196457520
+ # 2012-10-08: 259547660 (x86/Linux, new codegen)
+@@ -443,7 +445,8 @@
+ ['-freduction-depth=300'])
+
+ test('T5631',
+- [compiler_stats_num_field('bytes allocated',
++ [skip,
++ compiler_stats_num_field('bytes allocated',
+ [(wordsize(32), 570137436, 10),
+ # expected value: 392904228 (x86/Linux)
+ # 2014-04-04: 346389856 (x86 Windows, 64 bit machine)
+@@ -473,7 +476,8 @@
+ [''])
+
+ test('parsing001',
+- [compiler_stats_num_field('bytes allocated',
++ [skip,
++ compiler_stats_num_field('bytes allocated',
+ [(wordsize(32), 232777056, 10),
+ # Initial: 274000576
+ # 2017-03-24: 232777056
+diff -ur a/ghc-8.6.5/testsuite/tests/perf/haddock/all.T
b/ghc-8.6.5/testsuite/tests/perf/haddock/all.T
+--- a/ghc-8.6.5/testsuite/tests/perf/haddock/all.T 2019-07-25
10:33:31.020000000 +0200
++++ b/ghc-8.6.5/testsuite/tests/perf/haddock/all.T 2019-07-25
10:37:18.656000000 +0200
+@@ -3,7 +3,8 @@
+ # detect outliers, as described in Note [residency]. See #9556.
+
+ test('haddock.base',
+- [extra_files(['../../../../libraries/base/dist-install/haddock.t']),
++ [skip,
++ extra_files(['../../../../libraries/base/dist-install/haddock.t']),
+ unless(in_tree_compiler(), skip), req_haddock
+ ,stats_num_field('bytes allocated',
+ [(platform('x86_64-unknown-mingw32'), 18733710728, 5)
+@@ -76,7 +77,8 @@
+ ['haddock.t'])
+
+ test('haddock.Cabal',
+-
[extra_files(['../../../../libraries/Cabal/Cabal/dist-install/haddock.t']),
++ [skip,
++
extra_files(['../../../../libraries/Cabal/Cabal/dist-install/haddock.t']),
+ unless(in_tree_compiler(), skip), req_haddock
+ ,stats_num_field('bytes allocated',
+ [(wordsize(64), 27520214496, 5)
+diff -ur a/ghc-8.6.5/testsuite/tests/perf/should_run/all.T
b/ghc-8.6.5/testsuite/tests/perf/should_run/all.T
+--- a/ghc-8.6.5/testsuite/tests/perf/should_run/all.T 2019-07-25
10:33:31.032000000 +0200
++++ b/ghc-8.6.5/testsuite/tests/perf/should_run/all.T 2019-07-25
10:43:01.892000000 +0200
+@@ -32,7 +32,8 @@
+ ['-O'])
+
+ test('T14955',
+- [stats_num_field('bytes allocated',
++ [skip,
++ stats_num_field('bytes allocated',
+ [(wordsize(64), 48050760, 5),
+ (wordsize(32), 351508, 5)]),
+ only_ways(['normal'])
+@@ -380,7 +381,8 @@
+ ['-O'])
+
+ test('T7954',
+- [stats_num_field('bytes allocated',
++ [skip,
++ stats_num_field('bytes allocated',
+ [(wordsize(32), 920045264, 10),
+ # some date: 1380051408 (64-bit Windows machine)
+ # 2014-04-04: 920045264 (64-bit Windows machine)
+@@ -459,7 +461,8 @@
+ ['-O2'])
+
+ test('T9203',
+- [stats_num_field('bytes allocated',
++ [skip,
++ stats_num_field('bytes allocated',
+ [ (wordsize(32), 77969268, 5)
+ # was
+ # 2016-04-06 84345136 (i386/Debian) not sure