summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Clerc <xavier.clerc@inria.fr>2011-06-15 08:13:13 +0000
committerXavier Clerc <xavier.clerc@inria.fr>2011-06-15 08:13:13 +0000
commit3f334eb1762fc8dfcd1bb44ddf7fbbfa9cade58a (patch)
tree992bd94e7cf85e39bb2fefbee2adc3d9a6eac53e
parentd9b3046c493a3549f2d9220f4e4430409d20e145 (diff)
testsuite: ability to organize tests in subdirectories.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11089 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--testsuite/Makefile27
-rw-r--r--testsuite/makefiles/Makefile.several8
2 files changed, 18 insertions, 17 deletions
diff --git a/testsuite/Makefile b/testsuite/Makefile
index d7a975699..db1be0faa 100644
--- a/testsuite/Makefile
+++ b/testsuite/Makefile
@@ -32,23 +32,24 @@ one: lib
@$(MAKE) $(NO_PRINT) exec-one DIR=$(DIR)
exec-one:
- @echo "Running tests from '$$DIR' ..."
- @(cd $(DIR) && $(MAKE) TERM=dumb BASEDIR=$(BASEDIR) && cd ../..)
+ @if [ ! -f $(DIR)/Makefile ]; then \
+ for dir in $(DIR)/*; do \
+ if [ -d $$dir ]; then \
+ $(MAKE) exec-one DIR=$$dir; \
+ fi; \
+ done; \
+ else \
+ echo "Running tests from '$$DIR' ..."; \
+ (cd $(DIR) && $(MAKE) TERM=dumb BASEDIR=$(BASEDIR)); \
+ fi
lib: FORCE
- @(cd lib && $(MAKE) -s BASEDIR=$(BASEDIR) && cd ..)
+ @(cd lib && $(MAKE) -s BASEDIR=$(BASEDIR))
clean: FORCE
- @(cd lib && $(MAKE) BASEDIR=$(BASEDIR) clean && cd ..)
- @for file in tests/*; do \
- if [ -d $$file ]; then \
- (cd $$file && $(MAKE) BASEDIR=$(BASEDIR) clean && cd ../..); \
- fi \
- done
- @for file in interactive/*; do \
- if [ -d $$file ]; then \
- (cd $$file && $(MAKE) BASEDIR=$(BASEDIR) clean && cd ../..); \
- fi \
+ @(cd lib && $(MAKE) BASEDIR=$(BASEDIR) clean)
+ @for file in `find interactive tests -name Makefile`; do \
+ (cd `dirname $$file` && $(MAKE) BASEDIR=$(BASEDIR) clean); \
done
report: FORCE
diff --git a/testsuite/makefiles/Makefile.several b/testsuite/makefiles/Makefile.several
index 099251321..e81462da4 100644
--- a/testsuite/makefiles/Makefile.several
+++ b/testsuite/makefiles/Makefile.several
@@ -26,11 +26,11 @@ run-all:
done;
@for file in *.ml; do \
printf " ... testing '$$file':"; \
- $(MAKE) run-file DESC=ocamlc COMP='$(OCAMLC)' COMPFLAGS='$(ADD_COMPFLAGS) $(ADD_CFLAGS) $(O_FILES) -w a $(CMA_FILES) -I ../../lib $(CMO_FILES)' FILE=$$file PROGRAM_ARGS=$(PROGRAM_ARGS) && \
- $(MAKE) run-file DESC=ocamlopt COMP=$(PREFIX)/bin/ocamlopt COMPFLAGS='$(ADD_COMPFLAGS) $(ADD_OPTFLAGS) $(O_FILES) -w a $(CMXA_FILES) -I ../../lib $(CMX_FILES)' FILE=$$file PROGRAM_ARGS=$(PROGRAM_ARGS) && \
+ $(MAKE) run-file DESC=ocamlc COMP='$(OCAMLC)' COMPFLAGS='$(ADD_COMPFLAGS) $(ADD_CFLAGS) $(O_FILES) -w a $(CMA_FILES) -I $(BASEDIR)/lib $(CMO_FILES)' FILE=$$file PROGRAM_ARGS=$(PROGRAM_ARGS) && \
+ $(MAKE) run-file DESC=ocamlopt COMP=$(PREFIX)/bin/ocamlopt COMPFLAGS='$(ADD_COMPFLAGS) $(ADD_OPTFLAGS) $(O_FILES) -w a $(CMXA_FILES) -I $(BASEDIR)/lib $(CMX_FILES)' FILE=$$file PROGRAM_ARGS=$(PROGRAM_ARGS) && \
if [ ! -z $(UNSAFE) ]; then \
- $(MAKE) run-file DESC=ocamlc-unsafe COMP=$(PREFIX)/bin/ocamlc COMPFLAGS='-w a -unsafe -I ../../li $(CMO_FILES)' FILE=$$file && \
- $(MAKE) run-file DESC=ocamlopt-unsafe COMP=$(PREFIX)/bin/ocamlopt COMPFLAGS='-w a -unsafe -I ../../lib $(CMX_FILES)' FILE=$$file; \
+ $(MAKE) run-file DESC=ocamlc-unsafe COMP=$(PREFIX)/bin/ocamlc COMPFLAGS='-w a -unsafe -I $(BASEDIR)/lib $(CMO_FILES)' FILE=$$file && \
+ $(MAKE) run-file DESC=ocamlopt-unsafe COMP=$(PREFIX)/bin/ocamlopt COMPFLAGS='-w a -unsafe -I $(BASEDIR)/lib $(CMX_FILES)' FILE=$$file; \
fi && \
echo " => passed"; \
done;