1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
setTestOpts([
req_interp,
# The implementation of ghc-pkg doesn't seem to be multi-concurrent process
# safe on windows. These tests which mutate the package db need to be run
# sequentially until this is fixed. This likely means that #13194 isn't fully
# solved. See also #15313.
when(opsys('mingw32'), multi_cpu_race),
# Unfortunately even with the above these tests are incredibly flaky on Windows.
# In any given testsuite run at least half a dozen fail for one reason of another
# (typically a cmmbination of timeouts, some missing static archive errors from ld,
# and a few plain crashes).
when(opsys('mingw32'), fragile(16405))
])
test('plugins01',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins01 TOP={top}')],
makefile_test, [])
test('plugins02',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins02 TOP={top}')],
compile_fail,
['-package-db simple-plugin/pkg.plugins02/local.package.conf -fplugin Simple.BadlyTypedPlugin -package simple-plugin ' + config.plugin_way_flags])
test('plugins03',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins03 TOP={top}')],
compile_fail,
['-package-db simple-plugin/pkg.plugins03/local.package.conf -fplugin Simple.NonExistentPlugin -package simple-plugin'])
test('plugins04',
[extra_files(['HomePackagePlugin.hs'])],
multimod_compile_fail,
['plugins04', '-package ghc -fplugin HomePackagePlugin'])
test('plugins05', [extra_files(['HomePackagePlugin.hs'])],
multimod_compile_and_run, ['plugins05', '-package ghc ' + config.plugin_way_flags ])
test('plugins06',
[extra_files(['LinkerTicklingPlugin.hs']),
unless(have_dynamic(), skip)],
multimod_compile_and_run, ['plugins06', '-package ghc -dppr-debug ' + config.plugin_way_flags ])
test('plugins07',
[extra_files(['rule-defining-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.plugins07 TOP={top}')],
makefile_test, [])
test('plugins08',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins08 TOP={top}')],
makefile_test, [])
test('plugins09',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins09 TOP={top}')],
makefile_test, [])
test('plugins10',
[extra_files(['simple-plugin/', 'QuasiQuotation.hs']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins10 TOP={top}')],
makefile_test, [])
test('plugins11',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins11 TOP={top}')],
makefile_test, [])
test('plugins12',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins12 TOP={top}')],
makefile_test, [])
test('plugins13',
[extra_files(['simple-plugin/', 'PluginFilteredExport.hs']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins13 TOP={top}')],
makefile_test, [])
test('plugins14',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins14 TOP={top}')],
makefile_test, [])
test('plugins15',
[extra_files(['simple-plugin/', 'MetaRemoveHelper.hs']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins15 TOP={top}')],
makefile_test, [])
test('T10420',
[extra_files(['rule-defining-plugin/']),
when(opsys('mingw32'), expect_broken(21322)),
pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.T10420 TOP={top}')],
makefile_test, [])
test('T10294',
[extra_files(['annotation-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C annotation-plugin package.T10294 TOP={top}')],
makefile_test, [])
test('T10294a',
[extra_files(['annotation-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C annotation-plugin package.T10294a TOP={top}')],
makefile_test, [])
test('frontend01', [extra_files(['FrontendPlugin.hs'])],
makefile_test, [])
test('T11244',
[extra_files(['rule-defining-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.T11244 TOP={top}')],
makefile_test, [])
test('T12567a',
[extra_files(['T12567b.hs', 'simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.T12567a TOP={top}')],
makefile_test, [])
test('T14335',
[extra_files(['simple-plugin/', 'plugins01.hs']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins01 TOP={top}')],
compile_fail,
['-package-db simple-plugin/pkg.plugins01/local.package.conf -fplugin Simple.Plugin \
-fexternal-interpreter -package simple-plugin ' + config.plugin_way_flags])
test('plugin-recomp-pure',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
makefile_test, [])
test('plugin-recomp-impure',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
makefile_test, [])
test('plugin-recomp-flags',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
makefile_test, [])
test('plugin-recomp-change',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
makefile_test, [])
test('plugin-recomp-change-prof',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}'),
when(not config.have_profiling,skip)
],
makefile_test, [])
test('static-plugins',
[extra_files(['simple-plugin/']),
unless(config.have_RTS_linker, skip),
expect_broken_for(16803, prof_ways),
extra_run_opts('"' + config.libdir + '"')],
compile_and_run,
['-package ghc -isimple-plugin/'])
test('T15858',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
#
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}'),
extra_hc_opts("-package-db plugin-recomp/pkg.plugins01/local.package.conf ")
],
ghci_script, ['T15858.script'])
test('T16104',
[extra_files(['T16104-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C T16104-plugin package.T16104-plugin TOP={top}')
],
makefile_test, [])
test('T16260',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.T16260 TOP={top}')
],
makefile_test, [])
test('T19926',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.T19926 TOP={top}')
],
makefile_test, [])
test('test-hole-plugin',
[extra_files(['hole-fit-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C hole-fit-plugin package.hole-fit-plugin TOP={top}'),
extra_hc_opts('-package-db hole-fit-plugin/pkg.hole-fit-plugin/local.package.conf '+ config.plugin_way_flags),
req_th
],
compile, ['-fdefer-typed-holes'])
test('test-hooks-plugin',
[extra_files(['hooks-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C hooks-plugin package.hooks-plugin TOP={top}'),
# The following doesn't seem to work, even though it
# seems identical to the previous test...?
# extra_hc_opts('-package-db hooks-plugin/pkg.hooks-plugin/local.package.conf '+ config.plugin_way_flags),
req_th
],
compile_and_run,
['-package-db hooks-plugin/pkg.hooks-plugin/local.package.conf '+ config.plugin_way_flags])
test('plugins-ghci', [extra_files(['HomePackagePlugin.hs']), only_ways(['ghci'])], compile_and_run, ['-package ghc'])
test('plugin-recomp-change-2',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs', 'PluginRecompTest.hs']),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
makefile_test, [])
test('T20417',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
makefile_test, [])
test('T20218',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.T20218 TOP={top}'),
grep_errmsg(r'-lHSsimple-plugin'),
ignore_stdout
],
makefile_test, [])
test('T20218b',
[extra_files(['simple-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.T20218b TOP={top}')
],
makefile_test, [])
test('test-defaulting-plugin',
[extra_files(['defaulting-plugin/']),
when(opsys('mingw32'), fragile(21293)),
pre_cmd('$MAKE -s --no-print-directory -C defaulting-plugin package.test-defaulting-plugin TOP={top}')],
makefile_test, [])
test('test-defaulting-plugin-fail',
[extra_files(['defaulting-plugin/']),
when(opsys('mingw32'), fragile(21293)),
pre_cmd('$MAKE -s --no-print-directory -C defaulting-plugin package.test-defaulting-plugin-fail TOP={top}')],
makefile_test, [])
test('plugins-order',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
makefile_test, [])
test('plugins-order-pragma',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
makefile_test, [])
test('T20803a',
[extra_files(['T20803-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C T20803-plugin package.T20803a TOP={top}')],
compile,
['-package-db T20803-plugin/pkg.T20803a/local.package.conf -fplugin FixErrorsPlugin -package T20803-plugin ' + config.plugin_way_flags])
test('T20803b',
[extra_files(['T20803-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C T20803-plugin package.T20803b TOP={top}')],
compile_fail,
['-package-db T20803-plugin/pkg.T20803b/local.package.conf -fplugin AddErrorPlugin -package T20803-plugin ' + config.plugin_way_flags])
test('test-echo-in-turn',
[extra_files(['echo-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C echo-plugin package.test-echo-in-turn TOP={top}')],
makefile_test, [])
test('test-echo-in-line',
[extra_files(['echo-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C echo-plugin package.test-echo-in-line TOP={top}')],
makefile_test, [])
test('test-echo-in-turn-many-args',
[extra_files(['echo-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C echo-plugin package.test-echo-in-turn-many-args TOP={top}')],
makefile_test, [])
test('test-echo-in-line-many-args',
[extra_files(['echo-plugin/']),
pre_cmd('$MAKE -s --no-print-directory -C echo-plugin package.test-echo-in-line-many-args TOP={top}')],
makefile_test, [])
|