[commit: packages/Cabal] ghc-head: Saves and restores current directory for detailed tests (8aacf2b)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:27:20 CEST 2013


Repository : ssh://git@git.haskell.org/Cabal

On branch  : ghc-head
Link       : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=8aacf2b87cee9590821a715d9765c542ec976852

>---------------------------------------------------------------

commit 8aacf2b87cee9590821a715d9765c542ec976852
Author: Ken Bateman <novadenizen at gmail.com>
Date:   Tue Jun 11 12:54:21 2013 -0400

    Saves and restores current directory for detailed tests


>---------------------------------------------------------------

8aacf2b87cee9590821a715d9765c542ec976852
 Cabal/Distribution/Simple/Test.hs |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Cabal/Distribution/Simple/Test.hs b/Cabal/Distribution/Simple/Test.hs
index 29a92e8..9c7049a 100644
--- a/Cabal/Distribution/Simple/Test.hs
+++ b/Cabal/Distribution/Simple/Test.hs
@@ -86,7 +86,7 @@ import Data.Maybe ( mapMaybe )
 import System.Directory
     ( createDirectoryIfMissing, doesDirectoryExist, doesFileExist
     , getCurrentDirectory, getDirectoryContents, removeDirectoryRecursive
-    , removeFile )
+    , removeFile, setCurrentDirectory )
 import System.Environment ( getEnvironment )
 import System.Exit ( ExitCode(..), exitFailure, exitWith )
 import System.FilePath ( (</>), (<.>) )
@@ -499,7 +499,10 @@ simpleTestStub m = unlines
 stubMain :: IO [Test] -> IO ()
 stubMain tests = do
     (f, n) <- fmap read getContents
-    tests >>= stubRunTests >>= stubWriteLog f n
+    dir <- getCurrentDirectory
+    results <- tests >>= stubRunTests
+    setCurrentDirectory dir
+    stubWriteLog f n results
 
 -- | The test runner used in library "TestSuite" stub executables.  Runs a list
 -- of 'Test's.  An executable calling this function is meant to be invoked as





More information about the ghc-commits mailing list