[commit: ghc] wip/jenkins: Fix testsuite (9c5f6a8)

git at git.haskell.org git at git.haskell.org
Thu Jul 27 20:51:17 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/jenkins
Link       : http://ghc.haskell.org/trac/ghc/changeset/9c5f6a8fbaadf07d50dac2e2793a91e47f5b0314/ghc

>---------------------------------------------------------------

commit 9c5f6a8fbaadf07d50dac2e2793a91e47f5b0314
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Tue May 30 12:11:16 2017 -0400

    Fix testsuite


>---------------------------------------------------------------

9c5f6a8fbaadf07d50dac2e2793a91e47f5b0314
 Jenkinsfile | 64 ++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index c88b5ee..2e18d93 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -157,47 +157,47 @@ def buildGhc(params) {
   }
 }
 
+def withGhcBinDist(String targetTriple, Closure f) {
+  unstash "bindist-${targetTriple}"
+  def ghcVersion = readFile "ghc-version"
+  sh "tar -xf ${ghcVersion}-${targetTriple}.tar.xz"
+  dir("ghc-${ghcVersion}") { f }
+}
+
 def testGhc(params) {
   String targetTriple = params?.targetTriple
   String makeCmd = params?.makeCmd ?: 'make'
   boolean runNofib = params?.runNofib
 
-  stage('Extract binary distribution') {
-    sh "mkdir tmp"
-    dir "tmp"
-    unstash "bindist-${targetTriple}"
-    def ghcVersion = readFile "ghc-version"
-    sh "tar -xf ${ghcVersion}-${targetTriple}.tar.xz"
-    dir ghcVersion
-  }
-
-  stage('Install testsuite dependencies') {
-    if (params.nightly) {
-      def pkgs = ['mtl', 'parallel', 'parsec', 'primitive', 'QuickCheck',
-                  'random', 'regex-compat', 'syb', 'stm', 'utf8-string',
-                  'vector']
-      installPkgs pkgs
+  withGhcBinDist(targetTriple) {
+    stage('Install testsuite dependencies') {
+      if (params.nightly) {
+        def pkgs = ['mtl', 'parallel', 'parsec', 'primitive', 'QuickCheck',
+                    'random', 'regex-compat', 'syb', 'stm', 'utf8-string',
+                    'vector']
+        installPkgs pkgs
+      }
     }
-  }
 
-  stage('Run testsuite') {
-    def target = 'test'
-    if (params.nightly) {
-      target = 'slowtest'
+    stage('Run testsuite') {
+      def target = 'test'
+      if (params.nightly) {
+        target = 'slowtest'
+      }
+      sh "${makeCmd} THREADS=${env.THREADS} ${target}"
     }
-    sh "${makeCmd} THREADS=${env.THREADS} ${target}"
-  }
 
-  stage('Run nofib') {
-    if (runNofib) {
-      installPkgs(['regex-compat'])
-      sh """
-         cd nofib
-         ${makeCmd} clean
-         ${makeCmd} boot
-         ${makeCmd} >../nofib.log 2>&1
-         """
-      archiveArtifacts 'nofib.log'
+    stage('Run nofib') {
+      if (runNofib) {
+        installPkgs(['regex-compat'])
+        sh """
+          cd nofib
+          ${makeCmd} clean
+          ${makeCmd} boot
+          ${makeCmd} >../nofib.log 2>&1
+          """
+        archiveArtifacts 'nofib.log'
+      }
     }
   }
 }



More information about the ghc-commits mailing list