on master help sign in
Check for node when running test suite.

If node isn't installed then don't run the test suite. This check could possibly be performed when the test option for running node is set, but it is not clear how. Regardless, if you are contributing a pull request then you would need to run the tests for both `C` and `Node` codegens.

commit5f54e5a2879e9d51e5c31628392126068027f734 authorJan de Muijnck-Hughes <jfdm@st-andrews.ac.uk> dateWed 21 Dec 2016, 11:19 (10 years ago) parentad13438
1 file changed+14−8
test/TestRun.hs+14−8
test/TestRun.hs+14−8
@@ -107,11 +107,17 @@ runTest path flags = do
107107 normalise [] = []
108108
109109main :: IO ()
110−main =
111− defaultMainWithIngredients ingredients $
112− askOption $ \(NodeOpt node) ->
113− let (codegen, flags) = if node then (JS, ["--codegen", "node"])
114− else (C , [])
115− in
116− mkGoldenTests (testFamiliesForCodegen codegen)
117− (flags ++ idrisFlags)
110+main = do
111+ node <- findExecutable "node"
112+ case node of
113+ Nothing -> do
114+ putStrLn "For running the test suite against Node, node must be installed."
115+ exitFailure
116+ Just _ -> do
117+ defaultMainWithIngredients ingredients $
118+ askOption $ \(NodeOpt node) ->
119+ let (codegen, flags) = if node then (JS, ["--codegen", "node"])
120+ else (C , [])
121+ in
122+ mkGoldenTests (testFamiliesForCodegen codegen)
123+ (flags ++ idrisFlags)