Commit 31f30efb authored by Julien Lopez's avatar Julien Lopez

Small fix for xi in compile; add git hook for debug; better Makefile in tests

parent 3fbcac2e
......@@ -119,8 +119,9 @@ and compile_aux env = function
| Typed.TVar x ->
let v = find x env in
let ts = Types.all_vars (Types.descr (IdMap.assoc x env.gamma)) in
let is_mono () =
let d = Var.Set.inter (IdMap.assoc x env.xi) (domain(env.sigma)) in
let is_mono () =
let from_xi = try IdMap.assoc x env.xi with Not_found -> Var.Set.empty in
let d = Var.Set.inter from_xi (domain(env.sigma)) in
Var.Set.is_empty (Var.Set.inter ts d)
in
if Var.Set.is_empty ts then Var (v) else
......
......@@ -23,15 +23,19 @@ EXTFILES = $(INEXTFILES:%=$(ROOTDIR)/%)
RM ?= rm -f
OUT ?= valueTests.native lambdaTests.native typedTests.native astprinter.native
OUTDEBUG ?= valueTests.native lambdaTests.byte typedTests.byte astprinter.byte
OUTDEBUG ?= valueTests.byte lambdaTests.byte typedTests.byte astprinter.byte
.PHONY: clean _import tests
all: _import
$(COMPILER) -use-ocamlfind $(OUT)
all: $(OUT)
debug: _import
$(COMPILER) -use-ocamlfind -tag debug $(OUTDEBUG)
debug: $(OUTDEBUG)
%.native: _import
$(COMPILER) -use-ocamlfind $@
%.byte: _import
$(COMPILER) -use-ocamlfind -tag debug $@
tests:
make -C tests
......
ROOTDIR="$(git rev-parse --git-dir)"
cd $ROOTDIR/..
echo "Testing the program before commit..."
echo "Testing tallying..."
ocamlbuild -tag debug tests/tallyingTest.byte && ./tallyingTest.byte
if test $? -ne 0; then
echo "Tests failed. Aborting commit."
exit 2
fi
echo "Testing lambda..."
cd tests/lambda
make && ./lambdaTests.native && ./valueTests.native
echo "Cleaning..."
make clean > /dev/null 2>&1
cd ../..
ocamlbuild -clean
echo "Success!"
exit 0
......@@ -3,7 +3,7 @@ ROOTDIR="$(git rev-parse --git-dir)"
cd $ROOTDIR/..
echo "Testing the program before commit..."
echo -n "Building cduce..."
make > /dev/null 2> /dev/null
make > /dev/null 2>&1
echo "done."
if test $? -ne 0; then
echo "Building cduce failed. Aborting commit."
......@@ -15,5 +15,7 @@ if test $? -ne 0; then
echo "Tests failed. Aborting commit."
exit 2
fi
echo "Cleaning..."
make clean > /dev/null 2>&1
echo "Success!"
exit 0
#!/bin/sh
ROOT=$(git rev-parse --show-toplevel)
HOOKSDIR=$ROOT/tools/git_hooks
HOOKSDIR=$ROOT/tools/git_hooks/release
HOOKS=pre-commit
GITHOOKSDIR=$ROOT/.git/hooks
while test $# -ne 0; do
if test $1 = "-d" || test $1 = "--debug"; then
HOOKSDIR=$ROOT/tools/git_hooks/debug
fi
shift
done
echo "Installing git hooks to local repository..."
for i in $HOOKS; do
echo -n "Installing $HOOKSDIR/$i..."
......
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