Skip to content

Commit

Permalink
Merge pull request #4585 from haskell/2.0-port
Browse files Browse the repository at this point in the history
Cherry-pick the test suite fixes from master into 2.0
  • Loading branch information
23Skidoo authored Jul 5, 2017
2 parents 5a7da47 + b534b7e commit 42d92c9
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 24 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ matrix:
- env: GHCVER=8.0.2 SCRIPT=bootstrap
sudo: required
os: linux
- env: GHCVER=8.2.1 SCRIPT=script
os: linux
sudo: required

# We axed GHC 7.6 and earlier because it's not worth the trouble to
# make older GHC work with clang's cpp. See
Expand Down Expand Up @@ -117,7 +120,7 @@ install:
# build config format changed.
script:
- rm -rf dist-newstyle
- ./travis-${SCRIPT}.sh -j1
- ./travis-${SCRIPT}.sh -j2

cache:
directories:
Expand Down
40 changes: 32 additions & 8 deletions cabal-install/cabal-install.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,29 @@ executable cabal
hs-source-dirs: tests
other-modules:
UnitTests
UnitTests.Distribution.Client.ArbitraryInstances
UnitTests.Distribution.Client.FileMonitor
UnitTests.Distribution.Client.GZipUtils
UnitTests.Distribution.Client.Glob
UnitTests.Distribution.Client.IndexUtils.Timestamp
UnitTests.Distribution.Client.InstallPlan
UnitTests.Distribution.Client.JobControl
UnitTests.Distribution.Client.ProjectConfig
UnitTests.Distribution.Client.Sandbox
UnitTests.Distribution.Client.Sandbox.Timestamp
UnitTests.Distribution.Client.Store
UnitTests.Distribution.Client.Tar
UnitTests.Distribution.Client.Targets
UnitTests.Distribution.Client.UserConfig
UnitTests.Distribution.Solver.Modular.DSL
UnitTests.Distribution.Solver.Modular.DSL.TestCaseUtils
UnitTests.Distribution.Solver.Modular.MemoryUsage
UnitTests.Distribution.Solver.Modular.PSQ
UnitTests.Distribution.Solver.Modular.QuickCheck
UnitTests.Distribution.Solver.Modular.RetryLog
UnitTests.Distribution.Solver.Modular.Solver
UnitTests.Distribution.Solver.Modular.WeightedPSQ
UnitTests.Options
MemoryUsageTests
SolverQuickCheck
IntegrationTests2
Expand Down Expand Up @@ -404,26 +427,27 @@ Test-Suite unit-tests
other-modules:
Distribution.Client.Compat.FileLock
UnitTests.Distribution.Client.ArbitraryInstances
UnitTests.Distribution.Client.Targets
UnitTests.Distribution.Client.FileMonitor
UnitTests.Distribution.Client.Glob
UnitTests.Distribution.Client.GZipUtils
UnitTests.Distribution.Client.Glob
UnitTests.Distribution.Client.IndexUtils.Timestamp
UnitTests.Distribution.Client.InstallPlan
UnitTests.Distribution.Client.JobControl
UnitTests.Distribution.Client.ProjectConfig
UnitTests.Distribution.Client.Sandbox
UnitTests.Distribution.Client.Sandbox.Timestamp
UnitTests.Distribution.Client.Store
UnitTests.Distribution.Client.Tar
UnitTests.Distribution.Client.Targets
UnitTests.Distribution.Client.UserConfig
UnitTests.Distribution.Client.ProjectConfig
UnitTests.Distribution.Client.JobControl
UnitTests.Distribution.Client.IndexUtils.Timestamp
UnitTests.Distribution.Client.InstallPlan
UnitTests.Distribution.Solver.Modular.DSL
UnitTests.Distribution.Solver.Modular.DSL.TestCaseUtils
UnitTests.Distribution.Solver.Modular.PSQ
UnitTests.Distribution.Solver.Modular.RetryLog
UnitTests.Distribution.Solver.Modular.Solver
UnitTests.Distribution.Solver.Modular.DSL
UnitTests.Distribution.Solver.Modular.DSL.TestCaseUtils
UnitTests.Distribution.Solver.Modular.WeightedPSQ
UnitTests.Options

build-depends:
base,
async,
Expand Down
10 changes: 10 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/T4447/setup.cabal.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Setup configure
Resolving dependencies...
Configuring T4447-1.0...
Error:
Cannot instantiate requirement 'A' brought into scope by build-depends: T4447:foo-indef
with locally defined module brought into scope by other-modules: A
as this would create a cyclic dependency, which GHC does not support.
Try moving this module to a separate library, e.g.,
create a new stanza: library 'sublib'.
In the stanza executable foo-exe
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ main = cabalTest $ do
r <- fails $ cabal' "new-build" []
assertRegex "Should not have been able to import Cabal"
"(Could not find module|Failed to load interface for).*Distribution\\.Simple" r
{-
-- TODO: With GHC 8.2, this no longer is displayed
-- When using --with-ghc, this message is not necessarily output
has_cabal <- hasCabalForGhc
when has_cabal $
assertRegex "It is a member of the hidden package .*Cabal-"
"It is a member of the hidden package" r
-}
11 changes: 0 additions & 11 deletions cabal-testsuite/PackageTests/NewBuild/T4450/cabal.out
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
# cabal new-build
Resolving dependencies...
In order, the following will be built:
- T4450-1.0 (exe:foo) (first run)
# cabal new-build
In order, the following will be built:
- T4450-1.0 (lib:T4450) (additional components to build)
- dep-1.0 (lib) (first run)
Configuring library for dep-1.0..
Preprocessing library for dep-1.0..
Building library for dep-1.0..
6 changes: 4 additions & 2 deletions cabal-testsuite/PackageTests/NewBuild/T4450/cabal.test.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Test.Cabal.Prelude
main = cabalTest $ do
skipUnless =<< hasNewBuildCompatBootCabal
cabal "new-build" ["foo"]
cabal "new-build" ["dep"]
-- Custom Setups inconsistently report output depending
-- on your boot GHC.
recordMode DoNotRecord $ cabal "new-build" ["foo"]
recordMode DoNotRecord $ cabal "new-build" ["dep"]
3 changes: 2 additions & 1 deletion cabal-testsuite/Test/Cabal/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ initServer s0 = do
pid <- withProcessHandle (serverProcessHandle s0) $ \ph ->
case ph of
OpenHandle x -> return (show x)
ClosedHandle _ -> return (serverProcessId s0)
-- TODO: handle OpenExtHandle?
_ -> return (serverProcessId s0)
#endif
let s = s0 { serverProcessId = pid }
-- We will read/write a line at a time, including for
Expand Down
6 changes: 5 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ constraints: unix >= 2.7.1.0,

program-options
-- So us hackers get all the assertion failures early:
-- NOTE: currently commented out, see https://github.com/haskell/cabal/issues/3911
--
-- NOTE: currently commented out, see
-- https://github.com/haskell/cabal/issues/3911
--
-- ghc-options: -fno-ignore-asserts
--
-- as a workaround we specify it for each package individually:
package Cabal
ghc-options: -fno-ignore-asserts
Expand Down

0 comments on commit 42d92c9

Please sign in to comment.