]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | ## Makefile.in for ICU tests |
57a6839d | 2 | ## Copyright (c) 1999-2014, International Business Machines Corporation and |
b75a7d8f A |
3 | ## others. All Rights Reserved. |
4 | ||
5 | ## Source directory information | |
6 | srcdir = @srcdir@ | |
7 | top_srcdir = @top_srcdir@ | |
8 | ||
9 | top_builddir = .. | |
10 | ||
11 | include $(top_builddir)/icudefs.mk | |
12 | ||
b75a7d8f A |
13 | ## Build directory information |
14 | subdir = test | |
15 | ||
374ca955 | 16 | @ICUIO_TRUE@IOTEST = iotest |
b331163b A |
17 | |
18 | # the letest directory depends on layoutex. | |
19 | # If you have layoutex but not layout, you will be using | |
20 | # harfbuzz. | |
21 | @LAYOUTEX_TRUE@LETEST = letest | |
57a6839d A |
22 | |
23 | # status dir | |
24 | STATUS_TMP = tmp | |
25 | STATUS_FULL = $(shell pwd)/$(STATUS_TMP) | |
374ca955 | 26 | |
b75a7d8f | 27 | ## Files to remove for 'make clean' |
57a6839d | 28 | CLEANFILES = *~ $(STATUS_TMP) |
b75a7d8f | 29 | |
57a6839d | 30 | SUBDIRS = testdata intltest $(IOTEST) cintltst $(LETEST) |
b75a7d8f A |
31 | |
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 \ | |
4388f060 A |
36 | check check-recursive check-local xcheck xcheck-recursive xcheck-local \ |
37 | check-exhaustive check-exhaustive-recursive | |
b75a7d8f A |
38 | |
39 | ## Clear suffix list | |
40 | .SUFFIXES : | |
41 | ||
42 | ## List of standard targets | |
43 | everything: all-recursive all-local | |
44 | all: | |
45 | ifneq ($(RECURSIVE),YES) | |
46 | @echo simply use \`make\' \(or \`make everything\'\) to do all | |
47 | endif | |
48 | ||
49 | install: install-recursive install-local | |
50 | clean: clean-recursive clean-local | |
51 | distclean : distclean-recursive distclean-local | |
374ca955 | 52 | $(RMV) hdrtst/Makefile |
46f4442e | 53 | $(RMV) perf/convperf/Makefile |
57a6839d | 54 | $(RMV) $(STATUS_TMP) |
374ca955 | 55 | |
b75a7d8f A |
56 | dist: dist-recursive dist-local |
57 | check: everything check-recursive check-local | |
374ca955 | 58 | check-recursive: all-recursive |
729e4ab9 A |
59 | # the xcheck targets create a ../test-*.xml file in JUnit format. |
60 | xcheck: everything xcheck-recursive xcheck-local | |
61 | xcheck-recursive: all-recursive | |
4388f060 | 62 | check-exhaustive: everything check-exhaustive-recursive check-local |
b75a7d8f A |
63 | |
64 | ## Recursive targets | |
46f4442e | 65 | all-recursive install-recursive clean-recursive distclean-recursive dist-recursive: |
b75a7d8f A |
66 | @dot_seen=no; \ |
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 \ | |
71 | dot_seen=yes; \ | |
72 | local_target="$$target-local"; \ | |
73 | else \ | |
74 | local_target="$$target"; \ | |
75 | fi; \ | |
76 | (cd $$subdir && $(MAKE) $$local_target) || exit; \ | |
77 | done; \ | |
78 | if test "$$dot_seen" = "no"; then \ | |
79 | $(MAKE) "$$target-local" || exit; \ | |
80 | fi | |
81 | ||
4388f060 | 82 | xcheck-recursive check-recursive check-exhaustive-recursive: |
57a6839d A |
83 | @$(MKINSTALLDIRS) $(STATUS_TMP) |
84 | @mystatus=$(STATUS_FULL)/status.$$$$.deleteme ; \ | |
85 | $(RMV) "$$mystatus".* ; \ | |
46f4442e A |
86 | @goods=; \ |
87 | bads=; \ | |
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"; \ | |
57a6839d | 92 | if (cd $$subdir && $(MAKE) $$local_target TEST_STATUS_FILE="$$mystatus.$$subdir" ); then \ |
46f4442e A |
93 | goods="$$goods $$subdir"; \ |
94 | else \ | |
95 | bads="$$bads $$subdir"; \ | |
96 | fi; \ | |
97 | done; \ | |
57a6839d A |
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" ; \ | |
105 | fi; \ | |
106 | done; \ | |
46f4442e A |
107 | echo "---------------"; \ |
108 | echo "ALL TESTS SUMMARY:"; \ | |
109 | if test ! "x$$bads" = "x"; then \ | |
110 | echo "ok: $$goods"; \ | |
111 | echo "===== ERRS: $$bads"; exit 1; \ | |
112 | else \ | |
113 | echo "All tests OK: $$goods"; \ | |
114 | fi | |
115 | ||
57a6839d A |
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).%) | |
122 | ||
123 | pcheck_setup: testdata | |
124 | @$(MKINSTALLDIRS) $(STATUS_TMP) | |
125 | $(RMV) "$(MYSTATUS_R)".* | |
126 | @echo Beginning parallel make. Output may be interleaved! | |
127 | ||
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..)" | |
131 | -@touch $@ | |
132 | ||
133 | # print out status | |
134 | pcheck: $(STATUS_FILES) | |
135 | @goods= ; \ | |
136 | bads= ; \ | |
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" ; \ | |
145 | fi; \ | |
146 | done; \ | |
147 | for subdir in $(SUBDIRS); do \ | |
148 | if [ -f "$(MYSTATUS_R).$$subdir.FAIL" ]; \ | |
149 | then \ | |
150 | bads="$$bads $$subdir" ; \ | |
151 | elif [ -f "$(MYSTATUS_R).$$subdir.PASS" ]; \ | |
152 | then \ | |
153 | goods="$$goods $$subdir" ; \ | |
154 | else \ | |
155 | echo "*** subtest did not complete - $$subdir" ; \ | |
156 | bads="$$bads $$subdir" ; \ | |
157 | fi ; \ | |
158 | done ; \ | |
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; \ | |
164 | else \ | |
165 | echo "All tests OK: $$goods"; \ | |
166 | fi | |
167 | -@$(RMV) "$(MYSTATUS_R)".* | |
168 | ||
b75a7d8f A |
169 | all-local: |
170 | ||
171 | install-local: | |
172 | ||
173 | dist-local: | |
174 | ||
175 | clean-local: | |
176 | test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) | |
177 | ||
178 | distclean-local: clean-local | |
179 | $(RMV) Makefile | |
180 | ||
729e4ab9 | 181 | xcheck-local check-local: all-local |
b75a7d8f A |
182 | |
183 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | |
184 | cd $(top_builddir) \ | |
185 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
186 |