1 ## Makefile.in for ICU tests
2 ## Copyright (C) 2016 and later: Unicode, Inc. and others.
3 ## License & terms of use: http://www.unicode.org/copyright.html
4 ## Copyright (c) 1999-2014, International Business Machines Corporation and
5 ## others. All Rights Reserved.
7 ## Source directory information
9 top_srcdir = @top_srcdir@
13 include $(top_builddir)/icudefs.mk
15 ## Build directory information
18 @ICUIO_TRUE@IOTEST = iotest
20 # the letest directory depends on layoutex.
21 # If you have layoutex but not layout, you will be using
23 @LAYOUTEX_TRUE@LETEST = letest
27 STATUS_FULL = $(shell pwd)/$(STATUS_TMP)
29 ## Files to remove for 'make clean'
30 CLEANFILES = *~ $(STATUS_TMP)
32 SUBDIRS = testdata intltest $(IOTEST) cintltst $(LETEST)
34 ## List of phony targets
35 .PHONY : everything all all-local all-recursive install install-local \
36 install-recursive clean clean-local clean-recursive distclean \
37 distclean-local distclean-recursive dist dist-recursive dist-local \
38 check check-recursive check-local xcheck xcheck-recursive xcheck-local \
39 check-exhaustive check-exhaustive-recursive
44 ## List of standard targets
45 everything: all-recursive all-local
47 ifneq ($(RECURSIVE),YES)
48 @echo simply use \`make\' \(or \`make everything\'\) to do all
51 install: install-recursive install-local
52 clean: clean-recursive clean-local
53 distclean : distclean-recursive distclean-local
54 $(RMV) hdrtst/Makefile
55 $(RMV) perf/convperf/Makefile
58 dist: dist-recursive dist-local
59 check: everything check-recursive check-local
60 check-recursive: all-recursive
61 # the xcheck targets create a ../test-*.xml file in JUnit format.
62 xcheck: everything xcheck-recursive xcheck-local
63 xcheck-recursive: all-recursive
64 check-exhaustive: everything check-exhaustive-recursive check-local
67 all-recursive install-recursive clean-recursive distclean-recursive dist-recursive:
69 target=`echo $@ | sed s/-recursive//`; \
70 list='$(SUBDIRS)'; for subdir in $$list; do \
71 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
72 if test "$$subdir" = "."; then \
74 local_target="$$target-local"; \
76 local_target="$$target"; \
78 (cd $$subdir && $(MAKE) $$local_target) || exit; \
80 if test "$$dot_seen" = "no"; then \
81 $(MAKE) "$$target-local" || exit; \
84 xcheck-recursive check-recursive check-exhaustive-recursive:
85 @$(MKINSTALLDIRS) $(STATUS_TMP)
86 @mystatus=$(STATUS_FULL)/status.$$$$.deleteme ; \
87 $(RMV) "$$mystatus".* ; \
90 target=`echo $@ | sed s/-recursive//`; \
91 list='$(SUBDIRS)'; for subdir in $$list; do \
92 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
93 local_target="$$target"; \
94 if (cd $$subdir && $(MAKE) $$local_target TEST_STATUS_FILE="$$mystatus.$$subdir" ); then \
95 goods="$$goods $$subdir"; \
97 bads="$$bads $$subdir"; \
100 for subdir in $$list; do \
101 if [ -f "$$mystatus.$$subdir" ]; then \
102 echo "-------------" ; \
103 echo "| *** FAILING TEST SUMMARY FOR: $$subdir " ; \
104 cat "$$mystatus.$$subdir" ; \
105 echo "| *** END FAILING TEST SUMMARY FOR: $$subdir" ; \
106 $(RMV) "$$mystatus.$$subdir" ; \
109 echo "---------------"; \
110 echo "ALL TESTS SUMMARY:"; \
111 if test ! "x$$bads" = "x"; then \
112 echo "ok: $$goods"; \
113 echo "===== ERRS: $$bads"; exit 1; \
115 echo "All tests OK: $$goods"; \
118 # pcheck = parallel check. We don't care about the output interleaving,
119 # just run it as fast as possible.
120 # todo would be to merge this code into the above non-parallel check.
121 STATUS_NUM:=$(shell echo $$$$)
122 MYSTATUS_R=$(STATUS_FULL)/status.$(STATUS_NUM).deleteme
123 STATUS_FILES=$(SUBDIRS:%=$(MYSTATUS_R).%)
125 pcheck_setup: testdata
126 @$(MKINSTALLDIRS) $(STATUS_TMP)
127 $(RMV) "$(MYSTATUS_R)".*
128 @echo Beginning parallel make. Output may be interleaved!
130 $(STATUS_FULL)/status.$(STATUS_NUM).deleteme.%: pcheck_setup
131 -@$(MAKE) -C $* TEST_STATUS_FILE=$@ check || ( echo "FAILED: $* (other tests may still be running..)" ; touch $@ ; cp $@ $@.FAIL ; false )
132 -@[ ! -f $@.FAIL ] && touch $@.PASS && echo "PASSED: $* (other tests may still be running..)"
136 pcheck: $(STATUS_FILES)
139 echo "----------------------------------------"; \
140 for subdir in $(SUBDIRS); do \
141 if [ -s "$(MYSTATUS_R).$$subdir" ]; then \
142 echo "-------------" ; \
143 echo "| *** FAILING TEST SUMMARY FOR: $$subdir " ; \
144 cat "$(MYSTATUS_R).$$subdir" ; \
145 echo "| *** END FAILING TEST SUMMARY FOR: $$subdir" ; \
146 $(RMV) "$(MYSTATUS_R).$$subdir" ; \
149 for subdir in $(SUBDIRS); do \
150 if [ -f "$(MYSTATUS_R).$$subdir.FAIL" ]; \
152 bads="$$bads $$subdir" ; \
153 elif [ -f "$(MYSTATUS_R).$$subdir.PASS" ]; \
155 goods="$$goods $$subdir" ; \
157 echo "*** subtest did not complete - $$subdir" ; \
158 bads="$$bads $$subdir" ; \
161 echo "ALL TESTS SUMMARY:"; \
162 if test ! "x$$bads" = "x"; then \
163 echo "(to get non-interleaved err output, use \"$(MAKE) check\" instead.)" ; \
164 echo "ok: $$goods"; \
165 echo "===== ERRS: $$bads"; exit 1; \
167 echo "All tests OK: $$goods"; \
169 -@$(RMV) "$(MYSTATUS_R)".*
178 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
180 distclean-local: clean-local
183 xcheck-local check-local: all-local
185 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
187 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status