[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Running tests as part of build process



On Wed, Feb 17, 2010 at 8:41 AM, John Goerzen <jgoerzen@complete.org> wrote:
> Hi folks,
>
> I am very appreciative of the value of a debian/rules that looks like this:
>
> #!/usr/bin/make -f
>
> # Standard way of building Haskell libraries .
> include /usr/share/cdbs/1/rules/debhelper.mk
> include /usr/share/cdbs/1/class/hlibrary.mk
>
> And I recognize it is a great improvement over what I used to use, and
> say thanks to the people that are converting packages in the team maint.
> area to use this system.
>
> One downside it has over my old debian/rules, however, is that it
> doesn't run the package's test suite as part of the Debian build
> process.  I know that there is no standard way to run tests for Haskell
> packages, and that not all of them ship tests.  However, I do think that
> running tests, when available, as part of the build process is a Good Thing.
>
> How can we still do that for our cdbs build system?  I would like to see
> test running added back into my packages if it's not too difficult,
> though I admit it's not a huge priority given the GHC 6.12 transition.
>
> I'm not familiar enough with cdbs to know what to suggest here.

Isn't this better done from the Setup.hs file?

main = defaultMainWithHooks simpleUserHooks {
         runTests = runTestScript
       , postBuild = runTestScript
       }

runTestScript _args _flag _pd _lbi =
    system "runhaskell Test/Main.hs" >>=
    \ code -> if code == ExitSuccess then return () else error "Test Failure"


Reply to: