summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2013-12-03 14:42:23 +0000
committerDamien Doligez <damien.doligez-inria.fr>2013-12-03 14:42:23 +0000
commit0f6873a183ea29afba8053d4c18d7c5bdf896488 (patch)
tree05f07c72e7a70fd8db1c94f9e5303983e9ffb290
parent2086ac55e6f4cfbd90c94ee4628f7754f7f24def (diff)
downloadocaml-0f6873a183ea29afba8053d4c18d7c5bdf896488.tar.gz
make the testsuite work on cygwin-64, where dynamic linking is not yet available
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14336 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--testsuite/makefiles/Makefile.common10
-rw-r--r--testsuite/makefiles/Makefile.one5
-rw-r--r--testsuite/makefiles/Makefile.several2
-rw-r--r--testsuite/tests/asmcomp/Makefile4
-rw-r--r--testsuite/tests/asmcomp/amd64.S2
-rw-r--r--testsuite/tests/callback/Makefile3
-rw-r--r--testsuite/tests/embedded/Makefile4
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/Makefile6
-rw-r--r--testsuite/tests/lib-dynlink-csharp/Makefile6
-rw-r--r--testsuite/tests/lib-dynlink-native/Makefile6
-rw-r--r--testsuite/tests/lib-scanf-2/Makefile7
-rw-r--r--testsuite/tests/runtime-errors/Makefile4
-rw-r--r--testsuite/tests/tool-ocamldoc/Makefile6
13 files changed, 49 insertions, 16 deletions
diff --git a/testsuite/makefiles/Makefile.common b/testsuite/makefiles/Makefile.common
index 54a0811db7..ae6aceaa2e 100644
--- a/testsuite/makefiles/Makefile.common
+++ b/testsuite/makefiles/Makefile.common
@@ -37,7 +37,7 @@ SET_LD_PATH=CAML_LD_LIBRARY_PATH="$(LD_PATH)"
# SORT is the Unix "sort" command. Usually a simple command, but may be an
# absolute name if the Windows "sort" command is in the PATH.
# SET_LD_PATH is a command prefix that sets the path for dynamic libraries
-# (LD_LIBRARY_PATH for Unix, PATH for Windows) using the LD_PATH shell
+# (CAML_LD_LIBRARY_PATH for Unix, PATH for Windows) using the LD_PATH shell
# variable. Note that for Windows we add Unix-syntax directory names in
# PATH, and Cygwin will translate it to Windows syntax.
@@ -48,9 +48,15 @@ OCAMLRUN=$(TOPDIR)/boot/ocamlrun$(EXE)
OCFLAGS=-nostdlib -I $(OTOPDIR)/stdlib $(COMPFLAGS)
OCOPTFLAGS=
+ifeq ($(SUPPORTS_SHARED_LIBRARIES),false)
+ CUSTOM = -custom
+else
+ CUSTOM =
+endif
+
OCAML=$(OCAMLRUN) $(OTOPDIR)/ocaml $(OCFLAGS) \
-init $(OTOPDIR)/testsuite/lib/empty
-OCAMLC=$(OCAMLRUN) $(OTOPDIR)/ocamlc $(OCFLAGS)
+OCAMLC=$(OCAMLRUN) $(OTOPDIR)/ocamlc $(CUSTOM) $(OCFLAGS)
OCAMLOPT=$(OCAMLRUN) $(OTOPDIR)/ocamlopt $(OCFLAGS)
OCAMLDOC=$(OCAMLRUN) $(OTOPDIR)/ocamldoc/ocamldoc
OCAMLLEX=$(OCAMLRUN) $(OTOPDIR)/lex/ocamllex
diff --git a/testsuite/makefiles/Makefile.one b/testsuite/makefiles/Makefile.one
index 16d02e8e33..9f95b3656d 100644
--- a/testsuite/makefiles/Makefile.one
+++ b/testsuite/makefiles/Makefile.one
@@ -27,13 +27,14 @@ GENERATED_SOURCES=$(ML_LEX_FILES) $(ML_YACC_FILES) $(MLI_YACC_FILES)
CUSTOM_FLAG=`if [ -n "$(C_FILES)" ]; then echo '-custom'; fi`
ADD_CFLAGS+=$(CUSTOM_FLAG)
-MYRUNTIME=`if [ -z "$(C_FILES)" ]; then echo '$(OCAMLRUN)'; fi`
+MYRUNTIME=`if [ -z "$(C_FILES)$(CUSTOM)" ]; then echo '$(OCAMLRUN)'; fi`
CC=$(NATIVECC) $(NATIVECCCOMPOPTS)
.PHONY: default
default:
- @$(SET_LD_PATH) $(MAKE) compile run
+ @$(MAKE) compile
+ @$(SET_LD_PATH) $(MAKE) run
.PHONY: compile
compile: $(ML_FILES) $(CMO_FILES) $(MAIN_MODULE).cmo
diff --git a/testsuite/makefiles/Makefile.several b/testsuite/makefiles/Makefile.several
index d4a5caac34..3482e3af30 100644
--- a/testsuite/makefiles/Makefile.several
+++ b/testsuite/makefiles/Makefile.several
@@ -20,7 +20,7 @@ O_FILES=$(C_FILES:=.o)
CUSTOM_FLAG=`if [ -n "$(C_FILES)" ]; then echo '-custom'; fi`
ADD_CFLAGS+=$(CUSTOM_FLAG)
-MYRUNTIME=`if [ -z "$(C_FILES)" ]; then echo '$(OCAMLRUN)'; fi`
+MYRUNTIME=`if [ -z "$(C_FILES)$(CUSTOM)" ]; then echo '$(OCAMLRUN)'; fi`
FORTRAN_LIB=`if [ -n "$(F_FILES)" ]; then echo '$(FORTRAN_LIBRARY)'; fi`
ADD_CFLAGS+=$(FORTRAN_LIB)
ADD_OPTFLAGS+=$(FORTRAN_LIB)
diff --git a/testsuite/tests/asmcomp/Makefile b/testsuite/tests/asmcomp/Makefile
index d83b79d2d2..5fdde20419 100644
--- a/testsuite/tests/asmcomp/Makefile
+++ b/testsuite/tests/asmcomp/Makefile
@@ -117,7 +117,9 @@ default:
$(MAKE) all; \
fi
-all: arch codegen tests
+all:
+ $(MAKE) arch codegen
+ $(MAKE) tests
codegen: parsecmm.ml lexcmm.ml $(OBJS:.cmo=.cmi) $(OBJS) main.cmo
@$(OCAMLC) $(LINKFLAGS) -o codegen $(OTHEROBJS) $(OBJS) main.cmo
diff --git a/testsuite/tests/asmcomp/amd64.S b/testsuite/tests/asmcomp/amd64.S
index 846eab951b..16dbaec11b 100644
--- a/testsuite/tests/asmcomp/amd64.S
+++ b/testsuite/tests/asmcomp/amd64.S
@@ -58,7 +58,7 @@ CAML_C_CALL:
#ifdef SYS_macosx
.literal16
-#elif defined(SYS_mingw64)
+#elif defined(SYS_mingw64) || defined(SYS_cygwin)
.section .rodata.cst8
#else
.section .rodata.cst8,"aM",@progbits,8
diff --git a/testsuite/tests/callback/Makefile b/testsuite/tests/callback/Makefile
index 26d02ea8ab..58b5ed8aa9 100644
--- a/testsuite/tests/callback/Makefile
+++ b/testsuite/tests/callback/Makefile
@@ -19,7 +19,8 @@ LD_PATH=$(TOPDIR)/otherlibs/unix
.PHONY: default
default:
@case " $(OTHERLIBRARIES) " in \
- *' unix '*) $(SET_LD_PATH) $(MAKE) run-byte run-opt;; \
+ *' unix '*) $(SET_LD_PATH) $(MAKE) run-byte; \
+ $(SET_LD_PATH) $(MAKE) run-opt;; \
esac
.PHONY: common
diff --git a/testsuite/tests/embedded/Makefile b/testsuite/tests/embedded/Makefile
index 2a01c20848..a8de4dc00e 100644
--- a/testsuite/tests/embedded/Makefile
+++ b/testsuite/tests/embedded/Makefile
@@ -13,7 +13,9 @@
BASEDIR=../..
.PHONY: default
-default: compile run
+default:
+ $(MAKE) compile
+ $(MAKE) run
.PHONY: compile
compile: caml
diff --git a/testsuite/tests/lib-dynlink-bytecode/Makefile b/testsuite/tests/lib-dynlink-bytecode/Makefile
index 74f27b9f52..832e367ee6 100644
--- a/testsuite/tests/lib-dynlink-bytecode/Makefile
+++ b/testsuite/tests/lib-dynlink-bytecode/Makefile
@@ -17,7 +17,11 @@ LD_PATH=.:$(TOPDIR)/otherlibs/dynlink
.PHONY: default
default:
- @$(SET_LD_PATH) $(MAKE) compile run
+ @if ! $(SUPPORTS_SHARED_LIBRARIES); then \
+ echo 'skipped (shared libraries not available)'; \
+ else \
+ $(SET_LD_PATH) $(MAKE) compile run; \
+ fi
.PHONY: compile
compile: caml
diff --git a/testsuite/tests/lib-dynlink-csharp/Makefile b/testsuite/tests/lib-dynlink-csharp/Makefile
index 17eeea4364..c576a09909 100644
--- a/testsuite/tests/lib-dynlink-csharp/Makefile
+++ b/testsuite/tests/lib-dynlink-csharp/Makefile
@@ -18,7 +18,11 @@ LD_PATH=$(TOPDIR)/otherlibs/bigarray
.PHONY: default
default:
- @if $(BYTECODE_ONLY); then : ; else \
+ @if ! $(SUPPORTS_SHARED_LIBRARIES); then \
+ echo 'skipped (shared libraries not available)'; \
+ elif $(BYTECODE_ONLY); then \
+ echo 'skipped (native compiler not available)' ; \
+ else \
$(SET_LD_PATH) $(MAKE) all; \
fi
diff --git a/testsuite/tests/lib-dynlink-native/Makefile b/testsuite/tests/lib-dynlink-native/Makefile
index 80e422121b..54126ff59d 100644
--- a/testsuite/tests/lib-dynlink-native/Makefile
+++ b/testsuite/tests/lib-dynlink-native/Makefile
@@ -19,7 +19,11 @@ LD_PATH=$(TOPDIR)/otherlibs/$(UNIXLIBVAR)unix:$(TOPDIR)/otherlibs/systhreads:$(T
.PHONY: default
default:
- @if $(BYTECODE_ONLY); then : ; else \
+ @if ! $(SUPPORTS_SHARED_LIBRARIES); then \
+ echo 'skipped (shared libraries not available)'; \
+ elif $(BYTECODE_ONLY); then \
+ echo 'skipped (native compiler not available)' ; \
+ else \
$(SET_LD_PATH) $(MAKE) all; \
fi
diff --git a/testsuite/tests/lib-scanf-2/Makefile b/testsuite/tests/lib-scanf-2/Makefile
index 6b8d56b08b..b41f72c9b5 100644
--- a/testsuite/tests/lib-scanf-2/Makefile
+++ b/testsuite/tests/lib-scanf-2/Makefile
@@ -15,9 +15,12 @@ BASEDIR=../..
COMPFLAGS=-I $(OTOPDIR)/otherlibs/$(UNIXLIBVAR)unix
LD_PATH=$(TOPDIR)/otherlibs/$(UNIXLIBVAR)unix
+MYRUNTIME=`if [ -z "$(CUSTOM)" ]; then echo '$(OCAMLRUN)'; fi`
+
.PHONY: default
default:
- @$(SET_LD_PATH) $(MAKE) compile run
+ @$(MAKE) compile
+ @$(SET_LD_PATH) $(MAKE) run
.PHONY: compile
compile: tscanf2_io.cmo
@@ -34,7 +37,7 @@ compile: tscanf2_io.cmo
run:
@printf " ... testing with ocamlc"
- @$(OCAMLRUN) ./master.byte "$(OTOPDIR)/boot/ocamlrun$(EXE) \
+ @$(MYRUNTIME) ./master.byte "$(OTOPDIR)/boot/ocamlrun$(EXE) \
`$(CYGPATH) ./slave.byte`" \
>result.byte 2>&1
@$(DIFF) reference result.byte >/dev/null \
diff --git a/testsuite/tests/runtime-errors/Makefile b/testsuite/tests/runtime-errors/Makefile
index b5d1d7bb4b..2c0bed9b63 100644
--- a/testsuite/tests/runtime-errors/Makefile
+++ b/testsuite/tests/runtime-errors/Makefile
@@ -13,7 +13,9 @@
BASEDIR=../..
.PHONY: default
-default: compile run
+default:
+ $(MAKE) compile
+ $(MAKE) run
.PHONY: compile
compile:
diff --git a/testsuite/tests/tool-ocamldoc/Makefile b/testsuite/tests/tool-ocamldoc/Makefile
index cf454149ab..976010e5f0 100644
--- a/testsuite/tests/tool-ocamldoc/Makefile
+++ b/testsuite/tests/tool-ocamldoc/Makefile
@@ -18,7 +18,11 @@ DOCFLAGS=-I $(OTOPDIR)/stdlib $(COMPFLAGS)
.PHONY: default
default:
- @$(SET_LD_PATH) $(MAKE) run
+ @if ! $(SUPPORTS_SHARED_LIBRARIES); then \
+ echo 'skipped (shared libraries not available)'; \
+ else \
+ $(SET_LD_PATH) $(MAKE) run; \
+ fi
.PHONY: run
run: $(CUSTOM_MODULE).cmo