diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2013-05-03 15:52:56 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2013-05-03 15:52:56 +0000 |
commit | ea4b17ad1ef3b42a52284c1c6bfb6d889f9aa944 (patch) | |
tree | 15f989760f7dae84a56f26f1e99ba92913518893 | |
parent | e2dbb7f5160fb02485290279a2e70961dd2202d6 (diff) |
testsuite: general cleanup of makefiles
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13648 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | testsuite/makefiles/Makefile.common | 2 | ||||
-rw-r--r-- | testsuite/makefiles/Makefile.okbad | 19 | ||||
-rw-r--r-- | testsuite/makefiles/Makefile.one | 27 | ||||
-rw-r--r-- | testsuite/makefiles/Makefile.several | 52 | ||||
-rw-r--r-- | testsuite/makefiles/Makefile.toplevel | 10 | ||||
-rw-r--r-- | testsuite/tests/asmcomp/Makefile | 4 | ||||
-rw-r--r-- | testsuite/tests/backtrace/Makefile | 7 | ||||
-rw-r--r-- | testsuite/tests/callback/Makefile | 12 | ||||
-rw-r--r-- | testsuite/tests/embedded/Makefile | 4 | ||||
-rw-r--r-- | testsuite/tests/lib-dynlink-bytecode/Makefile | 27 | ||||
-rw-r--r-- | testsuite/tests/lib-dynlink-csharp/Makefile | 23 | ||||
-rw-r--r-- | testsuite/tests/lib-dynlink-native/Makefile | 33 | ||||
-rw-r--r-- | testsuite/tests/lib-scanf-2/Makefile | 16 | ||||
-rw-r--r-- | testsuite/tests/runtime-errors/Makefile | 6 | ||||
-rw-r--r-- | testsuite/tests/tool-ocaml/Makefile | 6 | ||||
-rw-r--r-- | testsuite/tests/tool-ocamldoc/Makefile | 13 | ||||
-rw-r--r-- | testsuite/tests/typing-polyvariants-bugs-2/Makefile | 5 | ||||
-rw-r--r-- | testsuite/tests/warnings/Makefile | 6 |
18 files changed, 162 insertions, 110 deletions
diff --git a/testsuite/makefiles/Makefile.common b/testsuite/makefiles/Makefile.common index 8cd618bfc..72b9fdbfc 100644 --- a/testsuite/makefiles/Makefile.common +++ b/testsuite/makefiles/Makefile.common @@ -24,7 +24,7 @@ CANKILL=true include $(TOPDIR)/config/Makefile -TTOP = "`$(CYGPATH) $(TOPDIR)`" +TTOP="`$(CYGPATH) $(TOPDIR)`" OCAMLRUN=$(TOPDIR)/boot/ocamlrun$(EXE) OCAML=$(OCAMLRUN) $(TTOP)/ocaml -I $(TTOP)/stdlib $(COMPFLAGS) diff --git a/testsuite/makefiles/Makefile.okbad b/testsuite/makefiles/Makefile.okbad index d54b42ac9..c2e157308 100644 --- a/testsuite/makefiles/Makefile.okbad +++ b/testsuite/makefiles/Makefile.okbad @@ -16,15 +16,18 @@ compile: @for file in *.ml; do \ printf " ... testing '$$file'"; \ if [ `echo $$file | grep bad` ]; then \ - if $(OCAMLC) -c -w a $$file 2> /dev/null; then \ - echo " => failed" && exit 1; \ - else echo " => passed"; \ - fi; \ + $(OCAMLC) -c -w a $$file 2>/dev/null \ + && echo " => failed" || echo " => passed"; \ else \ - test -f `basename $$file ml`mli && $(OCAMLC) -c -w a `basename $$file ml`mli; \ - $(OCAMLC) -c -w a $$file 2> /dev/null || (echo " => failed" && exit 1); \ - test -f `basename $$file ml`reference && $(OCAMLC) `basename $$file ml`cmo && ./a.out > `basename $$file ml`result && ($(DIFF) `basename $$file ml`reference `basename $$file ml`result || (echo " => failed" && exit 1)); \ - echo " => passed"; \ + F="`basename $$file .ml`"; \ + test -f $$F.mli && $(OCAMLC) -c -w a $$F.mli; \ + $(OCAMLC) -c -w a $$file 2>/dev/null \ + && if [ -f $$F.reference ]; then \ + $(OCAMLC) $$F.cmo \ + && ./a.out >$$F.result \ + && $(DIFF) $$F.reference $$F.result >/dev/null; \ + fi \ + && echo " => passed" || echo " => failed"; \ fi; \ done diff --git a/testsuite/makefiles/Makefile.one b/testsuite/makefiles/Makefile.one index 5f0823b01..40337d7a3 100644 --- a/testsuite/makefiles/Makefile.one +++ b/testsuite/makefiles/Makefile.one @@ -35,26 +35,31 @@ compile: $(ML_FILES) $(CMO_FILES) $(MAIN_MODULE).cmo $(NATIVECC) $(NATIVECCCOMPOPTS) -c -I$(TOPDIR)/byterun $$file.c; \ done; @rm -f program.byte program.byte.exe - @$(OCAMLC) $(ADD_COMPFLAGS) $(ADD_CFLAGS) -o program.byte $(O_FILES) $(CMA_FILES) $(CMO_FILES) $(ADD_CMO_FILES) $(MAIN_MODULE).cmo + @$(OCAMLC) $(ADD_COMPFLAGS) $(ADD_CFLAGS) -o program.byte $(O_FILES) \ + $(CMA_FILES) $(CMO_FILES) $(ADD_CMO_FILES) $(MAIN_MODULE).cmo @if [ -z "$(BYTECODE_ONLY)" ]; then \ rm -f program.native program.native.exe; \ $(MAKE) $(CMX_FILES) $(MAIN_MODULE).cmx; \ - $(OCAMLOPT) $(ADD_COMPFLAGS) -o program.native $(O_FILES) $(CMXA_FILES) $(CMX_FILES) $(ADD_CMX_FILES) $(MAIN_MODULE).cmx; \ + $(OCAMLOPT) $(ADD_COMPFLAGS) -o program.native $(O_FILES) \ + $(CMXA_FILES) $(CMX_FILES) $(ADD_CMX_FILES) \ + $(MAIN_MODULE).cmx; \ fi run: @printf " ... testing with ocamlc" - @./program.byte $(EXEC_ARGS) > $(MAIN_MODULE).result || (echo " => failed" && exit 1) - @$(DIFF) $(MAIN_MODULE).reference $(MAIN_MODULE).result > /dev/null || (echo " => failed" && exit 1) - @if [ -z "$(BYTECODE_ONLY)" ]; then \ - printf " ocamlopt"; \ - ./program.native $(EXEC_ARGS) > $(MAIN_MODULE).result || (echo " => failed" && exit 1); \ - $(DIFF) $(MAIN_MODULE).reference $(MAIN_MODULE).result > /dev/null || (echo " => failed" && exit 1); \ - fi - @echo " => passed" + @./program.byte $(EXEC_ARGS) >$(MAIN_MODULE).result \ + && $(DIFF) $(MAIN_MODULE).reference $(MAIN_MODULE).result >/dev/null \ + && if [ -z "$(BYTECODE_ONLY)" ]; then \ + printf " ocamlopt"; \ + ./program.native $(EXEC_ARGS) > $(MAIN_MODULE).result \ + && $(DIFF) $(MAIN_MODULE).reference $(MAIN_MODULE).result \ + >/dev/null; \ + fi \ + && echo " => passed" || echo " => failed" + promote: defaultpromote clean: defaultclean @rm -f *.result ./program.* $(GENERATED_SOURCES) $(O_FILES) \ - $(TEST_TEMP_FILES) + $(TEST_TEMP_FILES) diff --git a/testsuite/makefiles/Makefile.several b/testsuite/makefiles/Makefile.several index c6deb477e..c63f630c8 100644 --- a/testsuite/makefiles/Makefile.several +++ b/testsuite/makefiles/Makefile.several @@ -18,14 +18,16 @@ CMA_FILES=$(LIBRARIES:=.cma) CMXA_FILES=$(LIBRARIES:=.cmxa) O_FILES=$(C_FILES:=.o) -CUSTOM_FLAG=`if [ -z "$(C_FILES)" ]; then true; else echo '-custom'; fi` +CUSTOM_FLAG=`if [ -n "$(C_FILES)" ]; then echo '-custom'; fi` ADD_CFLAGS+=$(CUSTOM_FLAG) -FORTRAN_LIB=`if [ -z "$(F_FILES)" ]; then true; else echo '$(FORTRAN_LIBRARY)'; fi` +FORTRAN_LIB=`if [ -n "$(F_FILES)" ]; then echo '$(FORTRAN_LIBRARY)'; fi` ADD_CFLAGS+=$(FORTRAN_LIB) ADD_OPTFLAGS+=$(FORTRAN_LIB) check: - @if [ -n "$(FORTRAN_COMPILER)" -o -z "$(F_FILES)" ]; then $(MAKE) run-all; fi + @if [ -n "$(FORTRAN_COMPILER)" -o -z "$(F_FILES)" ]; then \ + $(MAKE) run-all; \ + fi run-all: @for file in $(C_FILES); do \ @@ -36,36 +38,38 @@ run-all: done; @for file in *.ml; do \ if [ -f `basename $$file ml`precheck ]; then \ - CANKILL=$(CANKILL) sh `basename $$file ml`precheck || continue; \ - fi; \ + CANKILL=$(CANKILL) sh `basename $$file ml`precheck || continue; \ + fi; \ printf " ... testing '$$file':"; \ - $(MAKE) run-file DESC=ocamlc COMP='$(OCAMLC)' COMPFLAGS='$(ADD_COMPFLAGS) $(ADD_CFLAGS) $(O_FILES) -w a $(CMA_FILES) -I $(TTOP)/testsuite/lib $(CMO_FILES)' FILE=$$file PROGRAM_ARGS=$(PROGRAM_ARGS) && \ - if [ -z "$(BYTECODE_ONLY)" ]; then \ - $(MAKE) run-file DESC=ocamlopt COMP='$(OCAMLOPT)' COMPFLAGS='$(ADD_COMPFLAGS) $(ADD_OPTFLAGS) $(O_FILES) -w a $(CMXA_FILES) -I $(TTOP)/testsuite/lib $(CMX_FILES)' FILE=$$file PROGRAM_ARGS=$(PROGRAM_ARGS); \ - fi && \ - if [ ! -z $(UNSAFE) ]; then \ - $(MAKE) run-file DESC=ocamlc-unsafe COMP='$(OCAMLC)' COMPFLAGS='-w a -unsafe -I $(TTOP)/testsuite/lib $(CMO_FILES)' FILE=$$file && \ - if [ -z "$(BYTECODE_ONLY)" ]; then \ + $(MAKE) run-file DESC=ocamlc COMP='$(OCAMLC)' COMPFLAGS='$(ADD_COMPFLAGS) $(ADD_CFLAGS) $(O_FILES) -w a $(CMA_FILES) -I $(TTOP)/testsuite/lib $(CMO_FILES)' FILE=$$file PROGRAM_ARGS=$(PROGRAM_ARGS) \ + && if [ -z "$(BYTECODE_ONLY)" ]; then \ + $(MAKE) run-file DESC=ocamlopt COMP='$(OCAMLOPT)' COMPFLAGS='$(ADD_COMPFLAGS) $(ADD_OPTFLAGS) $(O_FILES) -w a $(CMXA_FILES) -I $(TTOP)/testsuite/lib $(CMX_FILES)' FILE=$$file PROGRAM_ARGS=$(PROGRAM_ARGS); \ + fi \ + && if [ ! -z $(UNSAFE) ]; then \ + $(MAKE) run-file DESC=ocamlc-unsafe COMP='$(OCAMLC)' COMPFLAGS='-w a -unsafe -I $(TTOP)/testsuite/lib $(CMO_FILES)' FILE=$$file \ + && if [ -z "$(BYTECODE_ONLY)" ]; then \ $(MAKE) run-file DESC=ocamlopt-unsafe COMP='$(OCAMLOPT)' COMPFLAGS='-w a -unsafe -I $(TTOP)/testsuite/lib $(CMX_FILES)' FILE=$$file; \ - fi; \ - fi && \ - echo " => passed"; \ - done; + fi; \ + fi \ + && echo " => passed" || echo " => failed"; \ + done run-file: @printf " $(DESC)" @rm -f program program.exe @$(COMP) $(COMPFLAGS) $(FILE) -o program$(EXE) - @if [ -f `basename $(FILE) ml`runner ]; then \ - sh `basename $(FILE) ml`runner; \ + @F="`basename $(FILE) .ml`"; \ + if [ -f $$F.runner ]; then \ + sh $$F.runner; \ else \ - ./program$(EXE) $(PROGRAM_ARGS) > `basename $(FILE) ml`result; \ - fi || (echo " => failed" && exit 1) - @if [ -f `basename $(FILE) ml`checker ]; then \ - DIFF="$(DIFF)" sh `basename $(FILE) ml`checker; \ + ./program$(EXE) $(PROGRAM_ARGS) > $$F.result; \ + fi \ + && \ + if [ -f $$F.checker ]; then \ + DIFF="$(DIFF)" sh $$F.checker; \ else \ - $(DIFF) `basename $(FILE) ml`reference `basename $(FILE) ml`result > /dev/null; \ - fi || (echo " => failed" && exit 1) + $(DIFF) $$F.reference $$F.result >/dev/null; \ + fi promote: defaultpromote diff --git a/testsuite/makefiles/Makefile.toplevel b/testsuite/makefiles/Makefile.toplevel index 3be6afec2..46acb3d78 100644 --- a/testsuite/makefiles/Makefile.toplevel +++ b/testsuite/makefiles/Makefile.toplevel @@ -12,15 +12,17 @@ default: @for file in *.ml; do \ - $(OCAML) $(TOPFLAGS) < $$file 2>&1 | grep -v '^ OCaml version' > $$file.result; \ + $(OCAML) $(TOPFLAGS) <$$file 2>&1 \ + | grep -v '^ OCaml version' > $$file.result; \ if [ -f $$file.principal.reference ]; then \ - $(OCAML) $(TOPFLAGS) -principal < $$file 2>&1 | grep -v '^ OCaml version' > $$file.principal.result; \ + $(OCAML) $(TOPFLAGS) -principal <$$file 2>&1 \ + | grep -v '^ OCaml version' > $$file.principal.result; \ fi; \ done @for file in *.reference; do \ printf " ... testing '$$file':"; \ - $(DIFF) $$file `basename $$file reference`result \ - && echo " => passed" || echo " => failed"; \ + $(DIFF) $$file `basename $$file reference`result >/dev/null \ + && echo " => passed" || echo " => failed"; \ done promote: defaultpromote diff --git a/testsuite/tests/asmcomp/Makefile b/testsuite/tests/asmcomp/Makefile index d28ae8cef..f68bcf3f5 100644 --- a/testsuite/tests/asmcomp/Makefile +++ b/testsuite/tests/asmcomp/Makefile @@ -148,8 +148,8 @@ tests: $(CASES:=.o) done one: - @$(CC) -o $(NAME).out $(ARGS_$(NAME)) $(NAME).o $(ARCH).o || (echo " => failed" && exit 1) - @echo " => passed" + @$(CC) -o $(NAME).out $(ARGS_$(NAME)) $(NAME).o $(ARCH).o \ + && echo " => passed" || echo " => failed" clean: defaultclean @rm -f ./codegen *.out diff --git a/testsuite/tests/backtrace/Makefile b/testsuite/tests/backtrace/Makefile index 960ce2f0f..1315aa4a7 100644 --- a/testsuite/tests/backtrace/Makefile +++ b/testsuite/tests/backtrace/Makefile @@ -18,8 +18,11 @@ run-all: $(OCAMLC) -g -o $(EXECNAME) $$file; \ for arg in a b c d ''; do \ printf " ... testing '$$file' (with argument '$$arg'):"; \ - (OCAMLRUNPARAM=b=1 $(EXECNAME) $$arg || true) > `basename $$file ml`$$arg.result 2>&1; \ - $(DIFF) `basename $$file ml`$$arg.reference `basename $$file ml`$$arg.result > /dev/null && echo " => passed" || (echo " => failed" && exit 1); \ + F="`basename $$file .ml`"; \ + (OCAMLRUNPARAM=b=1 $(EXECNAME) $$arg || true) \ + >$$F.$$arg.result 2>&1; \ + $(DIFF) $$F.$$arg.reference $$F.$$arg.result >/dev/null \ + && echo " => passed" || echo " => failed"; \ done; \ done diff --git a/testsuite/tests/callback/Makefile b/testsuite/tests/callback/Makefile index 01d328f91..6c884870b 100644 --- a/testsuite/tests/callback/Makefile +++ b/testsuite/tests/callback/Makefile @@ -26,18 +26,18 @@ run-byte: common @printf " ... testing 'bytecode':" @$(OCAMLC) -c tcallback.ml @$(OCAMLC) -o ./program -custom unix.cma callbackprim.$(O) tcallback.cmo - @./program > bytecode.result - @$(DIFF) reference bytecode.result || (echo " => failed" && exit 1) - @echo " => passed" + @./program >bytecode.result + @$(DIFF) reference bytecode.result \ + && echo " => passed" || echo " => failed" run-opt: common @if [ -z "$(BYTECODE_ONLY)" ]; then \ printf " ... testing 'native':"; \ $(OCAMLOPT) -c tcallback.ml; \ $(OCAMLOPT) -o ./program unix.cmxa callbackprim.$(O) tcallback.cmx; \ - ./program > native.result; \ - $(DIFF) reference native.result || (echo " => failed" && exit 1); \ - echo " => passed"; \ + ./program >native.result; \ + $(DIFF) reference native.result \ + && echo " => passed" || echo " => failed"; \ fi promote: defaultpromote diff --git a/testsuite/tests/embedded/Makefile b/testsuite/tests/embedded/Makefile index 2f4db641b..6abbe566d 100644 --- a/testsuite/tests/embedded/Makefile +++ b/testsuite/tests/embedded/Makefile @@ -23,8 +23,8 @@ compile: run: @printf " ... testing 'cmmain':" @./program > program.result - @$(DIFF) program.reference program.result > /dev/null || (echo " => failed" && exit 1) - @echo " => passed" + @$(DIFF) program.reference program.result >/dev/null \ + && echo " => passed" || echo " => failed" promote: defaultpromote diff --git a/testsuite/tests/lib-dynlink-bytecode/Makefile b/testsuite/tests/lib-dynlink-bytecode/Makefile index 9a938cc2a..defe92229 100644 --- a/testsuite/tests/lib-dynlink-bytecode/Makefile +++ b/testsuite/tests/lib-dynlink-bytecode/Makefile @@ -18,7 +18,8 @@ compile: @$(OCAMLC) -c registry.ml @for file in stub*.c; do \ $(OCAMLC) -c $$file; \ - $(OCAMLMKLIB) -o `echo $$file | sed -e 's/stub/plug/' | sed -e 's/\.c//'` `basename $$file c`o; \ + $(OCAMLMKLIB) -o `echo $$file | sed -e 's/stub/plug/' -e 's/\.c//'` \ + `basename $$file c`o; \ done @for file in plug*.ml; do \ $(OCAMLC) -c $$file; \ @@ -26,24 +27,26 @@ compile: done @$(OCAMLC) -c main.ml @$(OCAMLC) -o main dynlink.cma registry.cmo main.cmo - @$(OCAMLC) -o static -linkall registry.cmo plug1.cma plug2.cma -use-runtime $(PREFIX)/bin/ocamlrun - @$(OCAMLC) -o custom -custom -linkall registry.cmo plug2.cma plug1.cma -I . + @$(OCAMLC) -o static -linkall registry.cmo plug1.cma plug2.cma \ + -use-runtime $(PREFIX)/bin/ocamlrun + @$(OCAMLC) -o custom -custom -linkall registry.cmo plug2.cma plug1.cma \ + -I . run: @printf " ... testing 'main'" - @export LD_LIBRARY_PATH=`pwd` && ./main plug1.cma plug2.cma > main.result - @$(DIFF) main.reference main.result > /dev/null || (echo " => failed" && exit 1) - @echo " => passed" + @LD_LIBRARY_PATH="`pwd`" ./main plug1.cma plug2.cma >main.result + @$(DIFF) main.reference main.result >/dev/null \ + && echo " => passed" || echo " => failed" @printf " ... testing 'static'" - @export LD_LIBRARY_PATH=`pwd` && ./static > static.result - @$(DIFF) static.reference static.result > /dev/null || (echo " => failed" && exit 1) - @echo " => passed" + @LD_LIBRARY_PATH="`pwd`" ./static >static.result + @$(DIFF) static.reference static.result >/dev/null \ + && echo " => passed" || echo " => failed" @printf " ... testing 'custom'" - @export LD_LIBRARY_PATH=`pwd` && ./custom > custom.result - @$(DIFF) custom.reference custom.result > /dev/null || (echo " => failed" && exit 1) - @echo " => passed" + @LD_LIBRARY_PATH="`pwd`" ./custom > custom.result + @$(DIFF) custom.reference custom.result >/dev/null \ + && echo " => passed" || echo " => failed" promote: defaultpromote diff --git a/testsuite/tests/lib-dynlink-csharp/Makefile b/testsuite/tests/lib-dynlink-csharp/Makefile index 147b5ee55..afbb4cf86 100644 --- a/testsuite/tests/lib-dynlink-csharp/Makefile +++ b/testsuite/tests/lib-dynlink-csharp/Makefile @@ -32,7 +32,8 @@ bytecode: $(OCAMLC) -output-obj -o main.dll dynlink.cma main.ml entry.c; \ $(CSC) /out:main.exe main.cs; \ ./main.exe > bytecode.result; \ - $(DIFF) bytecode.reference bytecode.result > /dev/null && echo " => passed" || echo " => failed"; \ + $(DIFF) bytecode.reference bytecode.result >/dev/null \ + && echo " => passed" || echo " => failed"; \ fi bytecode-dll: @@ -41,10 +42,12 @@ bytecode-dll: echo " => passed"; \ else \ $(OCAMLC) -output-obj -o main_obj.$(O) dynlink.cma entry.c main.ml; \ - $(MKDLL) -maindll -o main.dll main_obj.$(O) entry.$(O) ../../byterun/libcamlrun.$(A) $(BYTECCLIBS) -v; \ + $(MKDLL) -maindll -o main.dll main_obj.$(O) entry.$(O) \ + ../../byterun/libcamlrun.$(A) $(BYTECCLIBS) -v; \ $(CSC) /out:main.exe main.cs; \ - ./main.exe > bytecode.result; \ - $(DIFF) bytecode.reference bytecode.result > /dev/null && echo " => passed" || echo " => failed"; \ + ./main.exe >bytecode.result; \ + $(DIFF) bytecode.reference bytecode.result >/dev/null \ + && echo " => passed" || echo " => failed"; \ fi native: @@ -55,7 +58,8 @@ native: $(OCAMLOPT) -output-obj -o main.dll dynlink.cmxa entry.c main.ml; \ $(CSC) /out:main.exe main.cs; \ ./main.exe > native.result; \ - $(DIFF) native.reference native.result > /dev/null && echo " => passed" || echo " => failed"; \ + $(DIFF) native.reference native.result > /dev/null \ + && echo " => passed" || echo " => failed"; \ fi native-dll: @@ -63,11 +67,14 @@ native-dll: @if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \ echo " => passed"; \ else \ - $(OCAMLOPT) -output-obj -o main_obj.$(O) dynlink.cmxa entry.c main.ml; \ - $(MKDLL) -maindll -o main.dll main_obj.$(O) entry.$(O) ../../asmrun/libasmrun.lib -v; \ + $(OCAMLOPT) -output-obj -o main_obj.$(O) dynlink.cmxa entry.c \ + main.ml; \ + $(MKDLL) -maindll -o main.dll main_obj.$(O) entry.$(O) \ + ../../asmrun/libasmrun.lib -v; \ $(CSC) /out:main.exe main.cs; \ ./main.exe > native.result; \ - $(DIFF) native.reference native.result > /dev/null && echo " => passed" || echo " => failed"; \ + $(DIFF) native.reference native.result >/dev/null \ + && echo " => passed" || echo " => failed"; \ fi promote: defaultpromote diff --git a/testsuite/tests/lib-dynlink-native/Makefile b/testsuite/tests/lib-dynlink-native/Makefile index 6f34f7726..95ef902aa 100644 --- a/testsuite/tests/lib-dynlink-native/Makefile +++ b/testsuite/tests/lib-dynlink-native/Makefile @@ -20,7 +20,10 @@ default: all: compile run -PLUGINS=plugin.so plugin2.so sub/plugin.so sub/plugin3.so plugin4.so mypack.so packed1.so packed1_client.so pack_client.so plugin_ref.so plugin_high_arity.so plugin_ext.so plugin_simple.so bug.so plugin_thread.so plugin4_unix.so a.so b.so c.so +PLUGINS=plugin.so plugin2.so sub/plugin.so sub/plugin3.so plugin4.so \ + mypack.so packed1.so packed1_client.so pack_client.so plugin_ref.so \ + plugin_high_arity.so plugin_ext.so plugin_simple.so bug.so \ + plugin_thread.so plugin4_unix.so a.so b.so c.so ADD_COMPFLAGS=-thread @@ -29,29 +32,36 @@ compile: $(PLUGINS) main$(EXE) mylib.so run: @printf " ... testing 'main'" @./main$(EXE) plugin.so plugin2.so plugin_thread.so > result - @$(DIFF) reference result > /dev/null || (echo " => failed" && exit 1) - @echo " => passed" + @$(DIFF) reference result >/dev/null \ + && echo " => passed" || echo " => failed" main$(EXE): api.cmx main.cmx - @$(OCAMLOPT) -thread -o main$(EXE) -linkall unix.cmxa threads.cmxa dynlink.cmxa api.cmx main.cmx $(PTHREAD_LINK) + @$(OCAMLOPT) -thread -o main$(EXE) -linkall unix.cmxa threads.cmxa \ + dynlink.cmxa api.cmx main.cmx $(PTHREAD_LINK) main_ext$(EXE): api.cmx main.cmx factorial.$(O) - @$(OCAMLOPT) -o main_ext$(EXE) dynlink.cmxa api.cmx main.cmx factorial.$(O) + @$(OCAMLOPT) -o main_ext$(EXE) dynlink.cmxa api.cmx main.cmx \ + factorial.$(O) sub/plugin3.cmx: sub/api.cmi sub/api.cmx sub/plugin3.ml - @(cd sub; mv api.cmx api.cmx.bak; $(OCAMLOPT) -c $(COMPFLAGS) plugin3.ml; mv api.cmx.bak api.cmx) + @cd sub; \ + mv api.cmx api.cmx.bak; \ + $(OCAMLOPT) -c $(COMPFLAGS) plugin3.ml; \ + mv api.cmx.bak api.cmx plugin2.cmx: api.cmx plugin.cmi plugin.cmx - @(mv plugin.cmx plugin.cmx.bak; $(OCAMLOPT) -c $(COMPFLAGS) plugin2.ml; mv plugin.cmx.bak plugin.cmx) + @mv plugin.cmx plugin.cmx.bak; + @$(OCAMLOPT) -c $(COMPFLAGS) plugin2.ml + @mv plugin.cmx.bak plugin.cmx sub/api.so: sub/api.cmi sub/api.ml - @(cd sub; $(OCAMLOPT) -c $(COMPFLAGS) $(SHARED) api.ml) + @cd sub; $(OCAMLOPT) -c $(COMPFLAGS) $(SHARED) api.ml sub/api.cmi: sub/api.mli - @(cd sub; $(OCAMLOPT) -c $(COMPFLAGS) api.mli) + @cd sub; $(OCAMLOPT) -c $(COMPFLAGS) api.mli sub/api.cmx: sub/api.cmi sub/api.ml - @(cd sub; $(OCAMLOPT) -c $(COMPFLAGS) api.ml) + @cd sub; $(OCAMLOPT) -c $(COMPFLAGS) api.ml plugin.cmx: api.cmx plugin.cmi sub/plugin.cmx: api.cmx @@ -61,7 +71,8 @@ plugin_ext.cmx: api.cmx plugin_ext.ml @$(OCAMLOPT) -c $(COMPFLAGS) plugin_ext.ml plugin_ext.so: factorial.$(O) plugin_ext.cmx - @$(OCAMLOPT) $(COMPFLAGS) -shared -o plugin_ext.so factorial.$(O) plugin_ext.cmx + @$(OCAMLOPT) $(COMPFLAGS) -shared -o plugin_ext.so factorial.$(O) \ + plugin_ext.cmx plugin4_unix.so: plugin4.cmx @$(OCAMLOPT) -shared -o plugin4_unix.so unix.cmxa plugin4.cmx diff --git a/testsuite/tests/lib-scanf-2/Makefile b/testsuite/tests/lib-scanf-2/Makefile index 2396da946..3fd52d7b9 100644 --- a/testsuite/tests/lib-scanf-2/Makefile +++ b/testsuite/tests/lib-scanf-2/Makefile @@ -25,14 +25,14 @@ compile: tscanf2_io.cmo run: @printf " ... testing with ocamlc" - @./master.byte "`$(CYGPATH) ./slave.byte`" > result.byte 2>&1 - @$(DIFF) reference result.byte > /dev/null || (echo " => failed" && exit 1) - @if [ -z "$(BYTECODE_ONLY)" ]; then \ - printf " ocamlopt" && \ - ./master.native "`$(CYGPATH) ./slave.native`" > result.native 2>&1 && \ - $(DIFF) reference result.native > /dev/null || (echo " => failed" && exit 1) \ - fi - @echo " => passed" + @./master.byte "`$(CYGPATH) ./slave.byte`" >result.byte 2>&1 + @$(DIFF) reference result.byte >/dev/null \ + && if [ -z "$(BYTECODE_ONLY)" ]; then \ + printf " ocamlopt"; \ + ./master.native "`$(CYGPATH) ./slave.native`" >result.native 2>&1;\ + $(DIFF) reference result.native >/dev/null; \ + fi \ + && echo " => passed" || echo " => failed" promote: @cp result.byte reference diff --git a/testsuite/tests/runtime-errors/Makefile b/testsuite/tests/runtime-errors/Makefile index ae3bbf90a..f443c4404 100644 --- a/testsuite/tests/runtime-errors/Makefile +++ b/testsuite/tests/runtime-errors/Makefile @@ -28,12 +28,14 @@ run: for f in *.bytecode; do \ printf " ... testing '$$f':"; \ (./$$f > $$f.result 2>&1 || true); \ - DIFF="$(DIFF)" sh $$f.checker && echo " => passed" || echo " => failed"; \ + DIFF="$(DIFF)" sh $$f.checker \ + && echo " => passed" || echo " => failed"; \ fn=`basename $$f bytecode`native; \ if [ -z "$(BYTECODE_ONLY)" -a -f "$$fn" ]; then \ printf " ... testing '$$fn':"; \ (./$$fn > $$fn.result 2>&1 || true); \ - DIFF="$(DIFF)" sh $$fn.checker && echo " => passed" || echo " => failed"; \ + DIFF="$(DIFF)" sh $$fn.checker \ + && echo " => passed" || echo " => failed"; \ fi; \ done diff --git a/testsuite/tests/tool-ocaml/Makefile b/testsuite/tests/tool-ocaml/Makefile index 47b40fd1c..e1d92c88c 100644 --- a/testsuite/tests/tool-ocaml/Makefile +++ b/testsuite/tests/tool-ocaml/Makefile @@ -17,9 +17,11 @@ compile: lib.cmo @for file in t*.ml; do \ printf " ... testing '$$file'"; \ if [ `echo $(SHOULD_FAIL) | grep $$file` ]; then \ - $(OCAML) -w a lib.cmo $$file 2> /dev/null && (echo " => failed" && exit 1) || echo " => passed"; \ + $(OCAML) -w a lib.cmo $$file 2>/dev/null \ + && echo " => failed" || echo " => passed"; \ else \ - $(OCAML) -w a lib.cmo $$file 2> /dev/null && echo " => passed" || (echo " => failed" && exit 1); \ + $(OCAML) -w a lib.cmo $$file 2>/dev/null \ + && echo " => passed" || echo " => failed"; \ fi; \ done diff --git a/testsuite/tests/tool-ocamldoc/Makefile b/testsuite/tests/tool-ocamldoc/Makefile index 3912496d0..ec97aa1e1 100644 --- a/testsuite/tests/tool-ocamldoc/Makefile +++ b/testsuite/tests/tool-ocamldoc/Makefile @@ -17,11 +17,16 @@ ADD_COMPFLAGS=-I +ocamldoc run: $(CUSTOM_MODULE).cmo @for file in t*.ml; do \ printf " ... testing '$$file'"; \ - $(OCAMLDOC) -hide-warnings -g $(CUSTOM_MODULE).cmo -o `basename $$file ml`result $$file; \ - tr -d '\r' < `basename $$file ml`result | $(DIFF) `basename $$file ml`reference - > /dev/null && echo " => passed" || (echo " => failed" && exit 1); \ + F="`basename $$file .ml`"; \ + $(OCAMLDOC) -hide-warnings -g $(CUSTOM_MODULE).cmo -o $$F.result \ + $$file; \ + $(DIFF) $$F.reference $$F.result >/dev/null \ + && echo " => passed" || echo " => failed"; \ done; - @$(OCAMLDOC) -hide-warnings -html t*.ml 2>&1 | grep -v test_types_display || true - @$(OCAMLDOC) -hide-warnings -latex t*.ml 2>&1 | grep -v test_types_display || true + @$(OCAMLDOC) -hide-warnings -html t*.ml 2>&1 \ + | grep -v test_types_display || true + @$(OCAMLDOC) -hide-warnings -latex t*.ml 2>&1 \ + | grep -v test_types_display || true promote: defaultpromote diff --git a/testsuite/tests/typing-polyvariants-bugs-2/Makefile b/testsuite/tests/typing-polyvariants-bugs-2/Makefile index 365da14ba..4cf35f3cc 100644 --- a/testsuite/tests/typing-polyvariants-bugs-2/Makefile +++ b/testsuite/tests/typing-polyvariants-bugs-2/Makefile @@ -13,7 +13,10 @@ BASEDIR=../.. default: @printf " ... testing 'pr3918':" - @($(OCAMLC) -c pr3918a.mli && $(OCAMLC) -c pr3918b.mli && $(OCAMLC) -c pr3918c.ml && echo " => passed") || echo " => failed" + @($(OCAMLC) -c pr3918a.mli \ + && $(OCAMLC) -c pr3918b.mli \ + && $(OCAMLC) -c pr3918c.ml \ + && echo " => passed") || echo " => failed" clean: defaultclean diff --git a/testsuite/tests/warnings/Makefile b/testsuite/tests/warnings/Makefile index 8ac1d525b..06f574f14 100644 --- a/testsuite/tests/warnings/Makefile +++ b/testsuite/tests/warnings/Makefile @@ -17,8 +17,10 @@ EXECNAME=./program run-all: @for file in *.ml; do \ printf " ... testing '$$file':"; \ - $(OCAMLC) $(FLAGS) -o $(EXECNAME) $$file 2> `basename $$file ml`result; \ - $(DIFF) `basename $$file ml`reference `basename $$file ml`result > /dev/null && echo " => passed" || echo " => failed"; \ + F="`basename $$file .ml`"; \ + $(OCAMLC) $(FLAGS) -o $(EXECNAME) $$file 2>$$F.result; \ + $(DIFF) $$F.reference $$F.result >/dev/null \ + && echo " => passed" || echo " => failed"; \ done; promote: defaultpromote |