Remove clean_cmd and extra_clean usage from .T files
[ghc.git] / testsuite / tests / safeHaskell / check / pkg01 / all.T
1 # Just do the normal way, SafeHaskell is all in the frontend
2 def f( name, opts ):
3   opts.only_ways = ['normal']
4
5 def ignoreLdOutput(str):
6     return re.sub('Creating library file: pdb.safePkg01/dist.build.libHSsafePkg01-1.0-ghc[0-9.]*.dll.a\n', '', str)
7
8 setTestOpts(f)
9
10 if config.have_vanilla:
11     vanilla = '--enable-library-vanilla'
12 else:
13     vanilla = '--disable-library-vanilla'
14
15 if config.have_profiling:
16     prof = '--enable-library-profiling'
17 else:
18     prof = '--disable-library-profiling'
19
20 if config.have_shared_libs:
21     dyn = '--enable-shared'
22 else:
23     dyn = '--disable-shared'
24
25 make_args = 'VANILLA=' + vanilla + ' PROF=' + prof + ' DYN=' + dyn
26
27 # Test building a package, that trust values are set correctly
28 # and can be changed correctly
29 test('safePkg01',
30      [normalise_errmsg_fun(ignoreLdOutput),
31       normalise_version("array", "integer-gmp", "integer-simple", "bytestring",
32                         "base", "deepseq", "ghc-prim")],
33      run_command, ['$MAKE -s --no-print-directory safePkg01 ' + make_args])
34
35 # Fail since we enable package trust
36 test('ImpSafe01', normal, compile_fail, ['-fpackage-trust -distrust base'])
37
38 # Succeed since we don't enable package trust
39 test('ImpSafe02', normal, compile, ['-distrust base'])
40
41 # Fail since we don't trust base of bytestring
42 test('ImpSafe03',
43   [normalise_version("bytestring")],
44   multi_compile_fail,
45   ['ImpSafe03 -trust base -distrust bytestring', [
46    ('ImpSafe03_A.hs', ' -trust base -trust bytestring')
47   ], '-fpackage-trust' ])
48
49 # Fail same as ImpSafe01 but testing with -XTrustworthy now
50 test('ImpSafe04', normal, compile_fail, ['-fpackage-trust -distrust base'])
51
52 test('ImpSafeOnly01',
53      [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly01 ' + make_args)],
54      compile,
55      ['-fpackage-trust -package-db pdb.ImpSafeOnly01/local.db -trust base'])
56
57 test('ImpSafeOnly02',
58      [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly02 ' + make_args)],
59      compile,
60      ['-fpackage-trust -package-db pdb.ImpSafeOnly02/local.db -trust base -trust safePkg01'])
61
62 # Fail since we enable package trust (and still need safePkg01 trusted)
63 test('ImpSafeOnly03',
64      [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly03 ' + make_args)],
65      compile_fail,
66      ['-fpackage-trust -package-db pdb.ImpSafeOnly03/local.db -trust base'])
67
68 # Succeed since we don't enable package trust
69 test('ImpSafeOnly04',
70      [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly04 ' + make_args)],
71      compile, ['-package-db pdb.ImpSafeOnly04/local.db -trust base'])
72
73 # fail due to missing trust of safePkg01, next test succeeds.
74 test('ImpSafeOnly05',
75      [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly05 ' + make_args)],
76      compile_fail,
77      ['-fpackage-trust -package-db pdb.ImpSafeOnly05/local.db -trust base'])
78 test('ImpSafeOnly06',
79      [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly06 ' + make_args)],
80      compile,
81      ['-fpackage-trust -package-db pdb.ImpSafeOnly06/local.db -trust base -trust safePkg01'])
82
83 # fail due to missing trust
84 test('ImpSafeOnly07',
85      [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly07 ' + make_args),
86       normalise_version("bytestring", "base")],
87      compile_fail,
88      ['-fpackage-trust -package-db pdb.ImpSafeOnly07/local.db -trust safePkg01 -distrust bytestring'])
89 test('ImpSafeOnly08',
90      [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly08 ' + make_args),
91       normalise_version("bytestring", "base")],
92      compile_fail,
93      ['-fpackage-trust -package-db pdb.ImpSafeOnly08/local.db -trust safePkg01'])
94 test('ImpSafeOnly09',
95      [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly09 ' + make_args),
96       normalise_version("bytestring")],
97      compile_fail,
98      ['-fpackage-trust -package-db pdb.ImpSafeOnly09/local.db -trust safePkg01'])
99
100 # finally succeed
101 test('ImpSafeOnly10',
102      [pre_cmd('$MAKE -s --no-print-directory mkPackageDatabase.ImpSafeOnly10 ' + make_args)],
103      compile,
104      ['-fpackage-trust -package-db pdb.ImpSafeOnly10/local.db -trust safePkg01 -trust base -trust bytestring'])