aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2019-04-11 19:30:39 -0500
committerEric Bavier <bavier@member.fsf.org>2019-04-11 19:34:01 -0500
commit89647ff1d4abc4674973392cb7e08d14898e3ac9 (patch)
tree4ca10651da077227172e51b78a7ff41514ffdb6a /gnu/packages/patches
parente16bc71015a2cc59f49e27720c0a93bc4188ed81 (diff)
downloadguix-89647ff1d4abc4674973392cb7e08d14898e3ac9.tar
guix-89647ff1d4abc4674973392cb7e08d14898e3ac9.tar.gz
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'.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/idris-test-no-node.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/gnu/packages/patches/idris-test-no-node.patch b/gnu/packages/patches/idris-test-no-node.patch
new file mode 100644
index 0000000000..c04ad41a8e
--- /dev/null
+++ b/gnu/packages/patches/idris-test-no-node.patch
@@ -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)
++