THRIFT-2152 Generated Haskell files does not compile

fully qualified module names at usage site for structs

Patch: John Chee & Roger Meier
diff --git a/test/hs/Include_Main.hs b/test/hs/Include_Main.hs
new file mode 100644
index 0000000..697ffff
--- /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 d6d8ff4..e948b41 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 ac5190d..46b8b2c 100644
--- a/test/hs/run-test.sh
+++ b/test/hs/run-test.sh
@@ -29,30 +29,6 @@
     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 @@
     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