6899e40ff05b9a978b6d3aeae89b940e997efc6c
[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)]
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('stableptr001',
107      [when(fast(), skip), extra_run_opts('+RTS -K8m -RTS')],
108      compile_and_run, [''])
109 test('stableptr003', normal, compile_and_run, [''])
110 test('stableptr004', extra_run_opts('+RTS -K4m -RTS'), compile_and_run, [''])
111 test('stableptr005', normal, compile_and_run, [''])
112
113 test('weak001', normal, compile_and_run, [''])
114
115 test('T2528', normal, compile_and_run, [''])
116
117 # In the 65001 codepage, we can't even cat the expected output on msys:
118 #     $ cat 4006.stdout
119 #     It works here
120 #     cat: write error: Permission denied
121 # Seems to be a known problem, e.g.
122 #     http://mingw-users.1079350.n2.nabble.com/Bug-re-Unicode-on-the-console-td3121717.html
123 # May 2014: seems to work on msys2
124 test('T4006', normal, compile_and_run, [''])
125
126 test('T5943', normal, compile_and_run, [''])
127 test('T5962', normal, compile_and_run, [''])
128 test('T7034', normal, compile_and_run, [''])
129
130 test('qsem001', normal, compile_and_run, [''])
131 test('qsemn001', normal, compile_and_run, [''])
132
133 test('T7457', normal, compile_and_run, [''])
134
135 test('T7773', when(opsys('mingw32'), skip), compile_and_run, [''])
136 # Andreas says that T7773 will not (and should not) work on Windows
137
138 # Tests for kind-polymorphic Category
139 test('CatPairs', normal, compile, [''])
140 test('CatEntail', normal, compile, [''])
141
142 # When running with WAY=ghci, T7653 uses a lot of memory.
143 test('T7653', high_memory_usage, compile_and_run, [''])
144 test('T7787', normal, compile_and_run, [''])
145
146 def stderr_contains(pattern):
147     return normalise_errmsg_fun(lambda s: pattern if pattern in s else s)
148
149 test('topHandler01', when(opsys('mingw32'), skip), compile_and_run, [''])
150 test('topHandler02',
151      [when(opsys('mingw32'), skip),
152       omit_ways(['ghci']),
153       signal_exit_code(2)
154      ], compile_and_run, [''])
155 test('topHandler03',
156      [when(opsys('mingw32'), skip), stderr_contains('Terminated'),
157       signal_exit_code(15)
158      ], compile_and_run, [''])
159 test('topHandler04',
160      [when(opsys('mingw32'), skip),
161       exit_code(1)
162      ], compile_and_run, [''])
163
164
165 test('T8766',
166         [ stats_num_field('bytes allocated',
167                           [ (wordsize(64), 16828144, 5)
168         # with GHC-7.6.3: 83937384 (but faster execution than the next line)
169         # before:         58771216 (without call-arity-analysis)
170         # expected value: 16828144 (2014-01-14)
171                           , (wordsize(32), 8433644, 5) ])
172         , only_ways(['normal'])],
173       compile_and_run,
174       ['-O'])
175
176 test('T9111', normal, compile, [''])
177 test('T9395', normal, compile_and_run, [''])
178 # Fails for debug way due to annotation linting timeout
179 test('T9532', omit_ways(['debug']), compile_and_run, [''])
180 test('T9586', normal, compile, [''])
181 test('T9681', normal, compile_fail, [''])
182 # Test no runtime crash. Report success and kill with `timeout` (exit code 99)
183 # after a few seconds. From https://phabricator.haskell.org/D1075:
184 #
185 #   "I used a fairly conservative timeout. IF there is a regression it will
186 #   crash as soon as the timeout's C call is done. The tricky bit is
187 #   guesstimating how much time it needs to run to guarantee it's reached the
188 #   C call.
189 #   Probably something like 1s is already enough, but I don't know enough to
190 #   make an educated guess how long it needs to be guaranteed to reach the C
191 #   call."
192 test('T8089',
193      [exit_code(99), run_timeout_multiplier(0.01)],
194      compile_and_run, [''])
195 test('T9826',normal, compile_and_run,[''])
196 test('T9848',
197         [ stats_num_field('bytes allocated',
198                           [ (wordsize(64), 51840, 20)
199                           , (wordsize(32), 47348, 20) ])
200         , only_ways(['normal'])],
201       compile_and_run,
202       ['-O'])
203 test('T10149', normal, compile_and_run, [''])
204 test('T11334a', normal, compile_and_run, [''])
205 test('T11555', normal, compile_and_run, [''])
206 test('T12852', when(opsys('mingw32'), skip), compile_and_run, [''])