mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
gnu: idris: Run tests.
* gnu/packages/patches/idris-test-no-node.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/idris.scm (idris)[origin]: Use it. [native-inputs]: New field. [arguments]: Remove "#:tests? #f". Add custom 'check' phase after 'install'.
This commit is contained in:
parent
e16bc71015
commit
89647ff1d4
3 changed files with 81 additions and 4 deletions
|
@ -919,6 +919,7 @@ dist_patch_DATA = \
|
|||
%D%/packages/patches/icedtea-6-hotspot-gcc-segfault-workaround.patch \
|
||||
%D%/packages/patches/icedtea-7-hotspot-gcc-segfault-workaround.patch \
|
||||
%D%/packages/patches/id3lib-CVE-2007-4460.patch \
|
||||
%D%/packages/patches/idris-test-no-node.patch \
|
||||
%D%/packages/patches/ilmbase-fix-tests.patch \
|
||||
%D%/packages/patches/inkscape-poppler-compat3.patch \
|
||||
%D%/packages/patches/intltool-perl-compatibility.patch \
|
||||
|
|
|
@ -20,12 +20,14 @@
|
|||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (gnu packages idris)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages haskell)
|
||||
#:use-module (gnu packages haskell-check)
|
||||
#:use-module (gnu packages haskell-web)
|
||||
#:use-module (gnu packages libffi)
|
||||
#:use-module (gnu packages multiprecision)
|
||||
#:use-module (gnu packages ncurses)
|
||||
#:use-module (gnu packages perl)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix build-system haskell)
|
||||
#:use-module (guix download)
|
||||
|
@ -44,8 +46,14 @@ (define-public idris
|
|||
"idris-" version "/idris-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0fn9h58l592j72njwma1ia48h8h87wi2rjqfxs7j2lfmvgfv18fi"))))
|
||||
"0fn9h58l592j72njwma1ia48h8h87wi2rjqfxs7j2lfmvgfv18fi"))
|
||||
(patches (search-patches "idris-test-no-node.patch"))))
|
||||
(build-system haskell-build-system)
|
||||
(native-inputs ;For tests
|
||||
`(("perl" ,perl)
|
||||
("ghc-tasty" ,ghc-tasty)
|
||||
("ghc-tasty-golden" ,ghc-tasty-golden)
|
||||
("ghc-tasty-rerun" ,ghc-tasty-rerun)))
|
||||
(inputs
|
||||
`(("gmp" ,gmp)
|
||||
("ncurses" ,ncurses)
|
||||
|
@ -78,8 +86,7 @@ (define-public idris
|
|||
("ghc-vector-binary-instances" ,ghc-vector-binary-instances)
|
||||
("ghc-zip-archive" ,ghc-zip-archive)))
|
||||
(arguments
|
||||
`(#:tests? #f ; FIXME: Test suite doesn't run in a sandbox.
|
||||
#:configure-flags
|
||||
`(#:configure-flags
|
||||
(list (string-append "--datasubdir="
|
||||
(assoc-ref %outputs "out") "/lib/idris")
|
||||
"-fFFI" "-fGMP")
|
||||
|
@ -98,7 +105,15 @@ (define-public idris
|
|||
(lambda (module)
|
||||
(symlink (string-append modules "/" module)
|
||||
(string-append lib "/" module)))
|
||||
'("prelude" "base" "contrib" "effects" "pruviloj"))))))))
|
||||
'("prelude" "base" "contrib" "effects" "pruviloj")))))
|
||||
(delete 'check) ;Run check later
|
||||
(add-after 'install 'check
|
||||
(lambda* (#:key outputs #:allow-other-keys #:rest args)
|
||||
(let ((out (assoc-ref outputs "out")))
|
||||
(setenv "TASTY_NUM_THREADS" (number->string (parallel-job-count)))
|
||||
(setenv "IDRIS_CC" "gcc") ;Needed for creating executables
|
||||
(setenv "PATH" (string-append out "/bin:" (getenv "PATH")))
|
||||
(apply (assoc-ref %standard-phases 'check) args)))))))
|
||||
(native-search-paths
|
||||
(list (search-path-specification
|
||||
(variable "IDRIS_LIBRARY_PATH")
|
||||
|
|
61
gnu/packages/patches/idris-test-no-node.patch
Normal file
61
gnu/packages/patches/idris-test-no-node.patch
Normal file
|
@ -0,0 +1,61 @@
|
|||
From 6c52e1b902b869c25e2fe39cff6364143a04da61 Mon Sep 17 00:00:00 2001
|
||||
From: Niklas Larsson <niklas@mm.st>
|
||||
Date: Tue, 11 Dec 2018 19:56:22 +0100
|
||||
Subject: [PATCH] Only check for Node when required
|
||||
|
||||
---
|
||||
test/TestRun.hs | 34 ++++++++++++++++++++--------------
|
||||
1 file changed, 20 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/test/TestRun.hs b/test/TestRun.hs
|
||||
index c7db9fdcd..4809911f3 100644
|
||||
--- a/test/TestRun.hs
|
||||
+++ b/test/TestRun.hs
|
||||
@@ -11,6 +11,7 @@ import Data.Proxy
|
||||
import Data.Typeable
|
||||
import Options.Applicative
|
||||
import System.Directory
|
||||
+import System.Environment
|
||||
import System.Exit
|
||||
import System.FilePath ((</>))
|
||||
import System.Info
|
||||
@@ -103,20 +104,25 @@ runTest path flags = do
|
||||
normalise (x : xs) = x : normalise xs
|
||||
normalise [] = []
|
||||
|
||||
+checkNode :: IO ()
|
||||
+checkNode = do
|
||||
+ nodePath <- findExecutable "node"
|
||||
+ nodejsPath <- findExecutable "nodejs"
|
||||
+ let node = nodePath <|> nodejsPath
|
||||
+ case node of
|
||||
+ Nothing -> do
|
||||
+ putStrLn "For running the test suite against Node, node must be installed."
|
||||
+ exitFailure
|
||||
+ Just _ -> return ()
|
||||
+
|
||||
main :: IO ()
|
||||
main = do
|
||||
- nodePath <- findExecutable "node"
|
||||
- nodejsPath <- findExecutable "nodejs"
|
||||
- let node = nodePath <|> nodejsPath
|
||||
- case node of
|
||||
- Nothing -> do
|
||||
- putStrLn "For running the test suite against Node, node must be installed."
|
||||
- exitFailure
|
||||
- Just _ -> do
|
||||
- defaultMainWithIngredients ingredients $
|
||||
+ args <- getArgs
|
||||
+ when ("--node" `elem` args) checkNode
|
||||
+ defaultMainWithIngredients ingredients $
|
||||
askOption $ \(NodeOpt node) ->
|
||||
- let (codegen, flags) = if node then (JS, ["--codegen", "node"])
|
||||
- else (C , [])
|
||||
- in
|
||||
- mkGoldenTests (testFamiliesForCodegen codegen)
|
||||
- (flags ++ idrisFlags)
|
||||
+ let (codegen, flags) = if node then (JS, ["--codegen", "node"])
|
||||
+ else (C , [])
|
||||
+ in
|
||||
+ mkGoldenTests (testFamiliesForCodegen codegen) (flags ++ idrisFlags)
|
||||
+
|
Loading…
Reference in a new issue