Commit 968f5cfb authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Test for "vanilla" lib/exe that uses TH.

parent c92409a4
......@@ -91,6 +91,10 @@ extra-source-files:
tests/PackageTests/PreProcess/Foo.hsc
tests/PackageTests/PreProcess/Main.hs
tests/PackageTests/PreProcess/my.cabal
tests/PackageTests/TemplateHaskell/vanilla/Exe.hs
tests/PackageTests/TemplateHaskell/vanilla/Lib.hs
tests/PackageTests/TemplateHaskell/vanilla/TH.hs
tests/PackageTests/TemplateHaskell/vanilla/my.cabal
tests/PackageTests/TemplateHaskell/dynamic/Exe.hs
tests/PackageTests/TemplateHaskell/dynamic/Lib.hs
tests/PackageTests/TemplateHaskell/dynamic/TH.hs
......
......@@ -71,6 +71,8 @@ tests version inplaceSpec =
, hunit "BenchmarkExeV10/Test"
PackageTests.BenchmarkExeV10.Check.checkBenchmark
, hunit "BenchmarkOptions" PackageTests.BenchmarkOptions.Check.suite
, hunit "TemplateHaskell/vanilla"
PackageTests.TemplateHaskell.Check.vanilla
, hunit "TemplateHaskell/profiling"
PackageTests.TemplateHaskell.Check.profiling
, hunit "TemplateHaskell/dynamic"
......
......@@ -4,6 +4,13 @@ import PackageTests.PackageTester
import System.FilePath
import Test.HUnit
vanilla :: Test
vanilla = TestCase $ do
let spec = PackageSpec ("PackageTests" </>
"TemplateHaskell" </> "vanilla") []
result <- cabal_build spec
assertBuildSucceeded result
profiling :: Test
profiling = TestCase $ do
let flags = ["--enable-library-profiling"
......
{-# LANGUAGE TemplateHaskell #-}
module Main where
import TH
main = print $(splice)
{-# LANGUAGE TemplateHaskell #-}
module Lib where
import TH
val = $(splice)
{-# LANGUAGE TemplateHaskell #-}
module TH where
splice = [| () |]
Name: templateHaskell
Version: 0.1
Build-Type: Simple
Cabal-Version: >= 1.2
Library
Exposed-Modules: Lib
Other-Modules: TH
Build-Depends: base, template-haskell
Extensions: TemplateHaskell
Executable main
Main-is: Exe.hs
Build-Depends: base, template-haskell
Extensions: TemplateHaskell
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment