Commit c0d4e935 authored by Simon Marlow's avatar Simon Marlow
Browse files

test fixes and new tests for package support

parent 425c4fb5
......@@ -50,9 +50,8 @@ ghcpkg03 :
$(GHC_PKG) register --force test2.pkg
@: # test4.pkg depends on testpkg-2.0, which conflicts with testpkg-1.2.3.4,
@: # so ghc-pkg will refuse to install it when registering, and hide
@: # testpkg-1.2.3.4 when updating.
if $(GHC_PKG) register test4.pkg; then false; else true; fi
@: # ghc-pkg will happily register it now (it didn't in GHC 6.4)
$(GHC_PKG) register test4.pkg
$(GHC_PKG) update test4.pkg
@: # and another update of test.pkg will now hide dep-2.0
......
......@@ -5,5 +5,6 @@ test('ghcpkg02', skip_if_fast, run_command_ignore_output, ['$MAKE ghcpkg02'])
test('ghcpkg03', normal, run_command_ignore_output, ['$MAKE ghcpkg03'])
test('ghcpkg04', normal, run_command, ['$MAKE --no-print-directory ghcpkg04'])
# Test that we can't compile a module that also belongs to a package
test('pkg01', normal, compile_fail, [''])
# Test that we *can* compile a module that also belongs to a package
# (this was disallowed in GHC 6.4 and earlier)
test('pkg01', normal, compile, [''])
......@@ -2,4 +2,4 @@
ghcpkg04.hs:1:0:
Failed to load interface for `A':
Cannot import `A':
it was found in multiple packages: testpkg-1.2.3.4 newtestpkg-2.0
it was found in multiple packages: newtestpkg-2.0 testpkg-1.2.3.4
pkg01.hs:1:0:
conflict: module `Char' belongs to the current program/library
and also to package haskell98-1.0
# We can compile Network on its own (pkg02_a), but as soon as we
# compile a module that depends on something in the network package,
# we get a conflict (pkg02_b).
# We can compile Network on its own (pkg02_a)
test('pkg02_a', only_ways(['normal']), multimod_compile, ['Network','-v0'])
test('pkg02_b', normal, multimod_compile_fail, ['A','-v0'])
test('pkg02_b', normal, multimod_compile, ['A','-v0'])
clean_o_hi()
A.hs:1:0:
conflict: module `Network' belongs to the current program/library
and also to package network-1.0
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