Fix tests for sdist

We now create the necessary directories and files
for the tests on-the-fly.
This commit is contained in:
2016-05-29 17:29:13 +02:00
parent 51da8bf5c2
commit 395621b27a
127 changed files with 807 additions and 638 deletions

View File

@@ -13,41 +13,11 @@ import Utils
main :: IO ()
main =
hspecWith
defaultConfig { configFormatter = Just progress }
$ before_ fixPermissions
$ after_ revertPermissions
$ Spec.spec >> Spec.spec
defaultConfig { configFormatter = Just specdoc }
$ before_ up
$ after_ down
$ Spec.spec
where
noWriteDirs = ["test/HPath/IO/copyFileSpec/outputDirNoWrite"
,"test/HPath/IO/copyFileOverwriteSpec/outputDirNoWrite"
,"test/HPath/IO/copyDirRecursiveSpec/noWritePerm"
,"test/HPath/IO/copyDirRecursiveOverwriteSpec/noWritePerm"
,"test/HPath/IO/createDirSpec/noWritePerms"
,"test/HPath/IO/createRegularFileSpec/noWritePerms"
,"test/HPath/IO/renameFileSpec/noWritePerm"
,"test/HPath/IO/moveFileSpec/noWritePerm"
,"test/HPath/IO/moveFileOverwriteSpec/noWritePerm"
,"test/HPath/IO/recreateSymlinkSpec/noWritePerm"
]
noPermsDirs = ["test/HPath/IO/copyFileSpec/noPerms"
,"test/HPath/IO/copyFileOverwriteSpec/noPerms"
,"test/HPath/IO/copyDirRecursiveSpec/noPerms"
,"test/HPath/IO/copyDirRecursiveOverwriteSpec/noPerms"
,"test/HPath/IO/createDirSpec/noPerms"
,"test/HPath/IO/createRegularFileSpec/noPerms"
,"test/HPath/IO/renameFileSpec/noPerms"
,"test/HPath/IO/moveFileSpec/noPerms"
,"test/HPath/IO/moveFileOverwriteSpec/noPerms"
,"test/HPath/IO/recreateSymlinkSpec/noPerms"
,"test/HPath/IO/getFileTypeSpec/noPerms"
,"test/HPath/IO/getDirsFilesSpec/noPerms"
,"test/HPath/IO/deleteFileSpec/noPerms"
]
fixPermissions = do
sequence_ $ fmap noWritableDirPerms noWriteDirs
sequence_ $ fmap noPerms noPermsDirs
revertPermissions = do
sequence_ $ fmap normalDirPerms noWriteDirs
sequence_ $ fmap normalDirPerms noPermsDirs
up = createTmpDir
down = deleteTmpDir