summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-08-23 15:15:03 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-23 23:39:49 -0400
commit886ecd31335693f3540f5a42873a8923ad199574 (patch)
tree732c4ab0e1a1765ab8051a0f5cf7555c6b233678
parent64696202322db58189c9b1384130729aa6beea29 (diff)
downloadhaskell-886ecd31335693f3540f5a42873a8923ad199574.tar.gz
Add plugin-recomp-change-2 test
This test tests that if there are two modules which use a plugin specified on the command line then both are recompiled when the plugin changes.
-rw-r--r--testsuite/tests/plugins/Makefile7
-rw-r--r--testsuite/tests/plugins/PluginRecompTest.hs3
-rw-r--r--testsuite/tests/plugins/all.T7
-rw-r--r--testsuite/tests/plugins/plugin-recomp-change-2.stderr12
4 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/plugins/Makefile b/testsuite/tests/plugins/Makefile
index 2ae8aadae2..e242a0a387 100644
--- a/testsuite/tests/plugins/Makefile
+++ b/testsuite/tests/plugins/Makefile
@@ -139,3 +139,10 @@ T19926:
.PHONY: HoleFitPlugin
HoleFitPlugin:
"$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 HoleFitPlugin.hs -package-db hole-fit-plugin/pkg.hole-fit-plugin/local.package.conf
+
+# Should recompile the module because the plugin changed
+.PHONY: plugin-recomp-change-2
+plugin-recomp-change-2:
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 plugin-recomp-test.hs PluginRecompTest.hs -package-db plugin-recomp/pkg.plugins01/local.package.conf -fplugin PurePlugin
+ "$(MAKE)" -s --no-print-directory -C plugin-recomp package.plugins01 TOP=$(TOP) RUN=-DRUN2
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 plugin-recomp-test.hs PluginRecompTest.hs -package-db plugin-recomp/pkg.plugins01/local.package.conf -fplugin PurePlugin
diff --git a/testsuite/tests/plugins/PluginRecompTest.hs b/testsuite/tests/plugins/PluginRecompTest.hs
new file mode 100644
index 0000000000..662653d825
--- /dev/null
+++ b/testsuite/tests/plugins/PluginRecompTest.hs
@@ -0,0 +1,3 @@
+module PluginRecompTest where
+
+
diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T
index 7e8dbb52ef..fc0abca043 100644
--- a/testsuite/tests/plugins/all.T
+++ b/testsuite/tests/plugins/all.T
@@ -233,3 +233,10 @@ test('test-hooks-plugin',
['-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']),
+ only_ways([config.ghc_plugin_way]),
+ pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
+ ],
+ makefile_test, [])
diff --git a/testsuite/tests/plugins/plugin-recomp-change-2.stderr b/testsuite/tests/plugins/plugin-recomp-change-2.stderr
new file mode 100644
index 0000000000..2239925d2e
--- /dev/null
+++ b/testsuite/tests/plugins/plugin-recomp-change-2.stderr
@@ -0,0 +1,12 @@
+Simple Plugin Passes Queried
+Got options:
+Simple Plugin Pass Run
+Simple Plugin Passes Queried
+Got options:
+Simple Plugin Pass Run
+Simple Plugin Passes Queried
+Got options:
+Simple Plugin Pass Run 2
+Simple Plugin Passes Queried
+Got options:
+Simple Plugin Pass Run 2