2016-05-09 14:53:31 +00:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
|
2020-01-04 16:52:21 +00:00
|
|
|
import qualified Data.ByteString as BS
|
|
|
|
import Data.IORef
|
2016-05-09 14:53:31 +00:00
|
|
|
import Test.Hspec
|
|
|
|
import Test.Hspec.Runner
|
|
|
|
import Test.Hspec.Formatters
|
|
|
|
import qualified Spec
|
|
|
|
import Utils
|
2020-01-04 16:52:21 +00:00
|
|
|
import System.Posix.Temp.ByteString (mkdtemp)
|
2016-05-09 14:53:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
-- TODO: chardev, blockdev, namedpipe, socket
|
|
|
|
|
|
|
|
|
|
|
|
main :: IO ()
|
2020-01-04 16:52:21 +00:00
|
|
|
main = do
|
|
|
|
tmpBase <- mkdtemp "/tmp/"
|
|
|
|
writeIORef baseTmpDir (Just (tmpBase `BS.append` "/"))
|
2020-01-04 17:14:52 +00:00
|
|
|
putStrLn $ ("Temporary test directory at: " ++ show tmpBase)
|
2016-05-09 14:53:31 +00:00
|
|
|
hspecWith
|
2016-05-29 15:32:22 +00:00
|
|
|
defaultConfig { configFormatter = Just progress }
|
2016-06-05 12:33:53 +00:00
|
|
|
$ afterAll_ deleteBaseTmpDir
|
2016-05-29 15:29:13 +00:00
|
|
|
$ Spec.spec
|