summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2013-05-16 12:20:59 +0000
committerDamien Doligez <damien.doligez-inria.fr>2013-05-16 12:20:59 +0000
commit1a2c1ed3e22882cb2e40db09c2215054b768659d (patch)
tree0d67dca6da28a43a412253a1dee0bc4444773a9b
parent5a1a95f5e6d76acf9e0e6a8cb94f203d28068378 (diff)
make the testsuite work without installing OCaml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13682 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--testsuite/tests/backtrace/Makefile4
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/Makefile19
-rw-r--r--testsuite/tests/lib-scanf-2/Makefile17
-rw-r--r--testsuite/tests/lib-threads/test3.runner2
-rw-r--r--testsuite/tests/lib-threads/test4.runner2
-rw-r--r--testsuite/tests/lib-threads/test5.runner2
-rw-r--r--testsuite/tests/lib-threads/test6.runner2
-rw-r--r--testsuite/tests/lib-threads/test7.runner2
-rw-r--r--testsuite/tests/lib-threads/testsignal.runner2
-rw-r--r--testsuite/tests/lib-threads/testsignal2.runner2
-rw-r--r--testsuite/tests/lib-threads/torture.runner2
-rw-r--r--testsuite/tests/runtime-errors/Makefile20
12 files changed, 49 insertions, 27 deletions
diff --git a/testsuite/tests/backtrace/Makefile b/testsuite/tests/backtrace/Makefile
index a876c5bba..9493e632f 100644
--- a/testsuite/tests/backtrace/Makefile
+++ b/testsuite/tests/backtrace/Makefile
@@ -11,7 +11,7 @@
#########################################################################
BASEDIR=../..
-EXECNAME=./program$(EXE)
+EXECNAME=program$(EXE)
.PHONY: run-all
run-all:
@@ -21,7 +21,7 @@ run-all:
for arg in a b c d ''; do \
printf " ... testing '$$file' with argument '$$arg':"; \
F="`basename $$file .ml`"; \
- (OCAMLRUNPARAM=b=1 $(EXECNAME) $$arg || true) \
+ (OCAMLRUNPARAM=b=1 $(OCAMLRUN) $(EXECNAME) $$arg || true) \
>$$F.$$arg.result 2>&1; \
$(DIFF) $$F.$$arg.reference $$F.$$arg.result >/dev/null \
&& echo " => passed" || echo " => failed"; \
diff --git a/testsuite/tests/lib-dynlink-bytecode/Makefile b/testsuite/tests/lib-dynlink-bytecode/Makefile
index 0f6a40ba2..0c8d877c2 100644
--- a/testsuite/tests/lib-dynlink-bytecode/Makefile
+++ b/testsuite/tests/lib-dynlink-bytecode/Makefile
@@ -12,8 +12,10 @@
BASEDIR=../..
+.PHONY: default
default: compile run
+.PHONY: compile
compile:
@$(OCAMLC) -c registry.ml
@for file in stub*.c; do \
@@ -26,31 +28,36 @@ compile:
$(OCAMLMKLIB) -o `basename $$file .ml` `basename $$file ml`cmo; \
done
@$(OCAMLC) -c main.ml
+ @rm -f main static custom custom.exe
@$(OCAMLC) -o main dynlink.cma registry.cmo main.cmo
@$(OCAMLC) -o static -linkall registry.cmo plug1.cma plug2.cma \
- -use-runtime $(OTOPDIR)/byterun/ocamlrun
- @$(OCAMLC) -o custom -custom -linkall registry.cmo plug2.cma \
+ -use-runtime $(OTOPDIR)/boot/ocamlrun$(EXE)
+ @$(OCAMLC) -o custom$(EXE) -custom -linkall registry.cmo plug2.cma \
plug1.cma -I .
+.PHONY: run
run:
@printf " ... testing 'main'"
- @LD_LIBRARY_PATH="`pwd`" ./main plug1.cma plug2.cma >main.result
+ @LD_LIBRARY_PATH="`pwd`" $(OCAMLRUN) ./main plug1.cma plug2.cma \
+ >main.result
@$(DIFF) main.reference main.result >/dev/null \
&& echo " => passed" || echo " => failed"
@printf " ... testing 'static'"
- @LD_LIBRARY_PATH="`pwd`" ./static >static.result
+ @LD_LIBRARY_PATH="`pwd`" $(OCAMLRUN) ./static >static.result
@$(DIFF) static.reference static.result >/dev/null \
&& echo " => passed" || echo " => failed"
@printf " ... testing 'custom'"
- @LD_LIBRARY_PATH="`pwd`" ./custom > custom.result
+ @LD_LIBRARY_PATH="`pwd`" ./custom$(EXE) > custom.result
@$(DIFF) custom.reference custom.result >/dev/null \
&& echo " => passed" || echo " => failed"
+.PHONY: promote
promote: defaultpromote
+.PHONY: clean
clean: defaultclean
- @rm -f ./main ./static ./custom *.result marshal.data
+ @rm -f main static custom custom.exe *.result marshal.data
include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/lib-scanf-2/Makefile b/testsuite/tests/lib-scanf-2/Makefile
index 862266f0b..067f3323b 100644
--- a/testsuite/tests/lib-scanf-2/Makefile
+++ b/testsuite/tests/lib-scanf-2/Makefile
@@ -12,32 +12,41 @@
BASEDIR=../..
+.PHONY: default
default: compile run
+.PHONY: compile
compile: tscanf2_io.cmo
+ @rm -f master.byte master.native master.native.exe
+ @rm -f slave.byte slave.native slave.native.exe
@$(OCAMLC) unix.cma tscanf2_io.cmo -o master.byte tscanf2_master.ml
@$(OCAMLC) tscanf2_io.cmo -o slave.byte tscanf2_slave.ml
@if $(BYTECODE_ONLY); then : ; else \
$(MAKE) tscanf2_io.cmx; \
- $(OCAMLOPT) unix.cmxa tscanf2_io.cmx -o master.native \
+ $(OCAMLOPT) unix.cmxa tscanf2_io.cmx -o master.native$(EXE) \
tscanf2_master.ml; \
- $(OCAMLOPT) tscanf2_io.cmx -o slave.native tscanf2_slave.ml; \
+ $(OCAMLOPT) tscanf2_io.cmx -o slave.native$(EXE) tscanf2_slave.ml; \
fi
run:
@printf " ... testing with ocamlc"
- @./master.byte "`$(CYGPATH) ./slave.byte`" >result.byte 2>&1
+ @$(OCAMLRUN) ./master.byte "$(OTOPDIR)/boot/ocamlrun$(EXE) \
+ `$(CYGPATH) ./slave.byte`" \
+ >result.byte 2>&1
@$(DIFF) reference result.byte >/dev/null \
&& if $(BYTECODE_ONLY); then : ; else \
printf " ocamlopt"; \
- ./master.native "`$(CYGPATH) ./slave.native`" >result.native 2>&1;\
+ ./master.native$(EXE) "`$(CYGPATH) ./slave.native`" \
+ >result.native 2>&1; \
$(DIFF) reference result.native >/dev/null; \
fi \
&& echo " => passed" || echo " => failed"
+.PHONY: promote
promote:
@cp result.byte reference
+.PHONY: clean
clean: defaultclean
@rm -f master.* slave.* result.*
diff --git a/testsuite/tests/lib-threads/test3.runner b/testsuite/tests/lib-threads/test3.runner
index 151e7cc23..dc04062a1 100644
--- a/testsuite/tests/lib-threads/test3.runner
+++ b/testsuite/tests/lib-threads/test3.runner
@@ -10,7 +10,7 @@
# #
#########################################################################
-./program > test3.result &
+$RUNTIME ./program >test3.result &
pid=$!
sleep 5
kill -9 $pid
diff --git a/testsuite/tests/lib-threads/test4.runner b/testsuite/tests/lib-threads/test4.runner
index dee59436b..43ac56329 100644
--- a/testsuite/tests/lib-threads/test4.runner
+++ b/testsuite/tests/lib-threads/test4.runner
@@ -10,4 +10,4 @@
# #
#########################################################################
-./program < test4.data > test4.result 2> /dev/null || true
+$RUNTIME ./program <test4.data >test4.result 2>/dev/null || true
diff --git a/testsuite/tests/lib-threads/test5.runner b/testsuite/tests/lib-threads/test5.runner
index 3a8a694c0..80dfe37ea 100644
--- a/testsuite/tests/lib-threads/test5.runner
+++ b/testsuite/tests/lib-threads/test5.runner
@@ -10,7 +10,7 @@
# #
#########################################################################
-./program > test5.result &
+$RUNTIME ./program >test5.result &
pid=$!
sleep 3
kill -9 $pid
diff --git a/testsuite/tests/lib-threads/test6.runner b/testsuite/tests/lib-threads/test6.runner
index 400675c62..50f88d8c0 100644
--- a/testsuite/tests/lib-threads/test6.runner
+++ b/testsuite/tests/lib-threads/test6.runner
@@ -10,7 +10,7 @@
# #
#########################################################################
-./program > test6.result &
+$RUNTIME ./program >test6.result &
pid=$!
sleep 1
kill -9 $pid
diff --git a/testsuite/tests/lib-threads/test7.runner b/testsuite/tests/lib-threads/test7.runner
index 8c9085ef5..ccd56a31d 100644
--- a/testsuite/tests/lib-threads/test7.runner
+++ b/testsuite/tests/lib-threads/test7.runner
@@ -10,7 +10,7 @@
# #
#########################################################################
-./program > test7.result &
+$RUNTIME ./program >test7.result &
pid=$!
sleep 1
kill -9 $pid
diff --git a/testsuite/tests/lib-threads/testsignal.runner b/testsuite/tests/lib-threads/testsignal.runner
index dcc4581a1..ed4e9279e 100644
--- a/testsuite/tests/lib-threads/testsignal.runner
+++ b/testsuite/tests/lib-threads/testsignal.runner
@@ -10,7 +10,7 @@
# #
#########################################################################
-./program > testsignal.result &
+$RUNTIME ./program >testsignal.result &
pid=$!
sleep 3
kill -INT $pid
diff --git a/testsuite/tests/lib-threads/testsignal2.runner b/testsuite/tests/lib-threads/testsignal2.runner
index cf09ff483..19a3942f9 100644
--- a/testsuite/tests/lib-threads/testsignal2.runner
+++ b/testsuite/tests/lib-threads/testsignal2.runner
@@ -10,7 +10,7 @@
# #
#########################################################################
-./program > testsignal2.result &
+$RUNTIME ./program >testsignal2.result &
pid=$!
sleep 3
kill -INT $pid
diff --git a/testsuite/tests/lib-threads/torture.runner b/testsuite/tests/lib-threads/torture.runner
index 1d8497f49..fc1ed3879 100644
--- a/testsuite/tests/lib-threads/torture.runner
+++ b/testsuite/tests/lib-threads/torture.runner
@@ -10,4 +10,4 @@
# #
#########################################################################
-./program < torture.data > torture.result 2> /dev/null || true
+$RUNTIME ./program <torture.data >torture.result 2>/dev/null || true
diff --git a/testsuite/tests/runtime-errors/Makefile b/testsuite/tests/runtime-errors/Makefile
index c10d854b7..0ec6bb00d 100644
--- a/testsuite/tests/runtime-errors/Makefile
+++ b/testsuite/tests/runtime-errors/Makefile
@@ -12,37 +12,43 @@
BASEDIR=../..
+.PHONY: default
default: compile run
+.PHONY: compile
compile:
@for f in *.ml; do \
- $(OCAMLC) -w a -o `basename $$f ml`bytecode $$f; \
+ F=`basename $$f .ml`; \
+ rm -f $$F.bytecode $$F.native $$F.native.exe; \
+ $(OCAMLC) -w a -o $$F.bytecode $$f; \
if $(BYTECODE_ONLY); then : ; else \
- $(OCAMLOPT) -w a -o `basename $$f ml`native $$f; \
+ $(OCAMLOPT) -w a -o $$F.native$(EXE) $$f; \
fi; \
done
@grep -q HAS_STACK_OVERFLOW_DETECTION $(TOPDIR)/config/s.h \
- || rm -f stackoverflow.native
+ || rm -f stackoverflow.native$(EXE)
run:
@ulimit -s 1024; \
for f in *.bytecode; do \
printf " ... testing '$$f':"; \
- (./$$f > $$f.result 2>&1 || true); \
+ $(OCAMLRUN) ./$$f >$$f.result 2>&1 || true; \
DIFF="$(DIFF)" sh $$f.checker \
&& echo " => passed" || echo " => failed"; \
fn=`basename $$f bytecode`native; \
- if $(BYTECODE_ONLY) || [ ! -f "$$fn" ] ; then : ; else \
+ if $(BYTECODE_ONLY) || [ ! -f "$${fn}$(EXE)" ] ; then : ; else \
printf " ... testing '$$fn':"; \
- (./$$fn > $$fn.result 2>&1 || true); \
+ ./$${fn}$(EXE) >$$fn.result 2>&1 || true; \
DIFF="$(DIFF)" sh $$fn.checker \
&& echo " => passed" || echo " => failed"; \
fi; \
done
+.PHONY: promote
promote: defaultpromote
+.PHONY: clean
clean: defaultclean
- @rm -f *.bytecode *.native *.result
+ @rm -f *.bytecode *.native *.native.exe *.result
include $(BASEDIR)/makefiles/Makefile.common