Commit e5e5bca9 authored by ijones's avatar ijones
Browse files

made test cases work

- new Setup.distribution for A
- make clean && make for A in moduleTest
- Setup.hs -> Setup.lhs, just because
parent d9f8f1e1
......@@ -131,14 +131,12 @@ tests = [TestLabel "testing the HUnit package" $ TestCase $
assertCmd ("ghc-pkg --config-file=" ++ pkgConf ++ " -r HUnit-1.0") "package remove"
setCurrentDirectory oldDir,
TestLabel "configure GHC, sdist" $ TestCase $
TestLabel "package A: configure GHC, sdist" $ TestCase $
do pkgConf <- GHC.localPackageConfig
system $ "ghc-pkg -r test-1.0 --config-file=" ++ pkgConf
setCurrentDirectory "test/A"
dirE1 <- doesDirectoryExist ",tmp"
when dirE1 (system "rm -r ,tmp">>return())
dirE2 <- doesDirectoryExist "dist"
when dirE2 (system "rm -r dist">>return())
system "make clean"
system "make"
assertCmd "./setup configure --ghc --prefix=,tmp"
"configure returned error code"
......@@ -152,7 +150,7 @@ tests = [TestLabel "testing the HUnit package" $ TestCase $
assertEqual "dist/src exists" False
doesDirectoryExist "dist/build" >>=
assertBool "dist/build doesn't exists",
TestLabel "GHC and install-prefix" $ TestCase $ -- (uses above config)
TestLabel "package A: GHC and install-prefix" $ TestCase $ -- (uses above config)
do let targetDir = ",tmp2"
instRetCode <- system $ "./setup install --install-prefix=" ++ targetDir
checkTargetDir ",tmp2/lib/test-1.0/" [".hi"]
......
* priorities
** Extension
- constructorless data-types
** Change mainModules to [(String, String)] for (Module, executable
name)
** Build executables for mainModules
......
......@@ -52,8 +52,11 @@ hunitInstall-stamp:
moduleTest:
ghc $(GHCFLAGS) Distribution/ModuleTest -o moduleTest
tests: moduleTest
tests: moduleTest clean
cd test/A && make clean
cd test/HUnit-1.0 && make clean
cd test/A && make
cd test/HUnit-1.0 && make
check: tests
./moduleTest
......
all:
ghc -Wall --make -i../../:/usr/local/src/HUnit-1.0 Setup.hs -o setup
ghc -Wall --make -i../../:/usr/local/src/HUnit-1.0 Setup.lhs -o setup
clean:
rm -f setup a.out
rm -rf ,tmp dist
rm -rf ,tmp dist ,tmp2
find . -name "*.o" |xargs rm -f
find . -name "*.hi" |xargs rm -f
check: all
......
module Main where
import Distribution.Simple
pkg_descr = emptyPackageDescription {
package = PackageIdentifier "test" (Version [1,0] []),
allModules = ["A", "B.A"],
exposedModules = ["A"]
}
main = defaultMainNoRead pkg_descr
#!/usr/bin/runhugs
> module Main where
> import Distribution.Simple
> main :: IO ()
> main = defaultMain
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment