[commit: ghc] master: test #12567: add new testcase with expected plugin behaviour (f8b139f)
git at git.haskell.org
git at git.haskell.org
Sun Sep 4 11:04:57 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/f8b139fd11611694aed0bbf8e4ee009ae91ef566/ghc
>---------------------------------------------------------------
commit f8b139fd11611694aed0bbf8e4ee009ae91ef566
Author: Gabor Greif <ggreif at gmail.com>
Date: Sun Sep 4 12:13:54 2016 +0200
test #12567: add new testcase with expected plugin behaviour
>---------------------------------------------------------------
f8b139fd11611694aed0bbf8e4ee009ae91ef566
testsuite/driver/extra_files.py | 1 +
testsuite/tests/plugins/Makefile | 6 ++++++
testsuite/tests/plugins/T12567a.hs | 3 +++
testsuite/tests/plugins/T12567a.stderr | 6 ++++++
testsuite/tests/plugins/T12567b.hs | 4 ++++
testsuite/tests/plugins/all.T | 6 ++++++
6 files changed, 26 insertions(+)
diff --git a/testsuite/driver/extra_files.py b/testsuite/driver/extra_files.py
index f1dbcb5..5af9695 100644
--- a/testsuite/driver/extra_files.py
+++ b/testsuite/driver/extra_files.py
@@ -426,6 +426,7 @@ extra_src_files = {
'plugins05': ['HomePackagePlugin.hs'],
'plugins06': ['LinkerTicklingPlugin.hs'],
'plugins07': ['rule-defining-plugin/'],
+ 'T12567a': ['T12567b.hs', 'simple-plugin/'],
'print002': ['../Test.hs'],
'print003': ['../Test.hs'],
'print005': ['../QSort.hs'],
diff --git a/testsuite/tests/plugins/Makefile b/testsuite/tests/plugins/Makefile
index 28d3ae8..d0cdca6 100644
--- a/testsuite/tests/plugins/Makefile
+++ b/testsuite/tests/plugins/Makefile
@@ -41,3 +41,9 @@ frontend01:
.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
+
+.PHONY: T12567a
+T12567a:
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make T12567a.hs -package-db simple-plugin/pkg.T12567a/local.package.conf -hide-all-plugin-packages -plugin-package simple-plugin 1>&2
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make -v T12567a.hs -package-db simple-plugin/pkg.T12567a/local.package.conf -hide-all-plugin-packages -plugin-package simple-plugin 2>&1 | grep "T12567a.hs, T12567a.o" 1>&2
+ "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make T12567b.hs -package-db simple-plugin/pkg.T12567a/local.package.conf -hide-all-plugin-packages -plugin-package simple-plugin 1>&2
diff --git a/testsuite/tests/plugins/T12567a.hs b/testsuite/tests/plugins/T12567a.hs
new file mode 100644
index 0000000..5138ed0
--- /dev/null
+++ b/testsuite/tests/plugins/T12567a.hs
@@ -0,0 +1,3 @@
+{-# OPTIONS -fplugin Simple.Plugin #-}
+
+module T12567a where
diff --git a/testsuite/tests/plugins/T12567a.stderr b/testsuite/tests/plugins/T12567a.stderr
new file mode 100644
index 0000000..e8e04c5
--- /dev/null
+++ b/testsuite/tests/plugins/T12567a.stderr
@@ -0,0 +1,6 @@
+[1 of 1] Compiling T12567a ( T12567a.hs, T12567a.o )
+Simple Plugin Passes Queried
+Got options:
+Simple Plugin Pass Run
+[1 of 1] Skipping T12567a ( T12567a.hs, T12567a.o )
+[2 of 2] Compiling T12567b ( T12567b.hs, T12567b.o )
diff --git a/testsuite/tests/plugins/T12567b.hs b/testsuite/tests/plugins/T12567b.hs
new file mode 100644
index 0000000..6feb57f
--- /dev/null
+++ b/testsuite/tests/plugins/T12567b.hs
@@ -0,0 +1,4 @@
+module T12567b where
+
+import T12567a
+
diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T
index f165c4a..cca03bc 100644
--- a/testsuite/tests/plugins/all.T
+++ b/testsuite/tests/plugins/all.T
@@ -70,3 +70,9 @@ test('T11244',
clean_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin clean.T11244')],
run_command,
['$MAKE -s --no-print-directory T11244'])
+
+test('T12567a',
+ [pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.T12567a TOP={top}'),
+ clean_cmd('$MAKE -s --no-print-directory -C simple-plugin clean.T12567a')],
+ run_command,
+ ['$MAKE -s --no-print-directory T12567a'])
More information about the ghc-commits
mailing list