Commit bb3ea869 authored by simonmar's avatar simonmar

[project @ 2004-12-03 16:52:31 by simonmar]

Add a Cabal test (modified version of the test from the Cabal distibution).
parent 82825ea8
......@@ -21,7 +21,7 @@ ghcpkg01 :
$(GHC_PKG) describe testpkg-2.0
@: # cannot use testpkg as a package name, it is ambiguous now
if $(GHC_PKG) describe testpkg; then false; else true; fi
if $(GHC_PKG) describe testpkg; then false; else true; fi
@: # test hiding/exposing
$(GHC_PKG) hide testpkg-1.2.3.4
......
module A where
a = 42 :: Int
main2 = print a
module B.A where
a = 42 :: Int
main = print a
module Main where
import A
main = print a
module Main where
import A
main = print a
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
GHC_PKG=$(FPTOOLS_TOP)/ghc/utils/ghc-pkg/ghc-pkg-inplace
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
rm -fr install-tmp
rm -fr install
setup : Setup.lhs
$(TEST_HC) --make -o setup Setup.lhs
cabal01: setup
# unregister if pakage 'test' already exists
if $(GHC_PKG) --user list | grep test-; then \
$(GHC_PKG) --user unregister test; \
fi
./setup configure --prefix=`pwd`/install --with-compiler=$(TEST_HC) --with-hc-pkg=$(GHC_PKG)
./setup build
./setup install --install-prefix=`pwd`/install-tmp
ls install-tmp
# install w/ register!
./setup install --user
ls install
./setup sdist
ls dist
Name: test
Version: 1.0
Modules: A, B.A
Exposed-Modules: A
C-Sources: hello.c, c_src/hello.c
Extensions: ForeignFunctionInterface
Executable: testA
Modules: A, MainA
Main-is: MainA.hs
Extensions: OverlappingInstances
Executable: testB
Modules: B.A, B.MainB
Main-is: B/MainB.hs
#!/usr/bin/runhugs
> module Main where
> import Distribution.Simple
> main :: IO ()
> main = defaultMain
setTestOpts(only_compiler_types(['ghc']))
test('cabal01', normal, run_command_ignore_output, ['$MAKE cabal01'])
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