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
25 # no testdata without tools..
26 @TOOLS_TRUE@TESTDATA = testdata
30 STATUS_FULL = $(shell pwd)/$(STATUS_TMP)
32 ## Files to remove for 'make clean'
33 CLEANFILES = *~ $(STATUS_TMP)
35 SUBDIRS = $(TESTDATA) intltest $(IOTEST) cintltst $(LETEST)
37 ## List of phony targets
38 .PHONY : everything all all-local all-recursive install install-local \
39 install-recursive clean clean-local clean-recursive distclean \
40 distclean-local distclean-recursive dist dist-recursive dist-local \
41 check check-recursive check-local xcheck xcheck-recursive xcheck-local \
42 check-exhaustive check-exhaustive-recursive
47 ## List of standard targets
48 everything: all-recursive all-local
50 ifneq ($(RECURSIVE),YES)
51 @echo simply use \`make\' \(or \`make everything\'\) to do all
54 install: install-recursive install-local
55 clean: clean-recursive clean-local
56 distclean : distclean-recursive distclean-local
57 $(RMV) hdrtst/Makefile
58 $(RMV) perf/convperf/Makefile
61 dist: dist-recursive dist-local
62 check: everything check-recursive check-local
63 check-recursive: all-recursive
64 # the xcheck targets create a ../test-*.xml file in JUnit format.
65 xcheck: everything xcheck-recursive xcheck-local
66 xcheck-recursive: all-recursive
67 check-exhaustive: everything check-exhaustive-recursive check-local
70 all-recursive install-recursive clean-recursive distclean-recursive dist-recursive:
72 target=`echo $@ | sed s/-recursive//`; \
73 list='$(SUBDIRS)'; for subdir in $$list; do \
74 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
75 if test "$$subdir" = "."; then \
77 local_target="$$target-local"; \
79 local_target="$$target"; \
81 (cd $$subdir && $(MAKE) $$local_target) || exit; \
83 if test "$$dot_seen" = "no"; then \
84 $(MAKE) "$$target-local" || exit; \
87 xcheck-recursive check-recursive check-exhaustive-recursive:
88 @$(MKINSTALLDIRS) $(STATUS_TMP)
89 @mystatus=$(STATUS_FULL)/status.$$$$.deleteme ; \
90 $(RMV) "$$mystatus".* ; \
93 target=`echo $@ | sed s/-recursive//`; \
94 list='$(SUBDIRS)'; for subdir in $$list; do \
95 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
96 local_target="$$target"; \
97 if (cd $$subdir && $(MAKE) $$local_target TEST_STATUS_FILE="$$mystatus.$$subdir" ); then \
98 goods="$$goods $$subdir"; \
100 bads="$$bads $$subdir"; \
103 for subdir in $$list; do \
104 if [ -f "$$mystatus.$$subdir" ]; then \
105 echo "-------------" ; \
106 echo "| *** FAILING TEST SUMMARY FOR: $$subdir " ; \
107 cat "$$mystatus.$$subdir" ; \
108 echo "| *** END FAILING TEST SUMMARY FOR: $$subdir" ; \
109 $(RMV) "$$mystatus.$$subdir" ; \
112 echo "---------------"; \
113 echo "ALL TESTS SUMMARY:"; \
114 if test ! "x$$bads" = "x"; then \
115 echo "ok: $$goods"; \
116 echo "===== ERRS: $$bads"; exit 1; \
118 echo "All tests OK: $$goods"; \
121 # pcheck = parallel check. We don't care about the output interleaving,
122 # just run it as fast as possible.
123 # todo would be to merge this code into the above non-parallel check.
124 STATUS_NUM:=$(shell echo $$$$)
125 MYSTATUS_R=$(STATUS_FULL)/status.$(STATUS_NUM).deleteme
126 STATUS_FILES=$(SUBDIRS:%=$(MYSTATUS_R).%)
128 pcheck_setup: testdata
129 @$(MKINSTALLDIRS) $(STATUS_TMP)
130 $(RMV) "$(MYSTATUS_R)".*
131 @echo Beginning parallel make. Output may be interleaved!
133 $(STATUS_FULL)/status.$(STATUS_NUM).deleteme.%: pcheck_setup
134 -@$(MAKE) -C $* TEST_STATUS_FILE=$@ check || ( echo "FAILED: $* (other tests may still be running..)" ; touch $@ ; cp $@ $@.FAIL ; false )
135 -@[ ! -f $@.FAIL ] && touch $@.PASS && echo "PASSED: $* (other tests may still be running..)"
139 pcheck: $(STATUS_FILES)
142 echo "----------------------------------------"; \
143 for subdir in $(SUBDIRS); do \
144 if [ -s "$(MYSTATUS_R).$$subdir" ]; then \
145 echo "-------------" ; \
146 echo "| *** FAILING TEST SUMMARY FOR: $$subdir " ; \
147 cat "$(MYSTATUS_R).$$subdir" ; \
148 echo "| *** END FAILING TEST SUMMARY FOR: $$subdir" ; \
149 $(RMV) "$(MYSTATUS_R).$$subdir" ; \
152 for subdir in $(SUBDIRS); do \
153 if [ -f "$(MYSTATUS_R).$$subdir.FAIL" ]; \
155 bads="$$bads $$subdir" ; \
156 elif [ -f "$(MYSTATUS_R).$$subdir.PASS" ]; \
158 goods="$$goods $$subdir" ; \
160 echo "*** subtest did not complete - $$subdir" ; \
161 bads="$$bads $$subdir" ; \
164 echo "ALL TESTS SUMMARY:"; \
165 if test ! "x$$bads" = "x"; then \
166 echo "(to get non-interleaved err output, use \"$(MAKE) check\" instead.)" ; \
167 echo "ok: $$goods"; \
168 echo "===== ERRS: $$bads"; exit 1; \
170 echo "All tests OK: $$goods"; \
172 -@$(RMV) "$(MYSTATUS_R)".*
181 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
183 distclean-local: clean-local
186 xcheck-local check-local: all-local
188 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
190 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status