]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | ## Makefile.in for ICU tests |
f3c0d7a5 A |
2 | ## Copyright (C) 2016 and later: Unicode, Inc. and others. |
3 | ## License & terms of use: http://www.unicode.org/copyright.html | |
57a6839d | 4 | ## Copyright (c) 1999-2014, International Business Machines Corporation and |
b75a7d8f A |
5 | ## others. All Rights Reserved. |
6 | ||
7 | ## Source directory information | |
8 | srcdir = @srcdir@ | |
9 | top_srcdir = @top_srcdir@ | |
10 | ||
11 | top_builddir = .. | |
12 | ||
13 | include $(top_builddir)/icudefs.mk | |
14 | ||
b75a7d8f A |
15 | ## Build directory information |
16 | subdir = test | |
17 | ||
340931cb A |
18 | @FUZZER_TRUE@FUZZER=fuzzer |
19 | ||
374ca955 | 20 | @ICUIO_TRUE@IOTEST = iotest |
b331163b A |
21 | |
22 | # the letest directory depends on layoutex. | |
23 | # If you have layoutex but not layout, you will be using | |
24 | # harfbuzz. | |
25 | @LAYOUTEX_TRUE@LETEST = letest | |
57a6839d | 26 | |
0f5d89e8 A |
27 | # no testdata without tools.. |
28 | @TOOLS_TRUE@TESTDATA = testdata | |
29 | ||
57a6839d A |
30 | # status dir |
31 | STATUS_TMP = tmp | |
32 | STATUS_FULL = $(shell pwd)/$(STATUS_TMP) | |
374ca955 | 33 | |
b75a7d8f | 34 | ## Files to remove for 'make clean' |
57a6839d | 35 | CLEANFILES = *~ $(STATUS_TMP) |
b75a7d8f | 36 | |
340931cb | 37 | SUBDIRS = $(TESTDATA) intltest $(IOTEST) cintltst $(LETEST) $(FUZZER) |
b75a7d8f A |
38 | |
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 \ | |
4388f060 A |
43 | check check-recursive check-local xcheck xcheck-recursive xcheck-local \ |
44 | check-exhaustive check-exhaustive-recursive | |
b75a7d8f A |
45 | |
46 | ## Clear suffix list | |
47 | .SUFFIXES : | |
48 | ||
49 | ## List of standard targets | |
50 | everything: all-recursive all-local | |
51 | all: | |
52 | ifneq ($(RECURSIVE),YES) | |
53 | @echo simply use \`make\' \(or \`make everything\'\) to do all | |
54 | endif | |
55 | ||
56 | install: install-recursive install-local | |
57 | clean: clean-recursive clean-local | |
58 | distclean : distclean-recursive distclean-local | |
374ca955 | 59 | $(RMV) hdrtst/Makefile |
46f4442e | 60 | $(RMV) perf/convperf/Makefile |
57a6839d | 61 | $(RMV) $(STATUS_TMP) |
374ca955 | 62 | |
b75a7d8f A |
63 | dist: dist-recursive dist-local |
64 | check: everything check-recursive check-local | |
374ca955 | 65 | check-recursive: all-recursive |
729e4ab9 A |
66 | # the xcheck targets create a ../test-*.xml file in JUnit format. |
67 | xcheck: everything xcheck-recursive xcheck-local | |
68 | xcheck-recursive: all-recursive | |
4388f060 | 69 | check-exhaustive: everything check-exhaustive-recursive check-local |
b75a7d8f A |
70 | |
71 | ## Recursive targets | |
46f4442e | 72 | all-recursive install-recursive clean-recursive distclean-recursive dist-recursive: |
b75a7d8f A |
73 | @dot_seen=no; \ |
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 \ | |
78 | dot_seen=yes; \ | |
79 | local_target="$$target-local"; \ | |
80 | else \ | |
81 | local_target="$$target"; \ | |
82 | fi; \ | |
83 | (cd $$subdir && $(MAKE) $$local_target) || exit; \ | |
84 | done; \ | |
85 | if test "$$dot_seen" = "no"; then \ | |
86 | $(MAKE) "$$target-local" || exit; \ | |
87 | fi | |
88 | ||
4388f060 | 89 | xcheck-recursive check-recursive check-exhaustive-recursive: |
57a6839d A |
90 | @$(MKINSTALLDIRS) $(STATUS_TMP) |
91 | @mystatus=$(STATUS_FULL)/status.$$$$.deleteme ; \ | |
92 | $(RMV) "$$mystatus".* ; \ | |
3d1f044b | 93 | goods=; \ |
46f4442e A |
94 | bads=; \ |
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"; \ | |
57a6839d | 99 | if (cd $$subdir && $(MAKE) $$local_target TEST_STATUS_FILE="$$mystatus.$$subdir" ); then \ |
46f4442e A |
100 | goods="$$goods $$subdir"; \ |
101 | else \ | |
102 | bads="$$bads $$subdir"; \ | |
103 | fi; \ | |
104 | done; \ | |
57a6839d A |
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" ; \ | |
112 | fi; \ | |
113 | done; \ | |
46f4442e A |
114 | echo "---------------"; \ |
115 | echo "ALL TESTS SUMMARY:"; \ | |
116 | if test ! "x$$bads" = "x"; then \ | |
117 | echo "ok: $$goods"; \ | |
118 | echo "===== ERRS: $$bads"; exit 1; \ | |
119 | else \ | |
120 | echo "All tests OK: $$goods"; \ | |
121 | fi | |
122 | ||
57a6839d A |
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).%) | |
129 | ||
130 | pcheck_setup: testdata | |
131 | @$(MKINSTALLDIRS) $(STATUS_TMP) | |
132 | $(RMV) "$(MYSTATUS_R)".* | |
133 | @echo Beginning parallel make. Output may be interleaved! | |
134 | ||
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..)" | |
138 | -@touch $@ | |
139 | ||
140 | # print out status | |
141 | pcheck: $(STATUS_FILES) | |
3d1f044b A |
142 | @goods=; \ |
143 | bads=; \ | |
57a6839d | 144 | echo "----------------------------------------"; \ |
340931cb A |
145 | echo $SUBDIRS \ |
146 | echo "----------------------------------------"; \ | |
57a6839d A |
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" ; \ | |
154 | fi; \ | |
155 | done; \ | |
156 | for subdir in $(SUBDIRS); do \ | |
157 | if [ -f "$(MYSTATUS_R).$$subdir.FAIL" ]; \ | |
158 | then \ | |
159 | bads="$$bads $$subdir" ; \ | |
160 | elif [ -f "$(MYSTATUS_R).$$subdir.PASS" ]; \ | |
161 | then \ | |
162 | goods="$$goods $$subdir" ; \ | |
163 | else \ | |
164 | echo "*** subtest did not complete - $$subdir" ; \ | |
165 | bads="$$bads $$subdir" ; \ | |
166 | fi ; \ | |
167 | done ; \ | |
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; \ | |
173 | else \ | |
174 | echo "All tests OK: $$goods"; \ | |
175 | fi | |
176 | -@$(RMV) "$(MYSTATUS_R)".* | |
177 | ||
b75a7d8f A |
178 | all-local: |
179 | ||
180 | install-local: | |
181 | ||
182 | dist-local: | |
183 | ||
184 | clean-local: | |
185 | test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) | |
186 | ||
187 | distclean-local: clean-local | |
188 | $(RMV) Makefile | |
189 | ||
729e4ab9 | 190 | xcheck-local check-local: all-local |
b75a7d8f A |
191 | |
192 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | |
193 | cd $(top_builddir) \ | |
194 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
195 |