diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/iserv-remote/Lib.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/iserv-remote/Main.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/iserv-remote/Makefile | 38 | ||||
-rw-r--r-- | testsuite/tests/iserv-remote/Setup.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/iserv-remote/all.T | 11 | ||||
-rw-r--r-- | testsuite/tests/iserv-remote/iserv-remote.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/iserv-remote/iserv-remote.stdout | 1 | ||||
-rwxr-xr-x | testsuite/tests/iserv-remote/iserv-wrapper | 12 | ||||
-rw-r--r-- | testsuite/tests/iserv-remote/remote-iserv.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/iserv-remote/remote-iserv.stdout | 4 |
10 files changed, 83 insertions, 0 deletions
diff --git a/testsuite/tests/iserv-remote/Lib.hs b/testsuite/tests/iserv-remote/Lib.hs new file mode 100644 index 0000000000..f34fc9d8ab --- /dev/null +++ b/testsuite/tests/iserv-remote/Lib.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TemplateHaskell #-} +module Lib where + +import Language.Haskell.TH + +x :: Int -> ExpQ +x n = [| 3 + n |] diff --git a/testsuite/tests/iserv-remote/Main.hs b/testsuite/tests/iserv-remote/Main.hs new file mode 100644 index 0000000000..dcc2354287 --- /dev/null +++ b/testsuite/tests/iserv-remote/Main.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TemplateHaskell #-} + +import Lib (x) + +main = putStrLn "Hello World" >> print $(x 10) diff --git a/testsuite/tests/iserv-remote/Makefile b/testsuite/tests/iserv-remote/Makefile new file mode 100644 index 0000000000..409e33be09 --- /dev/null +++ b/testsuite/tests/iserv-remote/Makefile @@ -0,0 +1,38 @@ +TOP=../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +SETUP='$(PWD)/Setup' -v0 +CONFIGURE=$(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db='$(PWD)/tmp.d' --prefix='$(PWD)/inst' + +remote-iserv: clean + '$(GHC_PKG)' init tmp.d + + '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make Setup + + cp -r $(TOP)/../libraries/libiserv . + cd libiserv && $(CONFIGURE) -fnetwork + cd libiserv && $(SETUP) build + cd libiserv && $(SETUP) copy + cd libiserv && $(SETUP) register + + cp -r $(TOP)/../utils/iserv-proxy . + cd iserv-proxy && $(CONFIGURE) + cd iserv-proxy && $(SETUP) build + cd iserv-proxy && $(SETUP) copy + cd iserv-proxy && $(SETUP) register + + cp -r $(TOP)/../utils/remote-iserv . + cd remote-iserv && $(CONFIGURE) + cd remote-iserv && $(SETUP) build + cd remote-iserv && $(SETUP) copy + cd remote-iserv && $(SETUP) register + + '$(TEST_HC)' $(TEST_HC_OPTS) -fexternal-interpreter -pgmi $(PWD)/iserv-wrapper Main.hs + +ifneq "$(CLEANUP)" "" + $(MAKE) -s --no-print-directory clean +endif + +clean : + $(RM) -rf tmp *.o *.hi Main libiserv iserv-proxy remote-iserv tmp.d inst dist Setup$(exeext) diff --git a/testsuite/tests/iserv-remote/Setup.hs b/testsuite/tests/iserv-remote/Setup.hs new file mode 100644 index 0000000000..9a994af677 --- /dev/null +++ b/testsuite/tests/iserv-remote/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/testsuite/tests/iserv-remote/all.T b/testsuite/tests/iserv-remote/all.T new file mode 100644 index 0000000000..f8f0920835 --- /dev/null +++ b/testsuite/tests/iserv-remote/all.T @@ -0,0 +1,11 @@ +def normalise_port(str): + str = re.sub(r'on port [0-9]+', r'on port ****', str) + return str + +test('remote-iserv' + , [ reqlib('network') + , normalise_fun(normalise_port) + , normalise_errmsg_fun(normalise_port) + , extra_files(['Main.hs', 'Lib.hs', 'iserv-wrapper', 'Setup.hs'])] + , makefile_test + , []) diff --git a/testsuite/tests/iserv-remote/iserv-remote.stderr b/testsuite/tests/iserv-remote/iserv-remote.stderr new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/testsuite/tests/iserv-remote/iserv-remote.stderr @@ -0,0 +1 @@ + diff --git a/testsuite/tests/iserv-remote/iserv-remote.stdout b/testsuite/tests/iserv-remote/iserv-remote.stdout new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/testsuite/tests/iserv-remote/iserv-remote.stdout @@ -0,0 +1 @@ + diff --git a/testsuite/tests/iserv-remote/iserv-wrapper b/testsuite/tests/iserv-remote/iserv-wrapper new file mode 100755 index 0000000000..6c7da86214 --- /dev/null +++ b/testsuite/tests/iserv-remote/iserv-wrapper @@ -0,0 +1,12 @@ +#!/bin/bash +PORT=$(($((5000+$RANDOM)) % 10000)) + +(>&2 echo "starting remote-iserv on port $PORT") + +./inst/bin/remote-iserv tmp $PORT & +REMOTE="$!" + +(>&2 echo "starting iserv-proxy with $@") +./inst/bin/iserv-proxy $@ 127.0.0.1 $PORT + +kill $REMOTE diff --git a/testsuite/tests/iserv-remote/remote-iserv.stderr b/testsuite/tests/iserv-remote/remote-iserv.stderr new file mode 100644 index 0000000000..cd6f9d4385 --- /dev/null +++ b/testsuite/tests/iserv-remote/remote-iserv.stderr @@ -0,0 +1,2 @@ +starting remote-iserv on port 2051 +starting iserv-proxy with 13 14 diff --git a/testsuite/tests/iserv-remote/remote-iserv.stdout b/testsuite/tests/iserv-remote/remote-iserv.stdout new file mode 100644 index 0000000000..b062df0c31 --- /dev/null +++ b/testsuite/tests/iserv-remote/remote-iserv.stdout @@ -0,0 +1,4 @@ +[1 of 2] Compiling Lib ( Lib.hs, Lib.o ) +[2 of 2] Compiling Main ( Main.hs, Main.o ) +Listening on port 2051 +Linking Main ... |