THRIFT-392. hs: Make test scripts easier to use
authorBryan Duxbury <bryanduxbury@apache.org>
Tue, 24 Mar 2009 00:36:00 +0000 (00:36 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Tue, 24 Mar 2009 00:36:00 +0000 (00:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757620 13f79535-47bb-0310-9956-ffa450edef68

test/hs/runclient.sh
test/hs/runserver.sh

index 3dace0a..298441f 100644 (file)
@@ -1,2 +1,11 @@
-#!/bin/bash
-ghci -fglasgow-exts -i/home/iproctor/code/projects/thrift/trunk/lib/hs/src -igen-hs Client.hs
+#!/bin/sh
+
+if [ -z $BASE_PKG ]; then
+    BASE_PKG=`ghc-pkg --simple-output list base-3* | sed -e "s/.*\(base-3\(.[0-9]\){3}\).*/\1/"`
+fi
+
+if [ -z $BASE ]; then
+    BASE=../..
+fi
+
+ghci -fglasgow-exts -package $BASE_PKG -hide-package syb -i$BASE/lib/hs/src -i$BASE/test/hs/gen-hs Client.hs
index c090155..8a953bb 100644 (file)
@@ -1,2 +1,12 @@
-#!/bin/bash
-ghci -fglasgow-exts -i/home/iproctor/code/projects/thrift/trunk/lib/hs/src -igen-hs Server.hs
+#!/bin/sh
+
+if [ -z $BASE_PKG ]; then
+    BASE_PKG=`ghc-pkg --simple-output list base-3* | sed -e "s/.*\(base-3\(.[0-9]\){3}\).*/\1/"`
+fi
+
+if [ -z $BASE ]; then
+    BASE=../..
+fi
+
+printf "Starting server... "
+ghc -fglasgow-exts -package $BASE_PKG -hide-package syb -i$BASE/lib/hs/src -i$BASE/test/hs/gen-hs Server.hs -e "putStrLn \"ready.\" >> Server.main"