@@ -11,6 +11,7 @@ import Data.Proxy
11import Data.Typeable
11import Data.Typeable
12import Options.Applicative
12import Options.Applicative
13import System.Directory
13import System.Directory
14+import System.Environment
14import System.Exit
15import System.Exit
15import System.FilePath ((</>))
16import System.FilePath ((</>))
16import System.Info
17import System.Info
@@ -103,20 +104,25 @@ runTest path flags = do
103 normalise (x : xs) = x : normalise xs
104 normalise (x : xs) = x : normalise xs
104 normalise [] = []
105 normalise [] = []
109+ nodePath <- findExecutable "node"
110+ nodejsPath <- findExecutable "nodejs"
111+ let node = nodePath <|> nodejsPath
114+ putStrLn "For running the test suite against Node, node must be installed."
106main :: IO ()
118main :: IO ()
108− nodePath <- findExecutable "node"
120+ args <- getArgs
109− nodejsPath <- findExecutable "nodejs"
121+ when ("--node" `elem` args) checkNode
110− let node = nodePath <|> nodejsPath
113− putStrLn "For running the test suite against Node, node must be installed."
116− defaultMainWithIngredients ingredients $
122+ defaultMainWithIngredients ingredients $
117 askOption $ \(NodeOpt node) ->
123 askOption $ \(NodeOpt node) ->
118− let (codegen, flags) = if node then (JS, ["--codegen", "node"])
124+ let (codegen, flags) = if node then (JS, ["--codegen", "node"])
119− else (C , [])
125+ else (C , [])
121− mkGoldenTests (testFamiliesForCodegen codegen)
127+ mkGoldenTests (testFamiliesForCodegen codegen) (flags ++ idrisFlags)
122− (flags ++ idrisFlags)
128+