Commit 196ecdee authored by tibbe's avatar tibbe
Browse files

Merge branch 'master' of github.com:haskell/cabal

parents 2c22c0ea 094ffc81
......@@ -15,11 +15,11 @@ before_install:
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH
install:
- sudo /opt/ghc/$GHCVER/bin/ghc-pkg recache
- /opt/ghc/$GHCVER/bin/ghc-pkg recache --user
- cabal update
- cd Cabal
- cabal install --only-dependencies --enable-tests --enable-benchmarks
- sudo /opt/ghc/$GHCVER/bin/ghc-pkg recache
- /opt/ghc/$GHCVER/bin/ghc-pkg recache --user
# Here starts the actual work to be performed for the package under test; any command which exits with a non-zero exit code causes the build to fail.
script:
......
......@@ -1620,7 +1620,8 @@ testCommand = makeCommand name shortDesc longDesc defaultTestFlags options
, option [] ["show-details"]
("'always': always show results of individual test cases. "
++ "'never': never show results of individual test cases. "
++ "'failures': show results of failing test cases.")
++ "'failures': show results of failing test cases. "
++ "'streaming': show results of test cases in real time.")
testShowDetails (\v flags -> flags { testShowDetails = v })
(reqArg "FILTER"
(readP_to_E (\_ -> "--show-details flag expects one of "
......
......@@ -990,8 +990,8 @@ suites, otherwise, Cabal will run all test suites in the package.
`--show-details=`_filter_
: Determines if the results of individual test cases are shown on the
terminal. May be `always` (always show), `never` (never show), or
`failures` (show only the test cases of failing test suites).
terminal. May be `always` (always show), `never` (never show), `failures`
(show only failed results), or `streaming` (show all results in real time).
`--test-options=`_options_
: Give extra options to the test executables.
......
......@@ -29,7 +29,7 @@ module Distribution.Client.Install (
) where
import Data.List
( unfoldr, nub, sort, (\\) )
( isPrefixOf, unfoldr, nub, sort, (\\) )
import qualified Data.Set as S
import Data.Maybe
( isJust, fromMaybe, maybeToList )
......@@ -50,7 +50,7 @@ import System.Directory
( getTemporaryDirectory, doesDirectoryExist, doesFileExist,
createDirectoryIfMissing, removeFile, renameDirectory )
import System.FilePath
( (</>), (<.>), takeDirectory )
( (</>), (<.>), equalFilePath, takeDirectory )
import System.IO
( openFile, IOMode(AppendMode), hClose )
import System.IO.Error
......@@ -1179,9 +1179,10 @@ installLocalTarballPackage verbosity jobLimit pkgid
installPkg (Just absUnpackedPath)
where
-- 'cabal sdist' puts pre-generated files in the 'dist' directory. This
-- fails when we use a nonstandard build directory name (as is the case
-- with sandboxes), so we need to rename the 'dist' dir here.
-- 'cabal sdist' puts pre-generated files in the 'dist'
-- directory. This fails when a nonstandard build directory name
-- is used (as is the case with sandboxes), so we need to rename
-- the 'dist' dir here.
--
-- TODO: 'cabal get happy && cd sandbox && cabal install ../happy' still
-- fails even with this workaround. We probably can live with that.
......@@ -1191,12 +1192,16 @@ installLocalTarballPackage verbosity jobLimit pkgid
distDirPathTmp = absUnpackedPath </> (defaultDistPref ++ "-tmp")
distDirPathNew = absUnpackedPath </> distPref
distDirExists <- doesDirectoryExist distDirPath
when (distDirExists && distDirPath /= distDirPathNew) $ do
when (distDirExists
&& (not $ distDirPath `equalFilePath` distDirPathNew)) $ do
-- NB: we need to handle the case when 'distDirPathNew' is a
-- subdirectory of 'distDirPath' (e.g. 'dist/dist-sandbox-3688fbc2').
-- subdirectory of 'distDirPath' (e.g. the former is
-- 'dist/dist-sandbox-3688fbc2' and the latter is 'dist').
debug verbosity $ "Renaming '" ++ distDirPath ++ "' to '"
++ distDirPathTmp ++ "'."
renameDirectory distDirPath distDirPathTmp
when (distDirPath `isPrefixOf` distDirPathNew) $
createDirectoryIfMissingVerbose verbosity False distDirPath
debug verbosity $ "Renaming '" ++ distDirPathTmp ++ "' to '"
++ distDirPathNew ++ "'."
renameDirectory distDirPathTmp distDirPathNew
......
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