summaryrefslogtreecommitdiff
path: root/testsuite/tests/cabal/all.T
blob: 0c1b2d7cc13027c6ad786741ed48d52315d9b671 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
def normaliseDynlibNames(str):
    return re.sub('-ghc[0-9.]+\.', '-ghc<VERSION>.', str)

test('ghcpkg01',
     extra_clean(['local01.package.conf',
                  'local01.package.conf.old']),
     run_command,
     ['$MAKE -s --no-print-directory ghcpkg01'])
test('ghcpkg02',
     [ignore_output,
      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'])
test('ghcpkg04',
     [ignore_output,
      extra_clean(['local04.package.conf',
                   'local04.package.conf.old'])],
     run_command,
     ['$MAKE -s --no-print-directory ghcpkg04'])

# Sometimes we get spurious warnings from ghc-pkg about missing
# haddock-interfaces; this filters them out.
def normalise_haddock_junk( str ):
    return re.sub(r'Warning: haddock.*\n', '', str)

test('ghcpkg05',
     [ extra_clean(['local05a.package.conf',
                    'local05a.package.conf.old',
                    'local05b.package.conf',
                    'local05b.package.conf.old']),
       normalise_errmsg_fun(normalise_haddock_junk, normaliseDynlibNames)
       ],
     run_command,
     ['$MAKE -s --no-print-directory ghcpkg05'])
test('ghcpkg06',
     [extra_clean(['local06.package.conf',
                   'local06.package.conf.old'])],
     run_command,
     ['$MAKE -s --no-print-directory ghcpkg06'])

test('ghcpkg07',
     extra_clean(['local07.package.conf',
                  'local07.package.conf.old']),
     run_command,
     ['$MAKE -s --no-print-directory ghcpkg07'])

# 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, [''])

test('T1750',
     extra_clean(['T1750.hs', 'T1750.out',
                  'localT1750.package.conf',
                  'localT1750.package.conf.old']),
     run_command, ['$MAKE -s --no-print-directory T1750'])

test('T5442a',
     [extra_clean(['package.conf.T5442a.global', 'package.conf.T5442a.user'])],
     run_command,
     ['$MAKE -s --no-print-directory T5442a'])

test('T5442b',
     [extra_clean(['package.conf.T5442b.global', 'package.conf.T5442b.user'])],
     run_command,
     ['$MAKE -s --no-print-directory T5442b'])

test('T5442c',
     [extra_clean(['package.conf.T5442c.global', 'package.conf.T5442c.user',
                   'package.conf.T5442c.extra'])],
     run_command,
     ['$MAKE -s --no-print-directory T5442c'])

test('T5442d',
     [extra_clean(['package.conf.T5442d.global', 'package.conf.T5442d.user',
                   'package.conf.T5442d.extra'])],
     run_command,
     ['$MAKE -s --no-print-directory T5442d'])

test('shadow',
     extra_clean(['shadow.out', 'shadow.hs', 'shadow.hi',
                  'local1shadow1.package.conf',
                  'local1shadow1.package.conf.old',
                  'local1shadow2.package.conf',
                  'local1shadow2.package.conf.old']),
     run_command, ['$MAKE -s --no-print-directory shadow'])