on master help sign in
Merge pull request #2922 from jfdm/integrate-test-runner-with-cabal
85b6c78Niklas Larsson
idris.cabal+18
@@ -1046,6 +1046,24 @@ Executable idris
1046 ghc-prof-options: -auto-all -caf-all
1046 ghc-prof-options: -auto-all -caf-all
1047 ghc-options: -threaded -rtsopts -funbox-strict-fields
1047 ghc-options: -threaded -rtsopts -funbox-strict-fields
1048
1048
1049+Test-suite regression-and-sanity-tests
1050+ Type: exitcode-stdio-1.0
1051+ Main-is: runtest.hs
1052+ hs-source-dirs: test
1053+
1054+ Build-depends: idris
1055+ , base
1056+ , containers
1057+ , process
1058+ , time
1059+ , filepath
1060+ , directory
1061+ , haskeline >= 0.7
1062+ , transformers
1063+
1064+ ghc-prof-options: -auto-all -caf-all
1065+ ghc-options: -threaded -rtsopts -funbox-strict-fields
1066+
1049Executable idris-codegen-c
1067Executable idris-codegen-c
1050 Main-is: Main.hs
1068 Main-is: Main.hs
1051 hs-source-dirs: codegen/idris-codegen-c
1069 hs-source-dirs: codegen/idris-codegen-c
test/runtest.hs+5−2
@@ -51,8 +51,8 @@ checkTestName d = (all isDigit $ take 3 $ reverse d)
51
51
52enumTests :: IO [String]
52enumTests :: IO [String]
53enumTests = do
53enumTests = do
54− cd <- getCurrentDirectory
54+ cwd <- getCurrentDirectory
55− dirs <- getDirectoryContents cd
55+ dirs <- getDirectoryContents cwd
56 return $ sort $ filter checkTestName dirs
56 return $ sort $ filter checkTestName dirs
57
57
58parseFlag :: String -> Maybe Flag
58parseFlag :: String -> Maybe Flag
@@ -202,6 +202,9 @@ setPath conf = do
202
202
203main = do
203main = do
204 hSetBuffering stdout LineBuffering
204 hSetBuffering stdout LineBuffering
205+ withCabal <- doesDirectoryExist "test"
206+ when withCabal $ do
207+ setCurrentDirectory "test"
205 args <- getArgs
208 args <- getArgs
206 conf <- parseArgs args
209 conf <- parseArgs args
207 setPath conf
210 setPath conf