Need to validate test paths too
This commit is contained in:
parent
54bb83e972
commit
bdc2b96ae1
@ -169,15 +169,15 @@ getGHC = do
|
|||||||
-- tests and benchmarks.
|
-- tests and benchmarks.
|
||||||
cabalAllTargets :: PackageDescription -> IO ([String],[String],[String],[String])
|
cabalAllTargets :: PackageDescription -> IO ([String],[String],[String],[String])
|
||||||
cabalAllTargets pd = do
|
cabalAllTargets pd = do
|
||||||
exeTargets <- mapM getExecutableTarget $ executables pd
|
exeTargets <- mapM getExecutableTarget $ executables pd
|
||||||
return (libTargets,concat exeTargets,testTargets,benchTargets)
|
testTargets <- mapM getTestTarget $ testSuites pd
|
||||||
|
return (libTargets,concat exeTargets,concat testTargets,benchTargets)
|
||||||
where
|
where
|
||||||
lib = case library pd of
|
lib = case library pd of
|
||||||
Nothing -> []
|
Nothing -> []
|
||||||
Just l -> libModules l
|
Just l -> libModules l
|
||||||
|
|
||||||
libTargets = map toModuleString $ lib
|
libTargets = map toModuleString $ lib
|
||||||
testTargets = concatMap getTestTargets $ map testInterface $ testSuites pd
|
|
||||||
benchTargets = map toModuleString $ concatMap benchmarkModules $ benchmarks pd
|
benchTargets = map toModuleString $ concatMap benchmarkModules $ benchmarks pd
|
||||||
|
|
||||||
toModuleString :: ModuleName -> String
|
toModuleString :: ModuleName -> String
|
||||||
@ -186,10 +186,14 @@ cabalAllTargets pd = do
|
|||||||
fromFilePath :: FilePath -> String
|
fromFilePath :: FilePath -> String
|
||||||
fromFilePath fp = map (\c -> if c=='/' then '.' else c) fp
|
fromFilePath fp = map (\c -> if c=='/' then '.' else c) fp
|
||||||
|
|
||||||
getTestTargets :: TestSuiteInterface -> [String]
|
getTestTarget :: TestSuite -> IO [String]
|
||||||
getTestTargets (TestSuiteExeV10 _ filePath) = [fromFilePath filePath]
|
getTestTarget ts =
|
||||||
getTestTargets (TestSuiteLibV09 _ moduleName) = [toModuleString moduleName]
|
case testInterface ts of
|
||||||
getTestTargets (TestSuiteUnsupported _) = []
|
(TestSuiteExeV10 _ filePath) -> do
|
||||||
|
let maybeTests = [p </> e | p <- hsSourceDirs $ testBuildInfo ts, e <- [filePath]]
|
||||||
|
liftIO $ filterM doesFileExist maybeTests
|
||||||
|
(TestSuiteLibV09 _ moduleName) -> return [toModuleString moduleName]
|
||||||
|
(TestSuiteUnsupported _) -> return []
|
||||||
|
|
||||||
getExecutableTarget :: Executable -> IO [String]
|
getExecutableTarget :: Executable -> IO [String]
|
||||||
getExecutableTarget exe = do
|
getExecutableTarget exe = do
|
||||||
|
Loading…
Reference in New Issue
Block a user