summaryrefslogtreecommitdiff
path: root/testsuite/tests/plugins/rule-defining-plugin
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2015-05-15 14:40:37 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2015-05-15 15:22:38 -0700
commitab45de12cee5af5dcb68b2afce1826ab9bf71ba0 (patch)
tree34896e53c693b611cce93ad8676127c1495111b4 /testsuite/tests/plugins/rule-defining-plugin
parent59720370849c0e15f207f059e54b21e4f8e05d82 (diff)
downloadhaskell-ab45de12cee5af5dcb68b2afce1826ab9bf71ba0.tar.gz
Failing test for #10420 using plugins.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'testsuite/tests/plugins/rule-defining-plugin')
-rw-r--r--testsuite/tests/plugins/rule-defining-plugin/LICENSE10
-rw-r--r--testsuite/tests/plugins/rule-defining-plugin/Makefile18
-rw-r--r--testsuite/tests/plugins/rule-defining-plugin/RuleDefiningPlugin.hs8
-rw-r--r--testsuite/tests/plugins/rule-defining-plugin/Setup.hs3
-rw-r--r--testsuite/tests/plugins/rule-defining-plugin/rule-defining-plugin.cabal15
5 files changed, 54 insertions, 0 deletions
diff --git a/testsuite/tests/plugins/rule-defining-plugin/LICENSE b/testsuite/tests/plugins/rule-defining-plugin/LICENSE
new file mode 100644
index 0000000000..6297f71b3f
--- /dev/null
+++ b/testsuite/tests/plugins/rule-defining-plugin/LICENSE
@@ -0,0 +1,10 @@
+Copyright (c) 2008, Max Bolingbroke
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of Max Bolingbroke nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/testsuite/tests/plugins/rule-defining-plugin/Makefile b/testsuite/tests/plugins/rule-defining-plugin/Makefile
new file mode 100644
index 0000000000..7d957d0e95
--- /dev/null
+++ b/testsuite/tests/plugins/rule-defining-plugin/Makefile
@@ -0,0 +1,18 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+clean.%:
+ rm -rf pkg.$*
+
+HERE := $(abspath .)
+$(eval $(call canonicalise,HERE))
+
+package.%:
+ $(MAKE) clean.$*
+ mkdir pkg.$*
+ "$(TEST_HC)" -outputdir pkg.$* --make -v0 -o pkg.$*/setup Setup.hs
+ "$(GHC_PKG)" init pkg.$*/local.package.conf
+ pkg.$*/setup configure --distdir pkg.$*/dist -v0 $(CABAL_PLUGIN_BUILD) --prefix="$(HERE)/pkg.$*/install" --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=pkg.$*/local.package.conf
+ pkg.$*/setup build --distdir pkg.$*/dist -v0
+ pkg.$*/setup install --distdir pkg.$*/dist -v0
diff --git a/testsuite/tests/plugins/rule-defining-plugin/RuleDefiningPlugin.hs b/testsuite/tests/plugins/rule-defining-plugin/RuleDefiningPlugin.hs
new file mode 100644
index 0000000000..ad6657129c
--- /dev/null
+++ b/testsuite/tests/plugins/rule-defining-plugin/RuleDefiningPlugin.hs
@@ -0,0 +1,8 @@
+module RuleDefiningPlugin where
+
+import GhcPlugins
+
+{-# RULES "unsound" forall x. show x = "SHOWED" #-}
+
+plugin :: Plugin
+plugin = defaultPlugin
diff --git a/testsuite/tests/plugins/rule-defining-plugin/Setup.hs b/testsuite/tests/plugins/rule-defining-plugin/Setup.hs
new file mode 100644
index 0000000000..e8ef27dbba
--- /dev/null
+++ b/testsuite/tests/plugins/rule-defining-plugin/Setup.hs
@@ -0,0 +1,3 @@
+import Distribution.Simple
+
+main = defaultMain
diff --git a/testsuite/tests/plugins/rule-defining-plugin/rule-defining-plugin.cabal b/testsuite/tests/plugins/rule-defining-plugin/rule-defining-plugin.cabal
new file mode 100644
index 0000000000..b354f6b8c5
--- /dev/null
+++ b/testsuite/tests/plugins/rule-defining-plugin/rule-defining-plugin.cabal
@@ -0,0 +1,15 @@
+Name: rule-defining-plugin
+Version: 0.1
+Synopsis: For testing
+Cabal-Version: >= 1.2
+Build-Type: Simple
+License: BSD3
+License-File: LICENSE
+Author: Edward Z. Yang
+Homepage: http://ezyang.com
+
+Library
+ Build-Depends: base, ghc
+ ghc-options: -O
+ Exposed-Modules:
+ RuleDefiningPlugin