Make sure preprocessed module are on the module path

This commit is contained in:
Daniel Gröber 2015-08-10 05:14:31 +02:00
parent bb22b643e9
commit c4d534ba1c
5 changed files with 31 additions and 0 deletions

View File

@ -78,6 +78,9 @@ Extra-Source-Files: ChangeLog
test/data/custom-cradle/package-db-a/.gitkeep
test/data/custom-cradle/package-db-b/.gitkeep
test/data/custom-cradle/package-db-c/.gitkeep
test/data/cabal-preprocessors/*.cabal
test/data/cabal-preprocessors/*.hs
test/data/cabal-preprocessors/*.hsc
Library
Default-Language: Haskell2010

View File

@ -57,3 +57,10 @@ spec = do
withDirectory_ "test/data/check-missing-warnings" $ do
res <- runD $ checkSyntax ["DesugarWarnings.hs"]
res `shouldBe` "DesugarWarnings.hs:4:9:Warning: Pattern match(es) are non-exhaustive\NULIn a case alternative: Patterns not matched: _ : _\n"
it "works with cabal builtin preprocessors" $ do
withDirectory_ "test/data/cabal-preprocessors" $ do
_ <- system "cabal clean"
_ <- system "cabal build"
res <- runD $ checkSyntax ["Main.hs"]
res `shouldBe` "Preprocessed.hsc:3:1:Warning: Top-level binding with no type signature: warning :: ()\n"

View File

@ -0,0 +1,4 @@
import Preprocessed
main :: IO ()
main = return warning

View File

@ -0,0 +1,3 @@
module Preprocessed where
warning = ()

View File

@ -0,0 +1,14 @@
name: cabal-preprocessors
version: 0.1.0.0
license-file: LICENSE
author: asd
maintainer: asd
build-type: Simple
cabal-version: >=1.10
executable cabal-preprocessors
main-is: Main.hs
build-depends: base
default-language: Haskell2010
other-modules: Preprocessed
ghc-options: -Wall