Cabal Test-suites + custom preprocessors

Hi café, I am successfully using a custom preprocessor to build my main executable. In particular, I am using UUAGC to preprocess .ag files into .hs files. My Setup.hs file uses 'uuagcLibUserHook' from the package uuagc-cabal to do this, which in particular overrides Cabal's 'buildHook' for me. Now I am trying to add a test-suite (of type exitcode-stdio-1.0). I want the test suite to be able to import the modules which implement the main program. Unfortunately, building the test suite fails, because the .ag files don't seem to be built into .hs files. Does anybody know if Cabal actually supports using custom preprocessors for building a test-suite? If so, is 'buildHook' still the right hook to override? Thanks, -- Iain

On Sun, Aug 26, 2012 at 12:40 PM, Iain Nicol
Hi café,
I am successfully using a custom preprocessor to build my main executable. In particular, I am using UUAGC to preprocess .ag files into .hs files. My Setup.hs file uses 'uuagcLibUserHook' from the package uuagc-cabal to do this, which in particular overrides Cabal's 'buildHook' for me.
Now I am trying to add a test-suite (of type exitcode-stdio-1.0). I want the test suite to be able to import the modules which implement the main program. Unfortunately, building the test suite fails, because the .ag files don't seem to be built into .hs files.
Does anybody know if Cabal actually supports using custom preprocessors for building a test-suite? If so, is 'buildHook' still the right hook to override?
Try overriding the test hook. If it doesn't work file a bug at https://github.com/haskell/cabal/issues -- Johan

Johan Tibell wrote:
On Sun, Aug 26, 2012 at 12:40 PM, Iain Nicol
wrote: Does anybody know if Cabal actually supports using custom preprocessors for building a test-suite? If so, is 'buildHook' still the right hook to override?
Try overriding the test hook.
Bleh; that's too obvious. I will give that a shot. [resending this reply to the list, sorry for the dupe Johan] Thanks, Iain

On Sun, Aug 26, 2012 at 1:03 PM, Iain Nicol
Johan Tibell wrote:
On Sun, Aug 26, 2012 at 12:40 PM, Iain Nicol
wrote: Does anybody know if Cabal actually supports using custom preprocessors for building a test-suite? If so, is 'buildHook' still the right hook to override?
Try overriding the test hook.
Bleh; that's too obvious. I will give that a shot.
Well, I think's it's reasonable for test to imply build so in my mind the build hook should also be executed when building test suites.
participants (2)
-
Iain Nicol
-
Johan Tibell