Change the generated file to be in module Test
authorNeil Mitchell <ndmitchell@gmail.com>
Wed, 29 Oct 2014 08:27:15 +0000 (08:27 +0000)
committerNeil Mitchell <ndmitchell@gmail.com>
Wed, 29 Oct 2014 08:27:15 +0000 (08:27 +0000)
Generate.hs
filepath.cabal
tests/Test.hs

index 52efebd..48e88c6 100755 (executable)
@@ -22,9 +22,11 @@ main = do
     writeFileBinary "tests/Test.hs" (prefix ++ genTests tests)
 
 prefix = unlines
-    ["import AutoTest"
+    ["module Test(main) where"
+    ,"import AutoTest"
     ,"import qualified System.FilePath.Windows as W"
     ,"import qualified System.FilePath.Posix as P"
+    ,"main :: IO ()"
     ,"main = do"
     ]
 
index 069ce29..70c4520 100644 (file)
@@ -50,8 +50,10 @@ test-suite filepath-tests
     type: exitcode-stdio-1.0
     default-language: Haskell98
     main-is: Test.hs
+    ghc-options: -main-is Test
     hs-source-dirs: tests
-    other-modules: AutoTest
+    other-modules:
+        AutoTest
     build-depends:
         filepath,
         base,
index bbad53c..c5fb57d 100755 (executable)
@@ -1,6 +1,8 @@
+module Test(main) where
 import AutoTest
 import qualified System.FilePath.Windows as W
 import qualified System.FilePath.Posix as P
+main :: IO ()
 main = do
  block1
  block2