on master help sign in
Clean up build artifacts from library tests
commitc0819c93162727dca224fe86c1430763006f1d75 authorEvan Czaplicki <info@elm-lang.org> dateWed 11 Jun 2014, 16:45 (12 years ago) parent5e33985
1 file changed+12−9
tests/libraries/LibraryTest.hs+12−9
tests/libraries/LibraryTest.hs+12−9
@@ -19,25 +19,28 @@ main = do
1919 unless ("jsdom" `isInfixOf` out) $ runCmd "npm" ["install","jsdom"]
2020
2121 -- setup actual library tests
22− setCurrentDirectory $ top </> "tests" </> "libraries"
23− let localCompiler = joinPath [ top, "dist", "build", "elm", "elm" ]
22+ let localCompiler = joinPath [ "dist", "build", "elm", "elm" ]
2423 runCmd localCompiler [ "--make"
2524 , "--only-js"
26− , "--src-dir=" ++ top </> "IO"
27− , "--src-dir=" ++ top </> "Elm-Test"
25+ , "--src-dir=IO"
26+ , "--src-dir=Elm-Test"
27+ , "--src-dir=" ++ "tests" </> "libraries"
2828 , "Test.elm"
2929 ]
3030
3131 -- run tests
32− let ioScript s = top </> "IO" </> s
33− files = [ ioScript "prescript.js"
32+ let files = [ "IO" </> "share" </> "prescript.js"
3433 , Elm.runtime
3534 , "build" </> "Test.js"
36− , ioScript "handler.js"
35+ , "IO" </> "share" </> "handler.js"
3736 ]
37+ testRunner = "build" </> "TestRunner.js"
3838 exe <- readProcess "cat" files ""
39− writeFile "exe.js" exe
40− exitWith =<< waitForProcess =<< (runCommand "node exe.js")
39+ writeFile testRunner exe
40+ exitCode <- rawSystem "node" [testRunner]
41+ removeDirectoryRecursive "cache"
42+ removeDirectoryRecursive "build"
43+ exitWith exitCode
4144
4245runCmd :: String -> [String] -> IO ()
4346runCmd cmd args = do