-
Notifications
You must be signed in to change notification settings - Fork 2
/
Setup.hs
executable file
·43 lines (32 loc) · 1.18 KB
/
Setup.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env runhaskell
import Distribution.Simple
import Distribution.Simple.PreProcess
import Distribution.PackageDescription
import Distribution.Simple.LocalBuildInfo
import System.Cmd(system)
import System.Exit
--main = defaultMainWithHooks simpleUserHooks
-- --defaultUserHooks
--import Intel.Cnc
main :: IO ()
main = do putStrLn$ "Running Setup.hs ..."
let hooks = simpleUserHooks
defaultMainWithHooks
(hooks {runTests = myTests
--, hookedPreProcessors= (mypp : hookedPreProcessors hooks)
})
-- mypp :: PPSuffixHandler
-- mypp = (".y.pp", \ _ _ -> ppTestHandler)
-- ppTestHandler :: PreProcessor
-- ppTestHandler =
-- PreProcessor {
-- platformIndependent = True,
-- runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity ->
-- do putStrLn$ (inFile++" has been preprocessed to "++outFile)
-- stuff <- readFile inFile
-- writeFile outFile ("-- preprocessed as a test\n\n" ++ stuff)
-- return ()
-- }
myTests :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()
myTests _ _ _ _ = do code <- system "./dist/build/haskell-cnc-runTests/haskell-cnc-runTests"
exitWith code