64f26396c4b4a5e1cae927d30ddc2104e391b043
[ghc.git] / testsuite / tests / cabal / all.T
1 def normaliseDynlibNames(str):
2     return re.sub('-ghc[0-9.]+\.', '-ghc<VERSION>.', str)
3
4 test('ghcpkg01',
5      extra_clean(['local01.package.conf',
6                   'local01.package.conf.old']),
7      run_command,
8      ['$MAKE -s --no-print-directory ghcpkg01'])
9
10 # Use ignore_stderr to prevent (when HADDOCK_DOCS=NO):
11 #  warning: haddock-interfaces .. doesn't exist or isn't a file
12 test('ghcpkg02',
13      [ignore_stderr,
14       extra_clean(['package.conf.ghcpkg02', 'package.conf.ghcpkg02.old'])],
15      run_command,
16      ['$MAKE -s --no-print-directory ghcpkg02'])
17
18 test('ghcpkg03',
19      [extra_clean(['local03.package.conf',
20                    'local03.package.conf.old']),
21       normalise_errmsg_fun(normaliseDynlibNames)],
22      run_command,
23      ['$MAKE -s --no-print-directory ghcpkg03'])
24
25 def normalise_package_order(s):
26     # Package order is not deterministic?
27     return re.sub('testpkg-1.2.3.4 newtestpkg-2.0',
28                   'newtestpkg-2.0 testpkg-1.2.3.4',
29                   s)
30
31 test('ghcpkg04',
32      [
33       normalise_errmsg_fun(normalise_package_order),
34       extra_clean(['local04.package.conf',
35                    'local04.package.conf.old'])],
36      run_command,
37      ['$MAKE -s --no-print-directory ghcpkg04'])
38
39 # Sometimes we get spurious warnings from ghc-pkg about missing
40 # haddock-interfaces; this filters them out.
41 def normalise_haddock_junk( str ):
42     return re.sub(r'Warning: haddock.*\n', '', str)
43
44 test('ghcpkg05',
45      [ extra_clean(['local05a.package.conf',
46                     'local05a.package.conf.old',
47                     'local05b.package.conf',
48                     'local05b.package.conf.old']),
49        normalise_errmsg_fun(normalise_haddock_junk, normaliseDynlibNames)
50        ],
51      run_command,
52      ['$MAKE -s --no-print-directory ghcpkg05'])
53 test('ghcpkg06',
54      [extra_clean(['local06.package.conf',
55                    'local06.package.conf.old'])],
56      run_command,
57      ['$MAKE -s --no-print-directory ghcpkg06'])
58
59 test('ghcpkg07',
60      extra_clean(['local07.package.conf',
61                   'local07.package.conf.old']),
62      run_command,
63      ['$MAKE -s --no-print-directory ghcpkg07'])
64
65 # Test that we *can* compile a module that also belongs to a package
66 # (this was disallowed in GHC 6.4 and earlier)
67 test('pkg01', normal, compile, [''])
68
69 test('T1750',
70      extra_clean(['T1750.hs', 'T1750.out',
71                   'localT1750.package.conf',
72                   'localT1750.package.conf.old']),
73      run_command, ['$MAKE -s --no-print-directory T1750'])
74
75 test('T5442a',
76      [extra_clean(['package.conf.T5442a.global', 'package.conf.T5442a.user'])],
77      run_command,
78      ['$MAKE -s --no-print-directory T5442a'])
79
80 test('T5442b',
81      [extra_clean(['package.conf.T5442b.global', 'package.conf.T5442b.user'])],
82      run_command,
83      ['$MAKE -s --no-print-directory T5442b'])
84
85 test('T5442c',
86      [extra_clean(['package.conf.T5442c.global', 'package.conf.T5442c.user',
87                    'package.conf.T5442c.extra'])],
88      run_command,
89      ['$MAKE -s --no-print-directory T5442c'])
90
91 test('T5442d',
92      [extra_clean(['package.conf.T5442d.global', 'package.conf.T5442d.user',
93                    'package.conf.T5442d.extra'])],
94      run_command,
95      ['$MAKE -s --no-print-directory T5442d'])
96
97 test('shadow',
98      extra_clean(['shadow.out', 'shadow.hs', 'shadow.hi',
99                   'local1shadow1.package.conf',
100                   'local1shadow1.package.conf.old',
101                   'local1shadow2.package.conf',
102                   'local1shadow2.package.conf.old']),
103      run_command, ['$MAKE -s --no-print-directory shadow'])
104
105 test('T12485a',
106      extra_clean(['T12485a.hi', 'T1750.out',
107                   'T12485a.package.conf',
108                   'T12485b.package.conf',
109                   'T12485c.package.conf']),
110      run_command, ['$MAKE -s --no-print-directory T12485a'])