all.T 3.04 KB
Newer Older
1
2
3
4
# safeInfered tests are for testing that the Safe Haskell
# mode safe inference works correctly.

# Just do the normal way, SafeHaskell is all in the frontend
5
def f( name, opts ):
6
7
8
9
10
  opts.only_ways = ['normal']

setTestOpts(f)

# Tests that should compile fine as they should be infered safe
Simon Marlow's avatar
Simon Marlow committed
11
12
13
14
15
16
17
18
19
20
21
22
test('SafeInfered01',
     [ extra_clean(['SafeInfered01_A.hi', 'SafeInfered01_A.o']) ],
     multimod_compile, ['SafeInfered01', ''])
test('SafeInfered02',
     [ extra_clean(['SafeInfered02_A.hi', 'SafeInfered02_A.o']) ],
     multimod_compile, ['SafeInfered02', ''])
test('SafeInfered03',
     [ extra_clean(['SafeInfered03_A.hi', 'SafeInfered03_A.o']) ],
      multimod_compile, ['SafeInfered03', ''])
test('SafeInfered04',
     [ extra_clean(['SafeInfered04_A.hi', 'SafeInfered04_A.o']) ],
     multimod_compile, ['SafeInfered04', ''])
23

24
25
26
27
28
# Test should fail, tests an earlier bug in 7.8
# test('SafeInfered05',
#      [ extra_clean(['SafeInfered05_A.hi', 'SafeInfered05_A.o']) ],
#      multimod_compile_fail, ['SafeInfered05', ''])

29
# Tests that should fail to compile as they should be infered unsafe
Simon Marlow's avatar
Simon Marlow committed
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
test('UnsafeInfered01',
     [ extra_clean(['UnsafeInfered01_A.hi', 'UnsafeInfered01_A.o']) ],
     multimod_compile_fail, ['UnsafeInfered01', ''])
test('UnsafeInfered02',
     [ extra_clean(['UnsafeInfered02_A.hi', 'UnsafeInfered02_A.o']) ],
     multimod_compile_fail, ['UnsafeInfered02', ''])
test('UnsafeInfered03',
     [ extra_clean(['UnsafeInfered03_A.hi', 'UnsafeInfered03_A.o']) ],
     multimod_compile_fail, ['UnsafeInfered03', ''])
test('UnsafeInfered05',
     [ extra_clean(['UnsafeInfered05_A.hi', 'UnsafeInfered05_A.o']) ],
     multimod_compile_fail, ['UnsafeInfered05', ''])
test('UnsafeInfered06',
     [ extra_clean(['UnsafeInfered06_A.hi', 'UnsafeInfered06_A.o']) ],
     multimod_compile_fail, ['UnsafeInfered06', ''])
test('UnsafeInfered07',
     [ extra_clean(['UnsafeInfered07_A.hi', 'UnsafeInfered07_A.o']) ],
     multimod_compile_fail, ['UnsafeInfered07', ''])
test('UnsafeInfered08',
     [ extra_clean(['UnsafeInfered08_A.hi', 'UnsafeInfered08_A.o']) ],
     multimod_compile_fail, ['UnsafeInfered08', ''])
test('UnsafeInfered09',
     [ extra_clean(['UnsafeInfered09_A.hi', 'UnsafeInfered09_A.o',
                    'UnsafeInfered09_B.hi', 'UnsafeInfered09_B.o']) ],
     multimod_compile_fail, ['UnsafeInfered09', ''])
55

56
57
58
59
60
61
62
63
# Test that should fail as we disable safe inference
test('UnsafeInfered10',
     [ extra_clean(['UnsafeInfered10_A.hi', 'UnsafeInfered10_A.o']) ],
     multimod_compile_fail, ['UnsafeInfered10', ''])
test('UnsafeInfered11',
     [ extra_clean(['UnsafeInfered11_A.hi', 'UnsafeInfered11_A.o']) ],
     multimod_compile_fail, ['UnsafeInfered11', ''])

64
# Test should fail as unsafe and we made warn unsafe + -Werror
65
test('UnsafeInfered12', normal, compile_fail, [''])
66
67
68
test('UnsafeInfered13', normal, compile_fail, [''])
test('UnsafeInfered14', normal, compile_fail, [''])
test('UnsafeInfered15', normal, compile_fail, [''])
69

70
71
72
# Mixed tests
test('Mixed01', normal, compile_fail, [''])
test('Mixed02', normal, compile_fail, [''])
73
test('Mixed03', normal, compile_fail, [''])
74