git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
No need for execTests.sh any more
commitae55638c63bd85077b9241ef108cbade2be1172c authorPhil Freeman <paf31@cantab.net> dateThu 27 Feb 2014, 15:11 (13 years ago) parent6410369
3 files changed+6−15
.travis.yml−3 execTests.sh−1 tests/Main.hs+6−11
.travis.yml−3
@@ -1,6 +1,3 @@
11language: haskell
22notifications:
33 email: true
4−after_success:
5− - cabal install
6− - ./execTests.sh
execTests.shdeleted−1
@@ -1 +0,0 @@
1−dist/build/tests/tests --run-js
tests/Main.hs+6−11
@@ -26,7 +26,6 @@ import System.Exit
2626import System.Process
2727import System.FilePath (pathSeparator)
2828import System.Directory (getCurrentDirectory, getDirectoryContents, findExecutable)
29−import System.Environment (getArgs)
3029import Text.Parsec (ParseError)
3130import qualified Paths_purescript as Paths
3231import qualified System.IO.UTF8 as U
@@ -65,16 +64,12 @@ assertCompiles inputFile = do
6564 putStrLn $ "assert " ++ inputFile ++ " compiles successfully"
6665 prelude <- preludeFilename
6766 assert (P.defaultOptions { P.optionsMain = Just "Main", P.optionsNoOptimizations = True, P.optionsModules = ["Main"] }) [prelude, inputFile] $ either (return . Just) $ \js -> do
68− args <- getArgs
69− if "--run-js" `elem` args
70− then do
71− process <- findNodeProcess
72− result <- traverse (\node -> readProcessWithExitCode node [] js) process
73− case result of
74− Just (ExitSuccess, out, _) -> putStrLn out >> return Nothing
75− Just (ExitFailure _, _, err) -> return $ Just err
76− Nothing -> return $ Just "Couldn't find node.js executable"
77− else return Nothing
67+ process <- findNodeProcess
68+ result <- traverse (\node -> readProcessWithExitCode node [] js) process
69+ case result of
70+ Just (ExitSuccess, out, _) -> putStrLn out >> return Nothing
71+ Just (ExitFailure _, _, err) -> return $ Just err
72+ Nothing -> return $ Just "Couldn't find node.js executable"
7873
7974findNodeProcess :: IO (Maybe String)
8075findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names