Remove clean_cmd and extra_clean usage from .T files
[ghc.git] / testsuite / tests / safeHaskell / check / all.T
1 # check tests are about checking that the transitive safety
2 # check of safe haskell is working properly.
3
4 # Just do the normal way, SafeHaskell is all in the frontend
5 def f( name, opts ):
6   opts.only_ways = ['normal']
7
8 setTestOpts(f)
9
10 test('CheckA', normal, compile, [''])
11 test('CheckB', [], multimod_compile, ['CheckB', '-trust base'])
12
13 # fail as we don't trust base when compiling Check01
14 test('Check01', normal, multi_compile_fail, ['Check01 -distrust base', [
15                                             ('Check01_A.hs', ''),
16                                             ('Check01_B.hs', '-trust base')
17                                             ], '-fpackage-trust'])
18
19 # succeed this time since we trust base when we compile AND use CheckB
20 test('Check02', normal, multi_compile, ['Check02', [
21                                        ('Check02_A.hs', ''),
22                                        ('Check02_B.hs', '')
23                                        ], '-trust base -fpackage-trust'])
24
25 # succeed as while like Check01_fail we don't import CheckB as a safe
26 # import this time, so don't require base trusted when used.
27 test('Check03', normal, multi_compile, ['Check03', [
28                                        ('Check03_A.hs', ''),
29                                        ('Check03_B.hs', '-trust base')
30                                        ], '-fpackage-trust'])
31
32 # Check a slightly larger transitive program. Check01 isn't imported
33 # safely by Check03 so we don't require base trused at end.
34 test('Check04', normal, multi_compile, ['Check04', [
35                                        ('Check04_A.hs', ''),
36                                        ('Check04_B.hs', '-trust base'),
37                                        ('Check04_1.hs', '-trust base')
38                                        ], '-fpackage-trust'])
39
40 # Check -fpackage-trust with no safe haskell flag is an error
41 test('Check05', normal, compile, [''])
42
43 # Check safe-infered modules have correct pkg trust requirements
44 test('Check06', [], multimod_compile_fail, ['Check06', ''])
45
46 # Check selective safe imports bring in correct pkg trust requirements
47 test('Check07', [], multimod_compile, ['Check07', ''])
48
49 # Check selective safe imports bring in correct pkg trust requirements
50 test('Check08', [], multimod_compile_fail, ['Check08', ''])
51
52 # check -distrust-all-packages flag works
53 test('Check09',
54      normalise_version("bytestring"),
55      compile_fail,
56      ['-fpackage-trust -distrust-all-packages'])
57
58 # as above but trust this time
59 test('Check10', normal, compile,
60      ['-fpackage-trust -distrust-all-packages -trust bytestring -trust base'])
61