Make `catch` lazy in the action
[ghc.git] / libraries / base / tests / all.T
1
2 test('readFloat', exit_code(1), compile_and_run, [''])
3 test('enumDouble', normal, compile_and_run, [''])
4 test('enumRatio', normal, compile_and_run, [''])
5 test('tempfiles', normal, compile_and_run, [''])
6 test('fixed', normal, compile_and_run, [''])
7 test('quotOverflow', normal, compile_and_run, [''])
8 test('assert', exit_code(1), compile_and_run, ['-fno-ignore-asserts'])
9 test('CPUTime001', normal, compile_and_run, [''])
10 test('readLitChar',   normal, compile_and_run, [''])
11 test('unicode001',
12      when(platform('i386-unknown-openbsd'), expect_fail),
13      compile_and_run,
14      [''])
15 test('unicode002',
16      when(platform('i386-unknown-openbsd'), expect_fail),
17      compile_and_run,
18      [''])
19 test('data-fixed-show-read', normal, compile_and_run, [''])
20 test('showDouble', normal, compile_and_run, [''])
21 test('readDouble001', normal, compile_and_run, [''])
22 test('readInteger001', normal, compile_and_run, [''])
23 test('readFixed001', normal, compile_and_run, [''])
24 test('lex001', normal, compile_and_run, [''])
25 test('take001', extra_run_opts('1'), compile_and_run, [''])
26 test('inits', normal, compile_and_run, [''])
27 test('genericNegative001', extra_run_opts('-1'), compile_and_run, [''])
28 test('ix001', normal, compile_and_run, [''])
29
30 # need to add -K64m to the compiler opts, so that GHCi gets it too
31 test('ioref001',
32      [when(fast(), skip),extra_run_opts('+RTS -K64m -RTS')],
33      compile_and_run,
34      ['+RTS -K64m -RTS'])
35
36 test('echo001', set_stdin("echo001.hs"), compile_and_run, [''])
37
38 test('hTell001', normal, compile_and_run, [''])
39
40 test('hTell002', normal, compile_and_run, [''])
41
42 test('performGC001', normal, compile_and_run, [''])
43
44 # optimisation screws up this test because some of the traces get commoned up
45 test('trace001', normal, compile_and_run, [''])
46
47 test('hGetBuf002', normal, compile_and_run, [''])
48 test('hGetBuf003', normal, compile_and_run, [''])
49 test('hPutBuf001', normal, compile_and_run, [''])
50 test('hPutBuf002', extra_clean(['hPutBuf002.out']), compile_and_run, [''])
51
52 test('char001',         normal, compile_and_run, [''])
53 test('char002',         normal, compile_and_run, [''])
54
55 test('cstring001',      normal, compile_and_run, [''])
56
57 test('length001',
58      # length001 depends on a RULE being applied, and without -O takes
59      # excessive amounts of stack space. So we specifically set a low
60      # stack limit and mark it as failing under a few conditions.
61      [extra_run_opts('+RTS -K8m -RTS'),
62      expect_fail_for(['normal', 'threaded1', 'llvm'])],
63      compile_and_run, [''])
64
65 test('ratio001',        normal, compile_and_run, [''])
66
67 test('rand001',         reqlib('random'), compile_and_run, [''])
68 test('reads001',                normal, compile_and_run, [''])
69 test('show001',         normal, compile_and_run, [''])
70 test('text001',         normal, compile_and_run, [''])
71
72 test('tup001',          normal, compile_and_run, [''])
73
74 test('addr001',         normal, compile_and_run, [''])
75 test('dynamic001',      normal, compile_and_run, [''])
76 test('dynamic002',      normal, compile_and_run, [''])
77 test('dynamic003',      extra_run_opts('+RTS -K32m -RTS'), compile_and_run, [''])
78 test('dynamic004',      omit_ways(['normal', 'threaded1', 'ghci']), compile_and_run, [''])
79 test('dynamic005',      normal, compile_and_run, [''])
80
81 enum_setups = [when(fast(), skip), when(opsys('mingw32'), expect_broken(9399))]
82 test('enum01',          enum_setups, compile_and_run, [''])
83 test('enum02',          enum_setups, compile_and_run, [''])
84 test('enum03',          enum_setups, compile_and_run, [''])
85 test('enum04',          normal, compile_and_run, [''])
86
87 test('exceptionsrun001',        normal, compile_and_run, [''])
88 test('exceptionsrun002',        normal, compile_and_run, [''])
89 test('foldableArray',   normal, compile_and_run, [''])
90 test('list001'  ,       when(fast(), skip), compile_and_run, [''])
91 test('list002', when(fast(), skip), compile_and_run, [''])
92 test('list003', when(fast(), skip), compile_and_run, [''])
93 test('isSuffixOf', normal, compile_and_run, [''])
94
95 test('memo001',
96      [extra_run_opts('+RTS -A10k -RTS'),
97       extra_clean(['Memo1.hi', 'Memo1.o'])],
98      multimod_compile_and_run,
99      ['memo001',''])
100
101 test('memo002',
102      [extra_run_opts('20'),
103       extra_clean(['Memo2.hi', 'Memo2.o'])],
104         multimod_compile_and_run, ['memo002',''])
105
106 test('packedstring001', reqlib('packedstring'), compile_and_run, ['-package packedstring'])
107
108 test('stableptr001',
109      [when(fast(), skip), extra_run_opts('+RTS -K8m -RTS')],
110      compile_and_run, [''])
111 test('stableptr003', normal, compile_and_run, [''])
112 test('stableptr004', extra_run_opts('+RTS -K4m -RTS'), compile_and_run, [''])
113 test('stableptr005', normal, compile_and_run, [''])
114
115 test('weak001', normal, compile_and_run, [''])
116
117 test('T2528', normal, compile_and_run, [''])
118
119 # In the 65001 codepage, we can't even cat the expected output on msys:
120 #     $ cat 4006.stdout
121 #     It works here
122 #     cat: write error: Permission denied
123 # Seems to be a known problem, e.g.
124 #     http://mingw-users.1079350.n2.nabble.com/Bug-re-Unicode-on-the-console-td3121717.html
125 # May 2014: seems to work on msys2
126 test('T4006', normal, compile_and_run, [''])
127
128 test('T5943', normal, compile_and_run, [''])
129 test('T5962', normal, compile_and_run, [''])
130 test('T7034', normal, compile_and_run, [''])
131
132 test('qsem001', normal, compile_and_run, [''])
133 test('qsemn001', normal, compile_and_run, [''])
134
135 test('T7457', normal, compile_and_run, [''])
136
137 test('T7773', when(opsys('mingw32'), skip), compile_and_run, [''])
138 # Andreas says that T7773 will not (and should not) work on Windows
139
140 # Tests for kind-polymorphic Category
141 test('CatPairs', normal, compile, [''])
142 test('CatEntail', normal, compile, [''])
143
144 # When running with WAY=ghci, T7653 uses a lot of memory.
145 test('T7653', high_memory_usage, compile_and_run, [''])
146 test('T7787', normal, compile_and_run, [''])
147
148 test('topHandler01', when(opsys('mingw32'), skip), compile_and_run, [''])
149 test('topHandler02',
150      [when(opsys('mingw32'), skip),
151       omit_ways(['ghci']),
152       # Irritatingly, the test driver calls the programs via a shell, and
153       # depending on the shell, they can add their own "helpful" commentary,
154       # pretty printing the name of the signal that killed the process. So we
155       # ignore the stdout here, we only care about the exit code (which itself
156       # is messed up because of the shell, using 128+sig encoding)
157       ignore_output,
158       signal_exit_code(2)
159      ], compile_and_run, [''])
160 test('topHandler03',
161      [when(opsys('mingw32'), skip),
162       # As above, shells, grrr.
163       ignore_output,
164       signal_exit_code(15)
165      ], compile_and_run, [''])
166 test('topHandler04',
167      [when(opsys('mingw32'), skip),
168       exit_code(1)
169      ], compile_and_run, [''])
170
171
172 test('T8766',
173         [ stats_num_field('bytes allocated',
174                           [ (wordsize(64), 16828144, 5)
175         # with GHC-7.6.3: 83937384 (but faster execution than the next line)
176         # before:         58771216 (without call-arity-analysis)
177         # expected value: 16828144 (2014-01-14)
178                           , (wordsize(32), 8433644, 5) ])
179         , only_ways(['normal'])],
180       compile_and_run,
181       ['-O'])
182
183 test('T9111', normal, compile, [''])
184 test('T9395', normal, compile_and_run, [''])
185 # Fails for debug way due to annotation linting timeout
186 test('T9532', omit_ways(['debug']), compile_and_run, [''])
187 test('T9586', normal, compile, [''])
188 test('T9681', normal, compile_fail, [''])
189 # Test no runtime crash. Report success and kill with `timeout` (exit code 99)
190 # after a few seconds. From https://phabricator.haskell.org/D1075:
191 #
192 #   "I used a fairly conservative timeout. IF there is a regression it will
193 #   crash as soon as the timeout's C call is done. The tricky bit is
194 #   guesstimating how much time it needs to run to guarantee it's reached the
195 #   C call.
196 #   Probably something like 1s is already enough, but I don't know enough to
197 #   make an educated guess how long it needs to be guaranteed to reach the C
198 #   call."
199 test('T8089', [exit_code(99),
200                run_timeout_multiplier(0.01),
201                when(opsys('mingw32'),
202                     expect_broken_for(7325, ['normal', 'hpc', 'optasm'])),
203                ],
204               compile_and_run, [''])
205 test('T9826',normal, compile_and_run,[''])
206 test('T9848',
207         [ stats_num_field('bytes allocated',
208                           [ (wordsize(64), 51840, 20)
209                           , (wordsize(32), 47348, 20) ])
210         , only_ways(['normal'])],
211       compile_and_run,
212       ['-O'])
213 test('T10149', normal, compile_and_run, [''])
214 test('T11334', normal, compile_and_run, [''])
215 test('T11555', normal, compile_and_run, [''])