Commit 7e8dfac4 authored by ttuegel's avatar ttuegel
Browse files

Remove log files before running tests by default.

parent 5d457a31
......@@ -77,12 +77,12 @@ import Distribution.Verbosity ( normal, Verbosity )
import Distribution.System ( buildPlatform, Platform )
import Control.Exception ( bracket )
import Control.Monad ( when, liftM, unless )
import Control.Monad ( when, liftM, unless, filterM )
import Data.Char ( toUpper )
import Data.Monoid ( mempty )
import System.Directory
( createDirectoryIfMissing, doesFileExist, getCurrentDirectory
, removeFile )
, removeFile, getDirectoryContents )
import System.Environment ( getEnvironment )
import System.Exit ( ExitCode(..), exitFailure, exitSuccess, exitWith )
import System.FilePath ( (</>), (<.>) )
......@@ -327,6 +327,11 @@ test pkg_descr lbi flags = do
createDirectoryIfMissing True testLogDir
-- Delete ordinary files from test log directory.
getDirectoryContents testLogDir
>>= filterM doesFileExist . map (testLogDir </>)
>>= mapM_ removeFile
let totalSuites = length testsToRun
notice verbosity $ "Running " ++ show totalSuites ++ " test suites..."
suites <- mapM doTest testsToRun
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment