on master help sign in
Clean up after testing
2dc78fcEvan Czaplicki
Elm.cabal+1−1
@@ -168,4 +168,4 @@ Test-Suite test-elm
168 Type: exitcode-stdio-1.0
168 Type: exitcode-stdio-1.0
169 Hs-Source-Dirs: tests
169 Hs-Source-Dirs: tests
170 Main-is: Main.hs
170 Main-is: Main.hs
171− build-depends: base, HTF
171+ build-depends: base, directory, HTF
tests/Main.hs+12−5
@@ -1,15 +1,22 @@
1module Main where
1module Main where
2
2
3+import System.Directory
4+import System.Exit (exitWith)
5+import System.Environment (getArgs)
3−import Test.Framework
6+import Test.Framework.TestManager
4import Test.Framework.BlackBoxTest
7import Test.Framework.BlackBoxTest
5
8
6main :: IO ()
9main :: IO ()
7main = do
10main = do
11+ args <- getArgs
8− tests <- blackBoxTests "tests/good" "dist/build/elm/elm" ".elm" args
12+ tests <- blackBoxTests "tests/good" "dist/build/elm/elm" ".elm" bbtArgs
9− htfMain tests
13+ code <- runTestWithArgs args tests
14+ removeDirectoryRecursive "cache"
15+ removeDirectoryRecursive "build"
16+ exitWith code
10
17
11−args = defaultBBTArgs { bbtArgs_stdoutDiff = ignoreDiff
18+bbtArgs = defaultBBTArgs { bbtArgs_stdoutDiff = ignoreDiff
12− , bbtArgs_stderrDiff = ignoreDiff }
19+ , bbtArgs_stderrDiff = ignoreDiff }
13
20
14ignoreDiff :: Diff
21ignoreDiff :: Diff
15ignoreDiff _ _ = return Nothing
22ignoreDiff _ _ = return Nothing