forked from jlouis/combinatorrent
/
Setup.lhs
executable file
·23 lines (16 loc) · 874 Bytes
/
Setup.lhs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env runhaskell
In principle, we could do with a lot less than autoconfUserhooks, but simpleUserHooks
is not running 'configure'.
We will need Distribution.Simple to do the heavyweight lifting, and we will need some filePath magic.
> import System.FilePath
> import System.Process
> import Distribution.Simple
> import Distribution.Simple.LocalBuildInfo
> import Distribution.PackageDescription
The main program is just to make Cabal lift it. But we will override testing.
> main = defaultMainWithHooks hooks
> where hooks = autoconfUserHooks { runTests = runTests' }
Running tests is to call Combinatorrent with its parameters for tests:
> runTests' :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()
> runTests' _ _ _ lbi = system testprog >> return ()
> where testprog = (buildDir lbi) </> "Combinatorrent" </> "Combinatorrent --tests"