all.T 9.54 KB
Newer Older
1
2
import string
import re
3

4
5
6
7
8
9
10
11
12
13
14
#--------------------------------------
# Python normalization functions
#--------------------------------------

def normalise_quotes (str):
  str = re.sub(r'"',r'', str, flags=re.MULTILINE)
  return str

#--------------------------------------
# Test functions
#--------------------------------------
15
16
17
test('readFloat', exit_code(1), compile_and_run, [''])
test('enumDouble', normal, compile_and_run, [''])
test('enumRatio', normal, compile_and_run, [''])
18
test('enumNumeric', normal, compile_and_run, [''])
19
20
test('tempfiles', normal, compile_and_run, [''])
test('fixed', normal, compile_and_run, [''])
21
test('quotOverflow', normal, compile_and_run, [''])
22
test('assert', exit_code(1), compile_and_run, ['-fno-ignore-asserts'])
23
test('CPUTime001', normal, compile_and_run, [''])
24
25
test('readLitChar',   normal, compile_and_run, [''])
test('unicode001',
ian@well-typed.com's avatar
ian@well-typed.com committed
26
     when(platform('i386-unknown-openbsd'), expect_fail),
27
28
29
     compile_and_run,
     [''])
test('unicode002',
ian@well-typed.com's avatar
ian@well-typed.com committed
30
     when(platform('i386-unknown-openbsd'), expect_fail),
31
32
     compile_and_run,
     [''])
33
test('data-fixed-show-read', normal, compile_and_run, [''])
34
test('showDouble', normal, compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
35
test('readDouble001', normal, compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
36
test('readInteger001', normal, compile_and_run, [''])
37
test('readFixed001', normal, compile_and_run, [''])
38
test('lex001', normal, compile_and_run, [''])
39
test('take001', extra_run_opts('1'), compile_and_run, [''])
David Feuer's avatar
David Feuer committed
40
test('inits', normal, compile_and_run, [''])
41
test('genericNegative001', extra_run_opts('-1'), compile_and_run, [''])
Ian Lynagh's avatar
Ian Lynagh committed
42
test('ix001', normal, compile_and_run, [''])
43

Ian Lynagh's avatar
Ian Lynagh committed
44
45
# need to add -K64m to the compiler opts, so that GHCi gets it too
test('ioref001',
46
     [when(fast(), skip),extra_run_opts('+RTS -K64m -RTS')],
Ian Lynagh's avatar
Ian Lynagh committed
47
48
49
     compile_and_run,
     ['+RTS -K64m -RTS'])

50
51
52
53
54
55
56
57
58
59
60
61
62
63
test('echo001', set_stdin("echo001.hs"), compile_and_run, [''])

test('hTell001', normal, compile_and_run, [''])

test('hTell002', normal, compile_and_run, [''])

test('performGC001', normal, compile_and_run, [''])

# optimisation screws up this test because some of the traces get commoned up
test('trace001', normal, compile_and_run, [''])

test('hGetBuf002', normal, compile_and_run, [''])
test('hGetBuf003', normal, compile_and_run, [''])
test('hPutBuf001', normal, compile_and_run, [''])
64
test('hPutBuf002', [], compile_and_run, [''])
65
66
67
68
69
70

test('char001', 	normal, compile_and_run, [''])
test('char002', 	normal, compile_and_run, [''])

test('cstring001', 	normal, compile_and_run, [''])

thoughtpolice's avatar
thoughtpolice committed
71
test('length001',
72
73
74
75
76
77
     # length001 depends on a RULE being applied, and without -O takes
     # excessive amounts of stack space. So we specifically set a low
     # stack limit and mark it as failing under a few conditions.
     [extra_run_opts('+RTS -K8m -RTS'),
     expect_fail_for(['normal', 'threaded1', 'llvm'])],
     compile_and_run, [''])
78
79
80
81
82
83
84
85
86
87
88
89
90
91

test('ratio001', 	normal, compile_and_run, [''])

test('rand001',		reqlib('random'), compile_and_run, [''])
test('reads001',		normal, compile_and_run, [''])
test('show001',		normal, compile_and_run, [''])
test('text001',		normal, compile_and_run, [''])

test('tup001',		normal, compile_and_run, [''])

test('addr001',		normal, compile_and_run, [''])
test('dynamic001',      normal, compile_and_run, [''])
test('dynamic002',      normal, compile_and_run, [''])
test('dynamic003',      extra_run_opts('+RTS -K32m -RTS'), compile_and_run, [''])
92
test('dynamic004',      omit_ways(['normal', 'threaded1', 'ghci']), compile_and_run, [''])
93
test('dynamic005',      normal, compile_and_run, [''])
94

95
enum_setups = [when(fast(), skip)]
96
97
98
99
100
101
test('enum01',          [extra_files(['enum_processor.bat', 'enum_processor.py']),
                         enum_setups], compile_and_run, [''])
test('enum02',          [extra_files(['enum_processor.bat', 'enum_processor.py']),
                         enum_setups], compile_and_run, [''])
test('enum03',          [extra_files(['enum_processor.bat', 'enum_processor.py']),
                         enum_setups], compile_and_run, [''])
102
103
test('enum04',          normal, compile_and_run, [''])

Thomas Miedema's avatar
Thomas Miedema committed
104
test('exceptionsrun001',        normal, compile_and_run, [''])
105
test('exceptionsrun002', 	normal, compile_and_run, [''])
106
test('foldableArray',   normal, compile_and_run, [''])
107
108
109
test('list001'	,	when(fast(), skip), compile_and_run, [''])
test('list002', when(fast(), skip), compile_and_run, [''])
test('list003', when(fast(), skip), compile_and_run, [''])
110
test('isSuffixOf', normal, compile_and_run, [''])
111

112
113
test('memo001', [extra_files(['Memo1.lhs']),
                 extra_run_opts('+RTS -A10k -RTS')], multimod_compile_and_run,
114
     ['memo001', ''])
115

116
117
test('memo002', [extra_files(['Memo2.lhs']),
                 extra_run_opts('20')], multimod_compile_and_run,
118
     ['memo002', ''])
119
120

test('stableptr001',
121
     [when(fast(), skip), extra_run_opts('+RTS -K8m -RTS')],
122
123
124
125
126
127
128
     compile_and_run, [''])
test('stableptr003', normal, compile_and_run, [''])
test('stableptr004', extra_run_opts('+RTS -K4m -RTS'), compile_and_run, [''])
test('stableptr005', normal, compile_and_run, [''])

test('weak001', normal, compile_and_run, [''])

129
130
test('T2528', normal, compile_and_run, [''])

131
132
133
134
135
136
# In the 65001 codepage, we can't even cat the expected output on msys:
#     $ cat 4006.stdout
#     It works here
#     cat: write error: Permission denied
# Seems to be a known problem, e.g.
#     http://mingw-users.1079350.n2.nabble.com/Bug-re-Unicode-on-the-console-td3121717.html
137
# May 2014: seems to work on msys2
138
139
140
# May 2018: The behavior of printf seems very implementation dependent.
#     so let's normalise the output.
test('T4006', normalise_fun(normalise_quotes), compile_and_run, [''])
141

142
test('T5943', normal, compile_and_run, [''])
Ben Gamari's avatar
Ben Gamari committed
143
test('T5962', normal, compile_and_run, [''])
144
test('T7034', normal, compile_and_run, [''])
145

Simon Marlow's avatar
Simon Marlow committed
146
147
test('qsem001', normal, compile_and_run, [''])
test('qsemn001', normal, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
148
149

test('T7457', normal, compile_and_run, [''])
Simon Peyton Jones's avatar
Simon Peyton Jones committed
150
151
152

test('T7773', when(opsys('mingw32'), skip), compile_and_run, [''])
# Andreas says that T7773 will not (and should not) work on Windows
153
154
155
156

# Tests for kind-polymorphic Category
test('CatPairs', normal, compile, [''])
test('CatEntail', normal, compile, [''])
ian@well-typed.com's avatar
ian@well-typed.com committed
157

158
159
# When running with WAY=ghci, T7653 uses a lot of memory.
test('T7653', high_memory_usage, compile_and_run, [''])
Simon Marlow's avatar
Simon Marlow committed
160
test('T7787', normal, compile_and_run, [''])
161
162

test('topHandler01', when(opsys('mingw32'), skip), compile_and_run, [''])
163
164
165
test('topHandler02',
     [when(opsys('mingw32'), skip),
      omit_ways(['ghci']),
166
      signal_exit_code(2)
167
168
     ], compile_and_run, [''])
test('topHandler03',
Rufflewind's avatar
Rufflewind committed
169
     [when(opsys('mingw32'), skip), ignore_stderr,
170
      signal_exit_code(15)
171
     ], compile_and_run, [''])
172
173
174
175
test('topHandler04',
     [when(opsys('mingw32'), skip),
      exit_code(1)
     ], compile_and_run, [''])
176

Joachim Breitner's avatar
Joachim Breitner committed
177

Joachim Breitner's avatar
Joachim Breitner committed
178
test('T8766',
179
        [ stats_num_field('bytes allocated',
180
                          [ (wordsize(64), 16828144, 5)
Joachim Breitner's avatar
Joachim Breitner committed
181
182
183
	# with GHC-7.6.3: 83937384 (but faster execution than the next line)
	# before:         58771216 (without call-arity-analysis)
	# expected value: 16828144 (2014-01-14)
184
                          , (wordsize(32), 8433644, 5) ])
185
        , only_ways(['normal'])],
Joachim Breitner's avatar
Joachim Breitner committed
186
187
      compile_and_run,
      ['-O'])
eir@cis.upenn.edu's avatar
eir@cis.upenn.edu committed
188
189

test('T9111', normal, compile, [''])
190
test('T9395', normal, compile_and_run, [''])
191
192
# Fails for debug way due to annotation linting timeout
test('T9532', omit_ways(['debug']), compile_and_run, [''])
193
test('T9586', normal, compile, [''])
194
test('T9681', normal, compile_fail, [''])
195
196
197
198
199
200
201
202
203
204
# Test no runtime crash. Report success and kill with `timeout` (exit code 99)
# after a few seconds. From https://phabricator.haskell.org/D1075:
#
#   "I used a fairly conservative timeout. IF there is a regression it will
#   crash as soon as the timeout's C call is done. The tricky bit is
#   guesstimating how much time it needs to run to guarantee it's reached the
#   C call.
#   Probably something like 1s is already enough, but I don't know enough to
#   make an educated guess how long it needs to be guaranteed to reach the C
#   call."
205
test('T8089',
206
     [exit_code(99), run_timeout_multiplier(0.01)],
207
     compile_and_run, [''])
Ben Gamari's avatar
Ben Gamari committed
208
test('T8684', expect_broken(8684), compile_and_run, [''])
209
test('T9826',normal, compile_and_run,[''])
210
211
212
213
214
215
216
test('T9848',
        [ stats_num_field('bytes allocated',
                          [ (wordsize(64), 51840, 20)
                          , (wordsize(32), 47348, 20) ])
        , only_ways(['normal'])],
      compile_and_run,
      ['-O'])
217
test('T10149', normal, compile_and_run, [''])
Ben Gamari's avatar
Ben Gamari committed
218
test('T11334a', normal, compile_and_run, [''])
219
test('T11555', normal, compile_and_run, [''])
220
test('T12494', normal, compile_and_run, [''])
221
test('T12852', when(opsys('mingw32'), skip), compile_and_run, [''])
222
test('lazySTexamples', normal, compile_and_run, [''])
223
test('T11760', req_smp, compile_and_run, ['-threaded -with-rtsopts=-N2'])
224
test('T12874', normal, compile_and_run, [''])
David Feuer's avatar
David Feuer committed
225
226
227
228
229
230
231
232
test('T13191',
        [ stats_num_field('bytes allocated',
                          [ (wordsize(64), 185943272, 5) ])
        # with GHC-8.1 before liftA2 change: 325065128
        # GHC-8.1 with custom liftA2:        185943272
        , only_ways(['normal'])],
      compile_and_run,
      ['-O'])
233
test('T13525', when(opsys('mingw32'), skip), compile_and_run, [''])
ase's avatar
ase committed
234
test('T13097', normal, compile_and_run, [''])
235
test('functorOperators', normal, compile_and_run, [''])
Ben Gamari's avatar
Ben Gamari committed
236
237
238
239
test('T3474',
     [stats_num_field('max_bytes_used', [ (wordsize(64), 44504, 5) ]),
      only_ways(['normal'])],
     compile_and_run, ['-O'])
Ben Gamari's avatar
Ben Gamari committed
240
test('T14425', normal, compile_and_run, [''])
Ben Gamari's avatar
Ben Gamari committed
241
test('T10412', normal, compile_and_run, [''])
242
test('T13896', normal, compile_and_run, [''])
243
test('T13167', normal, compile_and_run, [''])
244
test('T15349', [exit_code(1), expect_broken_for(15349, 'ghci')], compile_and_run, [''])