Commit 51f8bbe8 authored by Simon Marlow's avatar Simon Marlow

add test for #3604 (template-haskell + -dynamic)

parent 34341b5b
{-# LANGUAGE TemplateHaskell #-}
module Library where
import TH
main = print ($(spliceMe) [1, 2])
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
SETUP=./Setup -v0
# This tests that we can build a Cabal package that uses TH with both
# profiling and dynamic linking. (#3604)
cabal04:
'$(TEST_HC)' -v0 --make Setup
$(SETUP) clean
$(SETUP) configure --with-ghc='$(TEST_HC)' $(PROF) $(DYN)
$(SETUP) build
> import Distribution.Simple
> main = defaultMain
{-# LANGUAGE TemplateHaskell #-}
module TH where
import Language.Haskell.TH
spliceMe = [| (\xs -> tail xs ++ init xs) |]
setTestOpts(only_compiler_types(['ghc']))
if config.have_profiling:
prof = '--enable-library-profiling'
else:
prof = ''
if config.have_shared_libs:
dyn = '--enable-shared'
else:
dyn = ''
if default_testopts.cleanup != '':
cleanup = 'CLEANUP=1'
else:
cleanup = ''
test('cabal04',
normal,
run_command,
['$MAKE -s --no-print-directory cabal04 PROF=' + prof + ' DYN=' + dyn + ' ' + cleanup])
name: thtest
version: 1.0
cabal-version: >= 1.2
build-type: Simple
library {
build-depends: base, template-haskell
extensions: TemplateHaskell
exposed-modules: Library
other-modules: TH
}
Markdown is supported
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