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 @FUZZER_TRUE@FUZZER=fuzzer
20 @ICUIO_TRUE@IOTEST = iotest
22 # the letest directory depends on layoutex.
23 # If you have layoutex but not layout, you will be using
25 @LAYOUTEX_TRUE@LETEST = letest
27 # no testdata without tools..
28 @TOOLS_TRUE@TESTDATA = testdata
32 STATUS_FULL = $(shell pwd)/$(STATUS_TMP)
34 ## Files to remove for 'make clean'
35 CLEANFILES = *~ $(STATUS_TMP)
37 SUBDIRS = $(TESTDATA) intltest $(IOTEST) cintltst $(LETEST) $(FUZZER)
39 ## List of phony targets
40 .PHONY : everything all all-local all-recursive install install-local \
41 install-recursive clean clean-local clean-recursive distclean \
42 distclean-local distclean-recursive dist dist-recursive dist-local \
43 check check-recursive check-local xcheck xcheck-recursive xcheck-local \
44 check-exhaustive check-exhaustive-recursive
49 ## List of standard targets
50 everything: all-recursive all-local
52 ifneq ($(RECURSIVE),YES)
53 @echo simply use \`make\' \(or \`make everything\'\) to do all
56 install: install-recursive install-local
57 clean: clean-recursive clean-local
58 distclean : distclean-recursive distclean-local
59 $(RMV) hdrtst/Makefile
60 $(RMV) perf/convperf/Makefile
63 dist: dist-recursive dist-local
64 check: everything check-recursive check-local
65 check-recursive: all-recursive
66 # the xcheck targets create a ../test-*.xml file in JUnit format.
67 xcheck: everything xcheck-recursive xcheck-local
68 xcheck-recursive: all-recursive
69 check-exhaustive: everything check-exhaustive-recursive check-local
72 all-recursive install-recursive clean-recursive distclean-recursive dist-recursive:
74 target=`echo $@ | sed s/-recursive//`; \
75 list='$(SUBDIRS)'; for subdir in $$list; do \
76 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
77 if test "$$subdir" = "."; then \
79 local_target="$$target-local"; \
81 local_target="$$target"; \
83 (cd $$subdir && $(MAKE) $$local_target) || exit; \
85 if test "$$dot_seen" = "no"; then \
86 $(MAKE) "$$target-local" || exit; \
89 xcheck-recursive check-recursive check-exhaustive-recursive:
90 @$(MKINSTALLDIRS) $(STATUS_TMP)
91 @mystatus=$(STATUS_FULL)/status.$$$$.deleteme ; \
92 $(RMV) "$$mystatus".* ; \
95 target=`echo $@ | sed s/-recursive//`; \
96 list='$(SUBDIRS)'; for subdir in $$list; do \
97 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
98 local_target="$$target"; \
99 if (cd $$subdir && $(MAKE) $$local_target TEST_STATUS_FILE="$$mystatus.$$subdir" ); then \
100 goods="$$goods $$subdir"; \
102 bads="$$bads $$subdir"; \
105 for subdir in $$list; do \
106 if [ -f "$$mystatus.$$subdir" ]; then \
107 echo "-------------" ; \
108 echo "| *** FAILING TEST SUMMARY FOR: $$subdir " ; \
109 cat "$$mystatus.$$subdir" ; \
110 echo "| *** END FAILING TEST SUMMARY FOR: $$subdir" ; \
111 $(RMV) "$$mystatus.$$subdir" ; \
114 echo "---------------"; \
115 echo "ALL TESTS SUMMARY:"; \
116 if test ! "x$$bads" = "x"; then \
117 echo "ok: $$goods"; \
118 echo "===== ERRS: $$bads"; exit 1; \
120 echo "All tests OK: $$goods"; \
123 # pcheck = parallel check. We don't care about the output interleaving,
124 # just run it as fast as possible.
125 # todo would be to merge this code into the above non-parallel check.
126 STATUS_NUM:=$(shell echo $$$$)
127 MYSTATUS_R=$(STATUS_FULL)/status.$(STATUS_NUM).deleteme
128 STATUS_FILES=$(SUBDIRS:%=$(MYSTATUS_R).%)
130 pcheck_setup: testdata
131 @$(MKINSTALLDIRS) $(STATUS_TMP)
132 $(RMV) "$(MYSTATUS_R)".*
133 @echo Beginning parallel make. Output may be interleaved!
135 $(STATUS_FULL)/status.$(STATUS_NUM).deleteme.%: pcheck_setup
136 -@$(MAKE) -C $* TEST_STATUS_FILE=$@ check || ( echo "FAILED: $* (other tests may still be running..)" ; touch $@ ; cp $@ $@.FAIL ; false )
137 -@[ ! -f $@.FAIL ] && touch $@.PASS && echo "PASSED: $* (other tests may still be running..)"
141 pcheck: $(STATUS_FILES)
144 echo "----------------------------------------"; \
146 echo "----------------------------------------"; \
147 for subdir in $(SUBDIRS); do \
148 if [ -s "$(MYSTATUS_R).$$subdir" ]; then \
149 echo "-------------" ; \
150 echo "| *** FAILING TEST SUMMARY FOR: $$subdir " ; \
151 cat "$(MYSTATUS_R).$$subdir" ; \
152 echo "| *** END FAILING TEST SUMMARY FOR: $$subdir" ; \
153 $(RMV) "$(MYSTATUS_R).$$subdir" ; \
156 for subdir in $(SUBDIRS); do \
157 if [ -f "$(MYSTATUS_R).$$subdir.FAIL" ]; \
159 bads="$$bads $$subdir" ; \
160 elif [ -f "$(MYSTATUS_R).$$subdir.PASS" ]; \
162 goods="$$goods $$subdir" ; \
164 echo "*** subtest did not complete - $$subdir" ; \
165 bads="$$bads $$subdir" ; \
168 echo "ALL TESTS SUMMARY:"; \
169 if test ! "x$$bads" = "x"; then \
170 echo "(to get non-interleaved err output, use \"$(MAKE) check\" instead.)" ; \
171 echo "ok: $$goods"; \
172 echo "===== ERRS: $$bads"; exit 1; \
174 echo "All tests OK: $$goods"; \
176 -@$(RMV) "$(MYSTATUS_R)".*
185 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
187 distclean-local: clean-local
190 xcheck-local check-local: all-local
192 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
194 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status