summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/.gitignore1
-rw-r--r--testsuite/tests/ghc-api/T9595.hs3
-rw-r--r--testsuite/tests/plugins/Makefile16
-rw-r--r--testsuite/tests/plugins/T11244.hs1
-rw-r--r--testsuite/tests/plugins/T11244.stderr3
-rw-r--r--testsuite/tests/plugins/all.T6
6 files changed, 26 insertions, 4 deletions
diff --git a/testsuite/.gitignore b/testsuite/.gitignore
index ef3e720e24..2886400681 100644
--- a/testsuite/.gitignore
+++ b/testsuite/.gitignore
@@ -1243,6 +1243,7 @@ mk/ghcconfig*_test___spaces_ghc*.exe.mk
/tests/plugins/plugins06
/tests/plugins/plugins07
/tests/plugins/rule-defining-plugin/pkg.T10420/
+/tests/plugins/rule-defining-plugin/pkg.T11244/
/tests/plugins/rule-defining-plugin/pkg.plugins07/
/tests/plugins/simple-plugin/dist/
/tests/plugins/simple-plugin/install/
diff --git a/testsuite/tests/ghc-api/T9595.hs b/testsuite/tests/ghc-api/T9595.hs
index d4e01d070c..0f71d7700b 100644
--- a/testsuite/tests/ghc-api/T9595.hs
+++ b/testsuite/tests/ghc-api/T9595.hs
@@ -18,7 +18,8 @@ main =
_ <- runGhc (Just libdir) $ do
dflags <- getSessionDynFlags
setSessionDynFlags (dflags {
- packageFlags = [ExposePackage (PackageArg "ghc")
+ packageFlags = [ExposePackage "-package ghc"
+ (PackageArg "ghc")
(ModRenaming True [])]
})
dflags <- getSessionDynFlags
diff --git a/testsuite/tests/plugins/Makefile b/testsuite/tests/plugins/Makefile
index c12c33c9c7..28d3ae8aa7 100644
--- a/testsuite/tests/plugins/Makefile
+++ b/testsuite/tests/plugins/Makefile
@@ -2,19 +2,24 @@ TOP=../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
+# Each of the tests also exercise the various ways to bring plugins into scope
+
+# -hide-all-plugin-packages + -plugin-package
.PHONY: plugins01
plugins01:
- "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make -v0 plugins01.hs -package-db simple-plugin/pkg.plugins01/local.package.conf -fplugin Simple.Plugin -fplugin-opt Simple.Plugin:Irrelevant_Option -package simple-plugin
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make -v0 plugins01.hs -package-db simple-plugin/pkg.plugins01/local.package.conf -fplugin Simple.Plugin -fplugin-opt Simple.Plugin:Irrelevant_Option -hide-all-plugin-packages -plugin-package simple-plugin
./plugins01
+# -hide-all-packages + -plugin-package
.PHONY: plugins07
plugins07:
- "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make -v0 -O plugins07.hs -package-db rule-defining-plugin/pkg.plugins07/local.package.conf -package rule-defining-plugin -fplugin=RuleDefiningPlugin
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make -v0 -O plugins07.hs -package-db rule-defining-plugin/pkg.plugins07/local.package.conf -hide-all-packages -package base -plugin-package rule-defining-plugin -fplugin=RuleDefiningPlugin
./plugins07
+# -package (should work for backwards compatibility)
.PHONY: T10420
T10420:
- "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make -v0 -O T10420.hs -package-db rule-defining-plugin/pkg.T10420/local.package.conf -package rule-defining-plugin
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make -v0 -O T10420.hs -package-db rule-defining-plugin/pkg.T10420/local.package.conf -hide-all-packages -package base -package rule-defining-plugin
./T10420
.PHONY: T10294
@@ -31,3 +36,8 @@ frontend01:
"$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -Wall -package ghc -c FrontendPlugin.hs
"$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --frontend FrontendPlugin -ffrontend-opt foobar frontend01
./frontend01
+
+# -hide-all-plugin-packages + -package (this should not work!)
+.PHONY: T11244
+T11244:
+ ! "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make -v0 -O T11244.hs -package-db rule-defining-plugin/pkg.T11244/local.package.conf -hide-all-plugin-packages -package rule-defining-plugin -fplugin=RuleDefiningPlugin
diff --git a/testsuite/tests/plugins/T11244.hs b/testsuite/tests/plugins/T11244.hs
new file mode 100644
index 0000000000..dba99b0017
--- /dev/null
+++ b/testsuite/tests/plugins/T11244.hs
@@ -0,0 +1 @@
+module ShouldFail where
diff --git a/testsuite/tests/plugins/T11244.stderr b/testsuite/tests/plugins/T11244.stderr
new file mode 100644
index 0000000000..30c8c5b127
--- /dev/null
+++ b/testsuite/tests/plugins/T11244.stderr
@@ -0,0 +1,3 @@
+<command line>: Could not find module ‘RuleDefiningPlugin’
+It is a member of the hidden package ‘rule-defining-plugin-0.1’.
+Use -v to see a list of the files searched for.
diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T
index 1f9ec3b3b8..7bbbe1c4cd 100644
--- a/testsuite/tests/plugins/all.T
+++ b/testsuite/tests/plugins/all.T
@@ -68,3 +68,9 @@ test('frontend01',
'frontend01', 'frontend01.o', 'frontend01.hi']),
unless(have_dynamic(), expect_broken(10301))],
run_command, ['$MAKE -s --no-print-directory frontend01'])
+
+test('T11244',
+ [pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.T11244'),
+ clean_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin clean.T11244')],
+ run_command,
+ ['$MAKE -s --no-print-directory T11244'])