Module reexports, fixing #8407.
[ghc.git] / testsuite / tests / cabal / all.T
1 setTestOpts(only_compiler_types(['ghc']))
2
3 def normaliseDynlibNames(str):
4     return re.sub('-ghc[0-9.]+\.', '-ghc<VERSION>.', str)
5
6 test('ghcpkg01',
7      extra_clean(['local01.package.conf',
8                   'local01.package.conf.old']),
9      run_command,
10      ['$MAKE -s --no-print-directory ghcpkg01'])
11 test('ghcpkg02',
12      [ignore_output,
13       extra_clean(['package.conf.ghcpkg02', 'package.conf.ghcpkg02.old'])],
14      run_command,
15      ['$MAKE -s --no-print-directory ghcpkg02'])
16 test('ghcpkg03',
17      [extra_clean(['local03.package.conf',
18                    'local03.package.conf.old']),
19       normalise_errmsg_fun(normaliseDynlibNames)],
20      run_command,
21      ['$MAKE -s --no-print-directory ghcpkg03'])
22 test('ghcpkg04',
23      [ignore_output,
24       extra_clean(['local04.package.conf',
25                    'local04.package.conf.old'])],
26      run_command,
27      ['$MAKE -s --no-print-directory ghcpkg04'])
28
29 # Sometimes we get spurious warnings from ghc-pkg about missing
30 # haddock-interfaces; this filters them out.
31 def normalise_haddock_junk( str ):
32     return re.sub(r'Warning: haddock.*\n', '', str)
33
34 test('ghcpkg05',
35      [ extra_clean(['local05a.package.conf',
36                     'local05a.package.conf.old',
37                     'local05b.package.conf',
38                     'local05b.package.conf.old']),
39        normalise_errmsg_fun(two_normalisers(normalise_haddock_junk,
40                                             normaliseDynlibNames))
41        ],
42      run_command,
43      ['$MAKE -s --no-print-directory ghcpkg05'])
44 test('ghcpkg06',
45      [extra_clean(['local06.package.conf',
46                    'local06.package.conf.old'])],
47      run_command,
48      ['$MAKE -s --no-print-directory ghcpkg06'])
49
50 test('ghcpkg07',
51      extra_clean(['local07.package.conf',
52                   'local07.package.conf.old']),
53      run_command,
54      ['$MAKE -s --no-print-directory ghcpkg07'])
55
56 # Test that we *can* compile a module that also belongs to a package
57 # (this was disallowed in GHC 6.4 and earlier)
58 test('pkg01', normal, compile, [''])
59
60 test('T1750',
61      extra_clean(['T1750.hs', 'T1750.out',
62                   'localT1750.package.conf',
63                   'localT1750.package.conf.old']),
64      run_command, ['$MAKE -s --no-print-directory T1750'])
65
66 test('T5442a',
67      [extra_clean(['package.conf.T5442a.global', 'package.conf.T5442a.user'])],
68      run_command,
69      ['$MAKE -s --no-print-directory T5442a'])
70
71 test('T5442b',
72      [extra_clean(['package.conf.T5442b.global', 'package.conf.T5442b.user'])],
73      run_command,
74      ['$MAKE -s --no-print-directory T5442b'])
75
76 test('T5442c',
77      [extra_clean(['package.conf.T5442c.global', 'package.conf.T5442c.user',
78                    'package.conf.T5442c.extra'])],
79      run_command,
80      ['$MAKE -s --no-print-directory T5442c'])
81
82 test('T5442d',
83      [extra_clean(['package.conf.T5442d.global', 'package.conf.T5442d.user',
84                    'package.conf.T5442d.extra'])],
85      run_command,
86      ['$MAKE -s --no-print-directory T5442d'])
87
88 test('shadow',
89      extra_clean(['shadow.out', 'shadow.hs', 'shadow.hi',
90                   'local1shadow1.package.conf',
91                   'local1shadow1.package.conf.old',
92                   'local1shadow2.package.conf',
93                   'local1shadow2.package.conf.old']),
94      run_command, ['$MAKE -s --no-print-directory shadow'])