git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
No need for execTests.sh any more
ae55638Phil Freeman
.travis.yml−3
@@ -1,6 +1,3 @@
1language: haskell
1language: haskell
2notifications:
2notifications:
3 email: true
3 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
26import System.Process
26import System.Process
27import System.FilePath (pathSeparator)
27import System.FilePath (pathSeparator)
28import System.Directory (getCurrentDirectory, getDirectoryContents, findExecutable)
28import System.Directory (getCurrentDirectory, getDirectoryContents, findExecutable)
29−import System.Environment (getArgs)
30import Text.Parsec (ParseError)
29import Text.Parsec (ParseError)
31import qualified Paths_purescript as Paths
30import qualified Paths_purescript as Paths
32import qualified System.IO.UTF8 as U
31import qualified System.IO.UTF8 as U
@@ -65,16 +64,12 @@ assertCompiles inputFile = do
65 putStrLn $ "assert " ++ inputFile ++ " compiles successfully"
64 putStrLn $ "assert " ++ inputFile ++ " compiles successfully"
66 prelude <- preludeFilename
65 prelude <- preludeFilename
67 assert (P.defaultOptions { P.optionsMain = Just "Main", P.optionsNoOptimizations = True, P.optionsModules = ["Main"] }) [prelude, inputFile] $ either (return . Just) $ \js -> do
66 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
67+ process <- findNodeProcess
72− result <- traverse (\node -> readProcessWithExitCode node [] js) process
68+ result <- traverse (\node -> readProcessWithExitCode node [] js) process
73− case result of
69+ case result of
74− Just (ExitSuccess, out, _) -> putStrLn out >> return Nothing
70+ Just (ExitSuccess, out, _) -> putStrLn out >> return Nothing
75− Just (ExitFailure _, _, err) -> return $ Just err
71+ Just (ExitFailure _, _, err) -> return $ Just err
76− Nothing -> return $ Just "Couldn't find node.js executable"
72+ Nothing -> return $ Just "Couldn't find node.js executable"
77− else return Nothing
78
73
79findNodeProcess :: IO (Maybe String)
74findNodeProcess :: IO (Maybe String)
80findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names
75findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names