summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoger Meier <roger@apache.org>2014-08-02 18:02:05 +0200
committerRoger Meier <roger@apache.org>2014-08-02 18:05:23 +0200
commitf341c590dcaa99fad8e768e1e8f06f19179bb737 (patch)
treefc4d0dcf488e58e8db9282f839c0e424141acbab /test
parentb360ed393cc4845d9933d45dacbf0dd0446f0a88 (diff)
downloadthrift-f341c590dcaa99fad8e768e1e8f06f19179bb737.tar.gz
THRIFT-2152 Generated Haskell files does not compile
fully qualified module names at usage site for structs Patch: John Chee & Roger Meier
Diffstat (limited to 'test')
-rw-r--r--test/hs/Include_Main.hs7
-rw-r--r--test/hs/Makefile.am7
-rw-r--r--test/hs/run-test.sh28
3 files changed, 13 insertions, 29 deletions
diff --git a/test/hs/Include_Main.hs b/test/hs/Include_Main.hs
new file mode 100644
index 000000000..697ffff90
--- /dev/null
+++ b/test/hs/Include_Main.hs
@@ -0,0 +1,7 @@
+module Main where
+
+import Include_Types
+import ThriftTest_Types
+
+main :: IO ()
+main = putStrLn ("Includes work: " ++ (show (IncludeTest (Just (Bools (Just True) (Just False))))))
diff --git a/test/hs/Makefile.am b/test/hs/Makefile.am
index d6d8ff46b..e948b41be 100644
--- a/test/hs/Makefile.am
+++ b/test/hs/Makefile.am
@@ -19,12 +19,17 @@
THRIFT = $(top_srcdir)/compiler/cpp/thrift
-stubs: ../ConstantsDemo.thrift ../DebugProtoTest.thrift ../ThriftTest.thrift
+stubs: ../ConstantsDemo.thrift ../DebugProtoTest.thrift ../ThriftTest.thrift ../Include.thrift
$(THRIFT) --gen hs ../ConstantsDemo.thrift
$(THRIFT) --gen hs ../DebugProtoTest.thrift
$(THRIFT) --gen hs ../ThriftTest.thrift
+ $(THRIFT) --gen hs ../Include.thrift
check: stubs
sh run-test.sh ConstantsDemo
sh run-test.sh DebugProtoTest
sh run-test.sh ThriftTest
+ sh run-test.sh Include
+
+clean-local:
+ $(RM) -r gen-hs
diff --git a/test/hs/run-test.sh b/test/hs/run-test.sh
index ac5190d23..46b8b2c40 100644
--- a/test/hs/run-test.sh
+++ b/test/hs/run-test.sh
@@ -29,30 +29,6 @@ if [ -z $BASE ]; then
BASE=../..
fi
-if [ -z $THRIFT_BIN ]; then
- THRIFT_BIN=$BASE/compiler/cpp/thrift
-fi
-
-if [ ! -x "$THRIFT_BIN" ]; then
- printf "Could not find thrift binary; pass it as environment variable THRIFT_BIN\n"
- exit 1
-fi
-
-# Figure out what file to generate bindings from
-if [ -z $THRIFT_FILE ]; then
- THRIFT_FILE=$BASE/test/$1.thrift
-fi
-
-if [ ! -e $THRIFT_FILE ]; then
- printf "Missing thrift file $THRIFT_FILE \n"
- exit 2
-fi
-
-if [ ! -e "$THRIFT_FILE" ]; then
- printf "Could not find thrift file to run; pass it as environment variable THRIFT_FILE\n"
- exit 1
-fi
-
# Figure out what file to run has a server
if [ -z $TEST_SOURCE_FILE ]; then
TEST_SOURCE_FILE=$BASE/test/hs/$1_Main.hs
@@ -63,9 +39,5 @@ if [ ! -e $TEST_SOURCE_FILE ]; then
exit 3
fi
-# Actually run the server bits
-printf "Generating bindings... \n"
-$THRIFT_BIN --gen hs $THRIFT_FILE
-
printf "Running test... \n"
runhaskell -Wall -i$BASE/lib/hs/src -igen-hs $TEST_SOURCE_FILE