git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Do not run tests in NodeJS during Travis CI build
commit5e3f09c9e76175ef6989f52546332b5a3d4b8545 authorPhil Freeman <paf31@cantab.net> dateSun 26 Jan 2014, 20:22 (13 years ago) parent0317844
3 files changed+12−7
.travis.yml−3 execTests.sh+1 tests/Main.hs+11−4
.travis.yml−3
@@ -1,6 +1,3 @@
11language: haskell
22notifications:
33 email: false
4−before_install:
5− - sudo apt-get update -qq
6− - sudo apt-get install -qq nodejs
execTests.shnew file+1
@@ -0,0 +1 @@
1+dist/build/tests/tests --run-js
tests/Main.hs+11−4
@@ -12,6 +12,8 @@
1212--
1313-----------------------------------------------------------------------------
1414
15+{-# LANGUAGE DoAndIfThenElse #-}
16+
1517module Main (main) where
1618
1719import qualified Language.PureScript as P
@@ -23,6 +25,7 @@ import System.Exit
2325import System.Process
2426import System.FilePath (pathSeparator)
2527import System.Directory (getCurrentDirectory, getDirectoryContents)
28+import System.Environment (getArgs)
2629import Text.Parsec (ParseError)
2730import qualified Paths_purescript as Paths
2831import qualified System.IO.UTF8 as U
@@ -62,10 +65,14 @@ assertCompiles inputFile = do
6265 putStrLn $ "assert " ++ inputFile ++ " compiles successfully"
6366 prelude <- preludeFilename
6467 assert (P.defaultOptions { P.optionsRunMain = True }) [prelude, inputFile] $ either (return . Just) $ \js -> do
65− (exitCode, out, err) <- readProcessWithExitCode "nodejs" [] js
66− case exitCode of
67− ExitSuccess -> putStrLn out >> return Nothing
68− ExitFailure code -> return $ Just err
68+ args <- getArgs
69+ if "--run-js" `elem` args
70+ then do
71+ (exitCode, out, err) <- readProcessWithExitCode "nodejs" [] js
72+ case exitCode of
73+ ExitSuccess -> putStrLn out >> return Nothing
74+ ExitFailure code -> return $ Just err
75+ else return Nothing
6976
7077assertDoesNotCompile :: FilePath -> IO ()
7178assertDoesNotCompile inputFile = do