Skip to content

Commit 7ee57b6

Browse files
committed
Fix compiler test suite after incremental build change.
Wow, I should really automate testing on push or something. Apparently I'm bad at fixing tests.
1 parent cb89b56 commit 7ee57b6

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

codeworld-compiler/test/Main.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@ import System.Exit
2424
import System.FilePath.Posix
2525
import Test.HUnit -- only import needed, others are optional
2626

27-
2827
testcaseDir :: FilePath
2928
testcaseDir = "test/testcase"
3029

3130
testcaseOutputDir :: FilePath
3231
testcaseOutputDir = "../testcase-output"
3332

3433
testSourceFile :: String -> FilePath
35-
testSourceFile testName = testcaseDir </> testName </> "source.hs"
34+
testSourceFile testName = testcaseDir </> testName </> "source.hs"
3635

3736
testErrorFile :: String -> FilePath
3837
testErrorFile testName = testcaseOutputDir </> testName </> "error.txt"
@@ -49,9 +48,10 @@ savedErrorOutput testName = do
4948
return savedErrMsg
5049

5150
compileErrorOutput :: String -> IO String
52-
compileErrorOutput testName = do
51+
compileErrorOutput testName = do
5352
createDir <- createDirectoryIfMissing True (testcaseOutputDir </> testName)
54-
out <- compileSource
53+
out <- compileSource
54+
FullBuild
5555
(testSourceFile testName)
5656
(testOutputFile testName)
5757
(testErrorFile testName)
@@ -60,8 +60,8 @@ compileErrorOutput testName = do
6060
return errMsg
6161

6262
genTestCases :: [String] -> [Test]
63-
genTestCases [] = ["Empty directory testcase" ~: "FOo" ~=? (map toUpper "foo")]
64-
genTestCases (x) = map toTestCase x
63+
genTestCases [] = ["Empty directory testcase" ~: "FOo" ~=? (map toUpper "foo")]
64+
genTestCases (x) = map toTestCase x
6565

6666
toTestCase x = x ~: do
6767
err1 <- compileErrorOutput x
@@ -80,6 +80,6 @@ main :: IO Counts
8080
main = do
8181
cs@(Counts _ _ errs fails) <- getTestCases testcaseDir
8282
putStrLn (showCounts cs)
83-
if (errs > 0 || fails > 0)
83+
if (errs > 0 || fails > 0)
8484
then exitFailure
85-
else exitSuccess
85+
else exitSuccess

0 commit comments

Comments
 (0)