Commit 6d121fbf authored by Julien Lopez's avatar Julien Lopez

Tests reorganized in separate folders

parent 18033693
CAML=ocamlc
CDUCE=../../cduce
CAML=ocamlc -I $@
CDUCE=../../cduce -I $@
CDO2ML=$(CDUCE) --mlstub
run:
$(CAML) -c a.mli
$(CDUCE) --compile c.cd
$(CDUCE) --compile a.cd
$(CDO2ML) c.cdo > c.ml
$(CDO2ML) a.cdo > a.ml
ocamlfind $(CAML) -package cduce -linkpkg -o a c.ml a.ml b.ml
ifeq ($(STATIC),-static)
rm *.cdo
endif
./a
.PHONY: a
a:
$(CAML) -c a.mli
$(CDUCE) --compile c.cd
$(CDUCE) --compile a.cd
$(CDO2ML) c.cdo > c.ml
$(CDO2ML) a.cdo > a.ml
ocamlfind $(CAML) -g -package cduce,oUnit -linkpkg -o $@ c.ml $@.ml $@test.ml
./$@
.PHONY: cdsdl
cdsdl:
$(CAML) -c -I `ocamlfind query sdl` $@.mli
$(CDUCE) --compile -I `ocamlfind query sdl` $@.cd
$(CDO2ML) -I `ocamlfind query sdl` $@.cdo > $@.ml
ocamlfind $(CAML) -package cduce,sdl,oUnit -linkpkg -o $@ $@.ml $@test.ml
./$@
all: a cdsdl cdmysql eval cdnum
.PHONY: cdmysql
cdmysql:
$(CDUCE) --compile $@.cd -I `ocamlfind query mysql`
ocamlfind $(CAML) -o $@ -pp "$(CDO2ML)" -impl $@.cdo -package cduce,mysql -linkpkg
./$@
a:
$(CAML) -c $@/$@.mli
$(CDUCE) --compile $@/c.cd
$(CDUCE) --compile $@/$@.cd
$(CDO2ML) $@/c.cdo > c.ml
$(CDO2ML) $@/$@.cdo > $@/$@.ml
ocamlfind $(CAML) -g -package cduce,oUnit -linkpkg -o $@/$@ c.ml $@/$@.ml $@/$@test.ml
./$@/$@
cdsdl:
$(CAML) -c -I `ocamlfind query sdl` $@/$@.mli
$(CDUCE) --compile -I `ocamlfind query sdl` $@/$@.cd
$(CDO2ML) -I `ocamlfind query sdl` $@/$@.cdo > $@/$@.ml
ocamlfind $(CAML) -package cduce,sdl,oUnit -linkpkg -o $@/$@ $@/$@.ml $@/$@test.ml
./$@/$@
.PHONY: eval
eval:
$(CDUCE) --compile $@.cd -I `ocamlfind query cduce`
ocamlfind $(CAML) -o $@ -pp "$(CDO2ML)" -impl $@.cdo -package cduce -linkpkg
./$@
$(CDUCE) --compile $@/$@.cd -I `ocamlfind query cduce`
ocamlfind $(CAML) -o $@/$@ -pp "$(CDO2ML)" -impl $@/$@.cdo -package cduce -linkpkg
./$@/$@
.PHONY: cdnum
cdnum:
$(CAML) -c $@.mli
$(CDUCE) --compile $@.cd -I `ocamlfind query num`
$(CDO2ML) $@.cdo > $@.ml
ocamlfind $(CAML) -package cduce,num,oUnit -linkpkg -o $@ $@.ml $@test.ml
./$@
$(CAML) -c $@/$@.mli
$(CDUCE) --compile $@/$@.cd -I `ocamlfind query num`
$(CDO2ML) $@/$@.cdo > $@/$@.ml
ocamlfind $(CAML) -I $@ -package cduce,num,oUnit -linkpkg -o $@/$@ $@/$@.ml $@/$@test.ml
./$@/$@
clean:
rm -f *.cmo *.cmx *.o *.cdo *.cmi a.ml c.ml cdnum cdnum.ml cdsdl.ml eval cdsdl cdmysql a oUnit-*
find . -name '*.c[dm][oxi]' -delete
find . -name '*.o' -delete
find . -name 'oUnit-*' -delete
rm -f a/a.ml a/c.ml cdnum/cdnum cdnum/cdnum.ml cdsdl/cdsdl.ml eval/eval cdsdl/cdsdl a/a
check:
./check.sh
.PHONY: a cdsdl cdmysql eval cdnum
print_int A.i;;
print_endline (A.f Char.uppercase "Abc");;
print_endline (A.pp (A.A (A.C 2)));;
print_endline A.home;;
print_newline ();;
......@@ -2,5 +2,5 @@ let aux ((Int,Int) -> Int)
| (x, 0 | 1) -> x
| (x, n) -> aux (x * n, n - 1)
let fact (x : Int) : Int = aux (Big_int.unit_big_int, x)
let fact (x : Int) : Int = aux (Big_int.unit_big_int, x)
(* Could write 1 instead of Big_int.unit_big_int. Just for fun. *)
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