7a5be6593c3abc0d031077d2e03f01a5f75e2445
[ghc.git] / testsuite / tests / plugins / all.T
1 setTestOpts(req_interp)
2
3 # The implementation of ghc-pkg doesn't seem to be multi-concurrent process safe
4 # on windows. These tests which mutate the package db need to be run
5 # sequentially until this is fixed.  This likely means that #13194 isn't fully
6 # solved.  See also #15313.
7
8 test('plugins01',
9      [extra_files(['simple-plugin/']), only_ways([config.ghc_plugin_way]),
10       when(opsys('mingw32'), multi_cpu_race),
11       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins01 TOP={top}')],
12      run_command, ['$MAKE -s --no-print-directory plugins01'])
13
14 test('plugins02',
15      [extra_files(['simple-plugin/']), only_ways([config.ghc_plugin_way]),
16       when(opsys('mingw32'), multi_cpu_race),
17       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins02 TOP={top}')],
18      compile_fail,
19      ['-package-db simple-plugin/pkg.plugins02/local.package.conf -fplugin Simple.BadlyTypedPlugin -package simple-plugin ' + config.plugin_way_flags])
20
21 test('plugins03',
22      [extra_files(['simple-plugin/']), only_ways([config.ghc_plugin_way]),
23       when(opsys('mingw32'), multi_cpu_race),
24       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins03 TOP={top}')],
25      compile_fail,
26      ['-package-db simple-plugin/pkg.plugins03/local.package.conf -fplugin Simple.NonExistentPlugin -package simple-plugin'])
27
28 test('plugins04',
29      [extra_files(['HomePackagePlugin.hs']),
30       only_ways([config.ghc_plugin_way]),
31       when(opsys('mingw32'), multi_cpu_race)],
32      multimod_compile_fail,
33      ['plugins04', '-package ghc -fplugin HomePackagePlugin'])
34
35 test('plugins05', [extra_files(['HomePackagePlugin.hs']),
36                    when(opsys('mingw32'), multi_cpu_race),
37                    only_ways([config.ghc_plugin_way])],
38      multimod_compile_and_run, ['plugins05', '-package ghc'])
39
40 test('plugins06',
41      [extra_files(['LinkerTicklingPlugin.hs']),
42       when(opsys('mingw32'), multi_cpu_race),
43       unless(have_dynamic(), skip),
44       only_ways([config.ghc_plugin_way])],
45      multimod_compile_and_run, ['plugins06', '-package ghc'])
46
47 test('plugins07',
48      [extra_files(['rule-defining-plugin/']),
49       when(opsys('mingw32'), multi_cpu_race),
50       only_ways([config.ghc_plugin_way]),
51       pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.plugins07 TOP={top}')],
52      run_command, ['$MAKE -s --no-print-directory plugins07'])
53
54 test('plugins08',
55      [extra_files(['simple-plugin/']),
56       when(opsys('mingw32'), multi_cpu_race),
57       only_ways([config.ghc_plugin_way]),
58       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins08 TOP={top}')],
59      run_command, ['$MAKE -s --no-print-directory plugins08'])
60
61 test('plugins09',
62      [extra_files(['simple-plugin/']),
63       when(opsys('mingw32'), multi_cpu_race),
64       only_ways([config.ghc_plugin_way]),
65       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins09 TOP={top}')],
66      run_command, ['$MAKE -s --no-print-directory plugins09'])
67
68 test('plugins10',
69      [extra_files(['simple-plugin/', 'QuasiQuotation.hs']),
70       when(opsys('mingw32'), multi_cpu_race),
71       only_ways([config.ghc_plugin_way]),
72       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins10 TOP={top}')],
73      run_command, ['$MAKE -s --no-print-directory plugins10'])
74
75 test('plugins11',
76      [extra_files(['simple-plugin/']),
77       when(opsys('mingw32'), multi_cpu_race),
78       only_ways([config.ghc_plugin_way]),
79       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins11 TOP={top}')],
80      run_command, ['$MAKE -s --no-print-directory plugins11'])
81
82 test('plugins12',
83      [extra_files(['simple-plugin/']),
84       when(opsys('mingw32'), multi_cpu_race),
85       only_ways([config.ghc_plugin_way]),
86       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins12 TOP={top}')],
87      run_command, ['$MAKE -s --no-print-directory plugins12'])
88
89 test('plugins13',
90      [extra_files(['simple-plugin/', 'PluginFilteredExport.hs']),
91       when(opsys('mingw32'), multi_cpu_race),
92       only_ways([config.ghc_plugin_way]),
93       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins13 TOP={top}')],
94      run_command, ['$MAKE -s --no-print-directory plugins13'])
95
96 test('plugins14',
97      [extra_files(['simple-plugin/']),
98       when(opsys('mingw32'), multi_cpu_race),
99       only_ways([config.ghc_plugin_way]),
100       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins14 TOP={top}')],
101      run_command, ['$MAKE -s --no-print-directory plugins14'])
102
103 test('plugins15',
104      [extra_files(['simple-plugin/', 'MetaRemoveHelper.hs']),
105       when(opsys('mingw32'), multi_cpu_race),
106       only_ways([config.ghc_plugin_way]),
107       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins15 TOP={top}')],
108      run_command, ['$MAKE -s --no-print-directory plugins15'])
109
110 test('T10420',
111      [extra_files(['rule-defining-plugin/']),
112       when(opsys('mingw32'), multi_cpu_race),
113       only_ways([config.ghc_plugin_way]),
114       pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.T10420 TOP={top}')],
115      run_command, ['$MAKE -s --no-print-directory T10420'])
116
117 test('T10294',
118      [extra_files(['annotation-plugin/']),
119       when(opsys('mingw32'), multi_cpu_race),
120       only_ways([config.ghc_plugin_way]),
121       pre_cmd('$MAKE -s --no-print-directory -C annotation-plugin package.T10294 TOP={top}')],
122      run_command, ['$MAKE -s --no-print-directory T10294'])
123
124 test('T10294a',
125      [extra_files(['annotation-plugin/']),
126       when(opsys('mingw32'), multi_cpu_race),
127       only_ways([config.ghc_plugin_way]),
128       pre_cmd('$MAKE -s --no-print-directory -C annotation-plugin package.T10294a TOP={top}')],
129      run_command, ['$MAKE -s --no-print-directory T10294a'])
130
131 test('frontend01', [extra_files(['FrontendPlugin.hs']),
132                     only_ways([config.ghc_plugin_way]),
133                     when(opsys('mingw32'), multi_cpu_race),
134                     unless(have_dynamic(), expect_broken(10301))], run_command,
135      ['$MAKE -s --no-print-directory frontend01'])
136
137 test('T11244',
138      [extra_files(['rule-defining-plugin/']),
139       only_ways([config.ghc_plugin_way]),
140       pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.T11244 TOP={top}')],
141      run_command, ['$MAKE -s --no-print-directory T11244'])
142
143 test('T12567a',
144      [extra_files(['T12567b.hs', 'simple-plugin/']),
145       when(opsys('mingw32'), multi_cpu_race),
146       only_ways([config.ghc_plugin_way]),
147       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.T12567a TOP={top}')],
148      run_command, ['$MAKE -s --no-print-directory T12567a'])
149
150 test('T14335',
151      [extra_files(['simple-plugin/', 'plugins01.hs']),
152       when(opsys('mingw32'), multi_cpu_race),
153       only_ways([config.ghc_plugin_way]),
154       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins01 TOP={top}')],
155      compile_fail,
156      ['-package-db simple-plugin/pkg.plugins01/local.package.conf -fplugin Simple.Plugin \
157        -fexternal-interpreter -package simple-plugin ' + config.plugin_way_flags])
158
159 test('plugin-recomp-pure',
160      [extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
161       when(opsys('mingw32'), multi_cpu_race),
162       only_ways([config.ghc_plugin_way]),
163       pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
164       ],
165      run_command, ['$MAKE -s --no-print-directory plugin-recomp-pure'])
166
167 test('plugin-recomp-impure',
168      [extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
169       when(opsys('mingw32'), multi_cpu_race),
170       only_ways([config.ghc_plugin_way]),
171       pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
172       ],
173      run_command, ['$MAKE -s --no-print-directory plugin-recomp-impure'])
174
175 test('plugin-recomp-flags',
176      [extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
177       when(opsys('mingw32'), multi_cpu_race),
178       only_ways([config.ghc_plugin_way]),
179       pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
180       ],
181      run_command, ['$MAKE -s --no-print-directory plugin-recomp-flags'])
182
183 test('plugin-recomp-change',
184      [extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
185       only_ways([config.ghc_plugin_way]),
186       pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
187       ],
188      run_command, ['$MAKE -s --no-print-directory plugin-recomp-change'])
189
190 test('plugin-recomp-change-prof',
191      [extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
192       only_ways([config.ghc_plugin_way]),
193       pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}'),
194       when(not config.have_profiling,skip)
195       ],
196      run_command, ['$MAKE -s --no-print-directory plugin-recomp-change-prof'])
197
198 test('static-plugins',
199      [extra_files(['simple-plugin/']),
200       unless(config.have_ext_interp, skip),
201       extra_run_opts('"' + config.libdir + '"')],
202      compile_and_run,
203      ['-package ghc -isimple-plugin/'])
204
205 test('T15858',
206      [extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
207 #      only_ways([config.ghc_plugin_way]),
208       pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}'),
209       extra_hc_opts("-package-db plugin-recomp/pkg.plugins01/local.package.conf ")
210       ],
211      ghci_script, ['T15858.script'])
212
213 test('T16104',
214      [extra_files(['T16104-plugin/']),
215       pre_cmd('$MAKE -s --no-print-directory -C T16104-plugin package.T16104-plugin TOP={top}')
216      ],
217      makefile_test, [])