diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2016-06-24 20:45:04 +0200 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2016-06-29 18:20:51 +0200 |
commit | 1084d3755cac6ccd90f8decc0d79c315387ae388 (patch) | |
tree | a71d2acd5aa581d9c4edea6969edc3d0afc3447f /testsuite/tests/cabal | |
parent | 8f7194fae23bdc6db72fc5784933f50310ce51f9 (diff) | |
download | haskell-1084d3755cac6ccd90f8decc0d79c315387ae388.tar.gz |
Testsuite: use ignore_stderr/stdout instead of ignore_output
The problem with ignore_output is that it hides errors for WAY=ghci.
GHCi always returns with exit code 0 (unless it is broken itself).
For example: ghci015 must have been failing with compile errors for
years, but we didn't notice because all output was ignored.
Therefore, replace all uses of ignore_output with either ignore_stderr
or ignore_stdout. In some cases I opted for adding the expected output.
Update submodule hpc and stm.
Reviewed by: simonmar
Differential Revision: https://phabricator.haskell.org/D2367
Diffstat (limited to 'testsuite/tests/cabal')
-rw-r--r-- | testsuite/tests/cabal/Makefile | 3 | ||||
-rw-r--r-- | testsuite/tests/cabal/all.T | 16 | ||||
-rw-r--r-- | testsuite/tests/cabal/cabal03/Makefile | 8 | ||||
-rw-r--r-- | testsuite/tests/cabal/cabal03/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/cabal/cabal03/cabal03.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/cabal/cabal05/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/cabal/cabal05/cabal05.stderr | 5 | ||||
-rw-r--r-- | testsuite/tests/cabal/cabal09/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/cabal/ghcpkg04.stderr | 4 |
9 files changed, 33 insertions, 13 deletions
diff --git a/testsuite/tests/cabal/Makefile b/testsuite/tests/cabal/Makefile index cbf8cbb7ed..45fb6ebb25 100644 --- a/testsuite/tests/cabal/Makefile +++ b/testsuite/tests/cabal/Makefile @@ -243,8 +243,7 @@ ghcpkg02: $(GHC_PKG_ghcpkg02) init $(PACKAGE_CONF_ghcpkg02) set -e; \ for i in `'$(GHC_PKG)' list --global --simple-output -v0`; do \ - echo Updating $$i; \ - '$(GHC_PKG)' describe --global $$i | $(GHC_PKG_ghcpkg02) update --global --force -; \ + '$(GHC_PKG)' describe --global $$i | $(GHC_PKG_ghcpkg02) -v0 update --global --force -; \ done PKGCONF07=local07.package.conf diff --git a/testsuite/tests/cabal/all.T b/testsuite/tests/cabal/all.T index 0c1b2d7cc1..cc874c78c2 100644 --- a/testsuite/tests/cabal/all.T +++ b/testsuite/tests/cabal/all.T @@ -6,19 +6,31 @@ test('ghcpkg01', 'local01.package.conf.old']), run_command, ['$MAKE -s --no-print-directory ghcpkg01']) + +# Use ignore_stderr to prevent (when HADDOCK_DOCS=NO): +# warning: haddock-interfaces .. doesn't exist or isn't a file test('ghcpkg02', - [ignore_output, + [ignore_stderr, extra_clean(['package.conf.ghcpkg02', 'package.conf.ghcpkg02.old'])], run_command, ['$MAKE -s --no-print-directory ghcpkg02']) + test('ghcpkg03', [extra_clean(['local03.package.conf', 'local03.package.conf.old']), normalise_errmsg_fun(normaliseDynlibNames)], run_command, ['$MAKE -s --no-print-directory ghcpkg03']) + +def normalise_package_order(s): + # Package order is not deterministic? + return re.sub('testpkg-1.2.3.4 newtestpkg-2.0', + 'newtestpkg-2.0 testpkg-1.2.3.4', + s) + test('ghcpkg04', - [ignore_output, + [ + normalise_errmsg_fun(normalise_package_order), extra_clean(['local04.package.conf', 'local04.package.conf.old'])], run_command, diff --git a/testsuite/tests/cabal/cabal03/Makefile b/testsuite/tests/cabal/cabal03/Makefile index fbd02c553d..93589e89b0 100644 --- a/testsuite/tests/cabal/cabal03/Makefile +++ b/testsuite/tests/cabal/cabal03/Makefile @@ -6,9 +6,9 @@ include $(TOP)/mk/test.mk SETUP=../Setup -v0 # This test is for overlapping/shadowing packages with Cabal. We -# 1. install p-1.0 to the global DB -# 2. install q-1.0 (depending on p-1.0) to a temporary DB -# 3. install a differnet p-1.0 to the temp DB +# 1. install p-1.0 +# 2. install q-1.0 (depending on p-1.0) +# 3. install a different p-1.0 # 4. attempt to configure and buidl r, which depends on p-1.0 and q-1.0 # # step 4 will elicit a warning from Cabal's configure step that the @@ -30,7 +30,7 @@ cabal03: clean cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force --ipid p-withopt cd p && $(SETUP) build cd p && $(SETUP) register - cd r && ! ../Setup configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force + cd r && ! ../Setup configure -v0 $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force ifneq "$(CLEANUP)" "" $(MAKE) -s --no-print-directory clean endif diff --git a/testsuite/tests/cabal/cabal03/all.T b/testsuite/tests/cabal/cabal03/all.T index b1b0561fc4..822d35ef81 100644 --- a/testsuite/tests/cabal/cabal03/all.T +++ b/testsuite/tests/cabal/cabal03/all.T @@ -4,6 +4,6 @@ else: cleanup = 'CLEANUP=0' test('cabal03', - ignore_output, + normal, run_command, ['$MAKE -s --no-print-directory cabal03 ' + cleanup]) diff --git a/testsuite/tests/cabal/cabal03/cabal03.stderr b/testsuite/tests/cabal/cabal03/cabal03.stderr new file mode 100644 index 0000000000..9d46d6883c --- /dev/null +++ b/testsuite/tests/cabal/cabal03/cabal03.stderr @@ -0,0 +1,4 @@ +Setup: The following installed packages are broken because other packages they +depend on are missing. These broken packages must be rebuilt before they can +be used. +package q-1.0 is broken due to missing package p-noopt diff --git a/testsuite/tests/cabal/cabal05/all.T b/testsuite/tests/cabal/cabal05/all.T index d7d9ffb3e5..aa209c8f49 100644 --- a/testsuite/tests/cabal/cabal05/all.T +++ b/testsuite/tests/cabal/cabal05/all.T @@ -4,6 +4,6 @@ else: cleanup = 'CLEANUP=0' test('cabal05', - ignore_output, + normal, run_command, ['$MAKE -s --no-print-directory cabal05 ' + cleanup]) diff --git a/testsuite/tests/cabal/cabal05/cabal05.stderr b/testsuite/tests/cabal/cabal05/cabal05.stderr new file mode 100644 index 0000000000..b38f3a5301 --- /dev/null +++ b/testsuite/tests/cabal/cabal05/cabal05.stderr @@ -0,0 +1,5 @@ + +T.hs:3:1: error: + Ambiguous interface for ‘Conflict’: + it is bound as p-0.1.0.0:P2 by a reexport in package p-0.1.0.0 + it is bound as P by a reexport in package p-0.1.0.0 diff --git a/testsuite/tests/cabal/cabal09/all.T b/testsuite/tests/cabal/cabal09/all.T index 6728c7749b..bd7761900d 100644 --- a/testsuite/tests/cabal/cabal09/all.T +++ b/testsuite/tests/cabal/cabal09/all.T @@ -4,6 +4,6 @@ else: cleanup = 'CLEANUP=0' test('cabal09', - ignore_output, + normal, run_command, ['$MAKE -s --no-print-directory cabal09 ' + cleanup]) diff --git a/testsuite/tests/cabal/ghcpkg04.stderr b/testsuite/tests/cabal/ghcpkg04.stderr index 29a912b991..b601f3e706 100644 --- a/testsuite/tests/cabal/ghcpkg04.stderr +++ b/testsuite/tests/cabal/ghcpkg04.stderr @@ -1,4 +1,4 @@ -ghcpkg04.hs:1:0: - Failed to load interface for `A': +ghcpkg04.hs:1:1: error: + Ambiguous interface for ‘A’: it was found in multiple packages: testpkg-1.2.3.4 newtestpkg-2.0 |