|
1 ## Makefile.in for ICU tests |
|
2 ## Copyright (c) 1999-2013, International Business Machines Corporation and |
|
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 |
|
13 ## Build directory information |
|
14 subdir = test |
|
15 |
|
16 @ICUIO_TRUE@IOTEST = iotest |
|
17 |
|
18 # status dir |
|
19 STATUS_TMP = tmp |
|
20 STATUS_FULL = $(shell pwd)/$(STATUS_TMP) |
|
21 |
|
22 ## Files to remove for 'make clean' |
|
23 CLEANFILES = *~ $(STATUS_TMP) |
|
24 |
|
25 SUBDIRS = testdata intltest $(IOTEST) cintltst |
|
26 |
|
27 ## List of phony targets |
|
28 .PHONY : everything all all-local all-recursive install install-local \ |
|
29 install-recursive clean clean-local clean-recursive distclean \ |
|
30 distclean-local distclean-recursive dist dist-recursive dist-local \ |
|
31 check check-recursive check-local xcheck xcheck-recursive xcheck-local \ |
|
32 check-exhaustive check-exhaustive-recursive |
|
33 |
|
34 ## Clear suffix list |
|
35 .SUFFIXES : |
|
36 |
|
37 ## List of standard targets |
|
38 everything: all-recursive all-local |
|
39 all: |
|
40 ifneq ($(RECURSIVE),YES) |
|
41 @echo simply use \`make\' \(or \`make everything\'\) to do all |
|
42 endif |
|
43 |
|
44 install: install-recursive install-local |
|
45 clean: clean-recursive clean-local |
|
46 distclean : distclean-recursive distclean-local |
|
47 $(RMV) hdrtst/Makefile |
|
48 $(RMV) perf/convperf/Makefile |
|
49 $(RMV) $(STATUS_TMP) |
|
50 |
|
51 dist: dist-recursive dist-local |
|
52 check: everything check-recursive check-local |
|
53 check-recursive: all-recursive |
|
54 # the xcheck targets create a ../test-*.xml file in JUnit format. |
|
55 xcheck: everything xcheck-recursive xcheck-local |
|
56 xcheck-recursive: all-recursive |
|
57 check-exhaustive: everything check-exhaustive-recursive check-local |
|
58 |
|
59 ## Recursive targets |
|
60 all-recursive install-recursive clean-recursive distclean-recursive dist-recursive: |
|
61 @dot_seen=no; \ |
|
62 target=`echo $@ | sed s/-recursive//`; \ |
|
63 list='$(SUBDIRS)'; for subdir in $$list; do \ |
|
64 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \ |
|
65 if test "$$subdir" = "."; then \ |
|
66 dot_seen=yes; \ |
|
67 local_target="$$target-local"; \ |
|
68 else \ |
|
69 local_target="$$target"; \ |
|
70 fi; \ |
|
71 (cd $$subdir && $(MAKE) $$local_target) || exit; \ |
|
72 done; \ |
|
73 if test "$$dot_seen" = "no"; then \ |
|
74 $(MAKE) "$$target-local" || exit; \ |
|
75 fi |
|
76 |
|
77 xcheck-recursive check-recursive check-exhaustive-recursive: |
|
78 @$(MKINSTALLDIRS) $(STATUS_TMP) |
|
79 @mystatus=$(STATUS_FULL)/status.$$$$.deleteme ; \ |
|
80 $(RMV) "$$mystatus".* ; \ |
|
81 @goods=; \ |
|
82 bads=; \ |
|
83 target=`echo $@ | sed s/-recursive//`; \ |
|
84 list='$(SUBDIRS)'; for subdir in $$list; do \ |
|
85 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \ |
|
86 local_target="$$target"; \ |
|
87 if (cd $$subdir && $(MAKE) $$local_target TEST_STATUS_FILE="$$mystatus.$$subdir" ); then \ |
|
88 goods="$$goods $$subdir"; \ |
|
89 else \ |
|
90 bads="$$bads $$subdir"; \ |
|
91 fi; \ |
|
92 done; \ |
|
93 for subdir in $$list; do \ |
|
94 if [ -f "$$mystatus.$$subdir" ]; then \ |
|
95 echo "-------------" ; \ |
|
96 echo "| *** FAILING TEST SUMMARY FOR: $$subdir " ; \ |
|
97 cat "$$mystatus.$$subdir" ; \ |
|
98 echo "| *** END FAILING TEST SUMMARY FOR: $$subdir" ; \ |
|
99 $(RMV) "$$mystatus.$$subdir" ; \ |
|
100 fi; \ |
|
101 done; \ |
|
102 echo "---------------"; \ |
|
103 echo "ALL TESTS SUMMARY:"; \ |
|
104 if test ! "x$$bads" = "x"; then \ |
|
105 echo "ok: $$goods"; \ |
|
106 echo "===== ERRS: $$bads"; exit 1; \ |
|
107 else \ |
|
108 echo "All tests OK: $$goods"; \ |
|
109 fi |
|
110 |
|
111 # pcheck = parallel check. We don't care about the output interleaving, |
|
112 # just run it as fast as possible. |
|
113 # todo would be to merge this code into the above non-parallel check. |
|
114 STATUS_NUM:=$(shell echo $$$$) |
|
115 MYSTATUS_R=$(STATUS_FULL)/status.$(STATUS_NUM).deleteme |
|
116 STATUS_FILES=$(SUBDIRS:%=$(MYSTATUS_R).%) |
|
117 |
|
118 pcheck_setup: testdata |
|
119 @$(MKINSTALLDIRS) $(STATUS_TMP) |
|
120 $(RMV) "$(MYSTATUS_R)".* |
|
121 @echo Beginning parallel make. Output may be interleaved! |
|
122 |
|
123 $(STATUS_FULL)/status.$(STATUS_NUM).deleteme.%: pcheck_setup |
|
124 @$(MAKE) -C $* TEST_STATUS_FILE=$@ check || ( echo "FAILED: $* (other tests may still be running..)" ; touch $@.FAIL ; false ) |
|
125 -@touch $@.PASS |
|
126 -@echo "PASSED: $* (other tests may still be running..)" |
|
127 |
|
128 # print out status |
|
129 pcheck: $(STATUS_FILES) |
|
130 @goods= ; \ |
|
131 bads= ; \ |
|
132 echo "---------------"; \ |
|
133 for subdir in $(SUBDIRS); do \ |
|
134 if [ -f "$(MYSTATUS_R).$$subdir.FAIL" ]; \ |
|
135 then \ |
|
136 bads="$$bads $$subdir" ; \ |
|
137 elif [ -f "$(MYSTATUS_R).$$subdir.PASS" ]; \ |
|
138 then \ |
|
139 goods="$$goods $$subdir" ; \ |
|
140 else \ |
|
141 echo "*** subtest did not complete - $$subdir" ; \ |
|
142 bads="$$bads $$subdir" ; \ |
|
143 fi ; \ |
|
144 done ; \ |
|
145 echo "ALL TESTS SUMMARY:"; \ |
|
146 if test ! "x$$bads" = "x"; then \ |
|
147 echo "(to get non-interleaved err output, use \"$(MAKE) check\" instead.)" ; \ |
|
148 echo "ok: $$goods"; \ |
|
149 echo "===== ERRS: $$bads"; exit 1; \ |
|
150 else \ |
|
151 echo "All tests OK: $$goods"; \ |
|
152 fi |
|
153 -@$(RMV) "$(MYSTATUS_R)".* |
|
154 |
|
155 all-local: |
|
156 |
|
157 install-local: |
|
158 |
|
159 dist-local: |
|
160 |
|
161 clean-local: |
|
162 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) |
|
163 |
|
164 distclean-local: clean-local |
|
165 $(RMV) Makefile |
|
166 |
|
167 xcheck-local check-local: all-local |
|
168 |
|
169 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
|
170 cd $(top_builddir) \ |
|
171 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status |
|
172 |