Skip to content
Snippets Groups Projects
Commit 14ce2ddc authored by Isaac Potoczny-Jones's avatar Isaac Potoczny-Jones
Browse files

added a test case for a program using hooks

parent b4ee1e0f
No related branches found
No related tags found
No related merge requests found
LocalBuildInfo {prefix = "/usr", compiler = Compiler {compilerFlavor = GHC, compilerVersion = Version {versionBranch = [6,2,2], versionTags = []}, compilerPath = "/usr/bin/ghc", compilerPkgTool = "/usr/bin/ghc-pkg"}, buildDir = "dist/build", packageDeps = [], executableDeps = [("withHooks",[])]}
\ No newline at end of file
all:
mkdir -p dist/tmp
ghc -cpp --make -odir dist/tmp -hidir dist/tmp -i../.. Setup.lhs -o setup
clean:
rm -f setup a.out dist/build/testA
rm -rf ,tmp dist ,tmp2
find . -name "*.o" |xargs rm -f
find . -name "*.hi" |xargs rm -f
check: all
./setup configure --user --prefix=/tmp/foo
./setup build
./setup install --install-prefix=/tmp/bar
ls /tmp/bar*
# install w/ register!
./setup install
# ls /tmp/foo*
./setup sdist
ls dist
copyright: Copyright 2005 Happy New Year!!
license: LGPL
description: This program outputs very important information.
exposed-modules: WithHooks
Name: withHooks
Version: 1.0
Executable: withHooks
Executable-Modules: WithHooks
Main-is: WithHooks.hs
#!/usr/bin/runhugs
> module Main where
> import Distribution.Simple
> import Distribution.PackageDescription (readPackageDescription)
> import Distribution.Compat.Directory (copyFile)
> import System.Directory (removeFile)
> import System.Exit(ExitCode(..))
> myPreConf _ _ = do copyFile "Setup.buildinfo.in" "Setup.buildinfo"
> d <- readPackageDescription hookedPackageDesc
> return $ Just d
> main :: IO ()
> main = defaultMainWithHooks defaultUserHooks
> {preConf=myPreConf,
> postClean=removeFile "Setup.buildinfo" >> return ExitSuccess
> }
module Main where
main = putStrLn "Happy New Year!"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment