Add a new test: hpc_ghc_ghci
authorIan Lynagh <igloo@earth.li>
Sun, 30 Nov 2008 16:09:21 +0000 (16:09 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 30 Nov 2008 16:09:21 +0000 (16:09 +0000)
Small demonstration of #1779

tests/ghc_ghci/A.hs [new file with mode: 0644]
tests/ghc_ghci/B.hs [new file with mode: 0644]
tests/ghc_ghci/Makefile [new file with mode: 0644]
tests/ghc_ghci/hpc_ghc_ghci.stdout [new file with mode: 0644]
tests/ghc_ghci/test.T [new file with mode: 0644]

diff --git a/tests/ghc_ghci/A.hs b/tests/ghc_ghci/A.hs
new file mode 100644 (file)
index 0000000..f12fdad
--- /dev/null
@@ -0,0 +1,5 @@
+
+module A (a) where
+
+a :: Char
+a = 'z'
diff --git a/tests/ghc_ghci/B.hs b/tests/ghc_ghci/B.hs
new file mode 100644 (file)
index 0000000..0bf4401
--- /dev/null
@@ -0,0 +1,7 @@
+
+module B (b) where
+
+import A
+
+b :: Char
+b = a
diff --git a/tests/ghc_ghci/Makefile b/tests/ghc_ghci/Makefile
new file mode 100644 (file)
index 0000000..335fb9d
--- /dev/null
@@ -0,0 +1,13 @@
+# This Makefile runs the tests using GHC's testsuite framework.  It
+# assumes the package is part of a GHC build tree with the testsuite
+# installed in ../../../testsuite.
+
+TOP=../../../../testsuite
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+hpc_ghc_ghci:
+       rm -f A.o A.hi
+       $(TEST_HC) -fhpc -c A.hs
+       echo b | $(TEST_HC) -v0 --interactive B.hs
+
diff --git a/tests/ghc_ghci/hpc_ghc_ghci.stdout b/tests/ghc_ghci/hpc_ghc_ghci.stdout
new file mode 100644 (file)
index 0000000..6ad22b4
--- /dev/null
@@ -0,0 +1 @@
+'z'
diff --git a/tests/ghc_ghci/test.T b/tests/ghc_ghci/test.T
new file mode 100644 (file)
index 0000000..a3b25b7
--- /dev/null
@@ -0,0 +1,8 @@
+
+test('hpc_ghc_ghci',
+     [broken(1779),
+      only_ways(['normal']),
+      only_compiler_types(['ghc'])],
+     run_command,
+     ['$MAKE -s --no-print-directory hpc_ghc_ghci'])
+