1 ## Makefile.in for ICU tests
2 ## Copyright (c) 1999-2014, International Business Machines Corporation and
3 ## others. All Rights Reserved.
5 ## Source directory information
7 top_srcdir = @top_srcdir@
11 include $(top_builddir)/icudefs.mk
13 ## Build directory information
16 @ICUIO_TRUE@IOTEST = iotest
18 # the letest directory depends on layoutex.
19 # If you have layoutex but not layout, you will be using
21 @LAYOUTEX_TRUE@LETEST = letest
25 STATUS_FULL = $(shell pwd)/$(STATUS_TMP)
27 ## Files to remove for 'make clean'
28 CLEANFILES = *~ $(STATUS_TMP)
30 SUBDIRS = testdata intltest $(IOTEST) cintltst $(LETEST)
32 ## List of phony targets
33 .PHONY : everything all all-local all-recursive install install-local \
34 install-recursive clean clean-local clean-recursive distclean \
35 distclean-local distclean-recursive dist dist-recursive dist-local \
36 check check-recursive check-local xcheck xcheck-recursive xcheck-local \
37 check-exhaustive check-exhaustive-recursive
42 ## List of standard targets
43 everything: all-recursive all-local
45 ifneq ($(RECURSIVE),YES)
46 @echo simply use \`make\' \(or \`make everything\'\) to do all
49 install: install-recursive install-local
50 clean: clean-recursive clean-local
51 distclean : distclean-recursive distclean-local
52 $(RMV) hdrtst/Makefile
53 $(RMV) perf/convperf/Makefile
56 dist: dist-recursive dist-local
57 check: everything check-recursive check-local
58 check-recursive: all-recursive
59 # the xcheck targets create a ../test-*.xml file in JUnit format.
60 xcheck: everything xcheck-recursive xcheck-local
61 xcheck-recursive: all-recursive
62 check-exhaustive: everything check-exhaustive-recursive check-local
65 all-recursive install-recursive clean-recursive distclean-recursive dist-recursive:
67 target=`echo $@ | sed s/-recursive//`; \
68 list='$(SUBDIRS)'; for subdir in $$list; do \
69 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
70 if test "$$subdir" = "."; then \
72 local_target="$$target-local"; \
74 local_target="$$target"; \
76 (cd $$subdir && $(MAKE) $$local_target) || exit; \
78 if test "$$dot_seen" = "no"; then \
79 $(MAKE) "$$target-local" || exit; \
82 xcheck-recursive check-recursive check-exhaustive-recursive:
83 @$(MKINSTALLDIRS) $(STATUS_TMP)
84 @mystatus=$(STATUS_FULL)/status.$$$$.deleteme ; \
85 $(RMV) "$$mystatus".* ; \
88 target=`echo $@ | sed s/-recursive//`; \
89 list='$(SUBDIRS)'; for subdir in $$list; do \
90 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
91 local_target="$$target"; \
92 if (cd $$subdir && $(MAKE) $$local_target TEST_STATUS_FILE="$$mystatus.$$subdir" ); then \
93 goods="$$goods $$subdir"; \
95 bads="$$bads $$subdir"; \
98 for subdir in $$list; do \
99 if [ -f "$$mystatus.$$subdir" ]; then \
100 echo "-------------" ; \
101 echo "| *** FAILING TEST SUMMARY FOR: $$subdir " ; \
102 cat "$$mystatus.$$subdir" ; \
103 echo "| *** END FAILING TEST SUMMARY FOR: $$subdir" ; \
104 $(RMV) "$$mystatus.$$subdir" ; \
107 echo "---------------"; \
108 echo "ALL TESTS SUMMARY:"; \
109 if test ! "x$$bads" = "x"; then \
110 echo "ok: $$goods"; \
111 echo "===== ERRS: $$bads"; exit 1; \
113 echo "All tests OK: $$goods"; \
116 # pcheck = parallel check. We don't care about the output interleaving,
117 # just run it as fast as possible.
118 # todo would be to merge this code into the above non-parallel check.
119 STATUS_NUM:=$(shell echo $$$$)
120 MYSTATUS_R=$(STATUS_FULL)/status.$(STATUS_NUM).deleteme
121 STATUS_FILES=$(SUBDIRS:%=$(MYSTATUS_R).%)
123 pcheck_setup: testdata
124 @$(MKINSTALLDIRS) $(STATUS_TMP)
125 $(RMV) "$(MYSTATUS_R)".*
126 @echo Beginning parallel make. Output may be interleaved!
128 $(STATUS_FULL)/status.$(STATUS_NUM).deleteme.%: pcheck_setup
129 -@$(MAKE) -C $* TEST_STATUS_FILE=$@ check || ( echo "FAILED: $* (other tests may still be running..)" ; touch $@ ; cp $@ $@.FAIL ; false )
130 -@[ ! -f $@.FAIL ] && touch $@.PASS && echo "PASSED: $* (other tests may still be running..)"
134 pcheck: $(STATUS_FILES)
137 echo "----------------------------------------"; \
138 for subdir in $(SUBDIRS); do \
139 if [ -s "$(MYSTATUS_R).$$subdir" ]; then \
140 echo "-------------" ; \
141 echo "| *** FAILING TEST SUMMARY FOR: $$subdir " ; \
142 cat "$(MYSTATUS_R).$$subdir" ; \
143 echo "| *** END FAILING TEST SUMMARY FOR: $$subdir" ; \
144 $(RMV) "$(MYSTATUS_R).$$subdir" ; \
147 for subdir in $(SUBDIRS); do \
148 if [ -f "$(MYSTATUS_R).$$subdir.FAIL" ]; \
150 bads="$$bads $$subdir" ; \
151 elif [ -f "$(MYSTATUS_R).$$subdir.PASS" ]; \
153 goods="$$goods $$subdir" ; \
155 echo "*** subtest did not complete - $$subdir" ; \
156 bads="$$bads $$subdir" ; \
159 echo "ALL TESTS SUMMARY:"; \
160 if test ! "x$$bads" = "x"; then \
161 echo "(to get non-interleaved err output, use \"$(MAKE) check\" instead.)" ; \
162 echo "ok: $$goods"; \
163 echo "===== ERRS: $$bads"; exit 1; \
165 echo "All tests OK: $$goods"; \
167 -@$(RMV) "$(MYSTATUS_R)".*
176 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
178 distclean-local: clean-local
181 xcheck-local check-local: all-local
183 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
185 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status