Home | History | Annotate | Download | only in test
      1 ## Makefile.in for ICU tests
      2 ## Copyright (c) 1999-2014, 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 # 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
     22 
     23 # status dir
     24 STATUS_TMP = tmp
     25 STATUS_FULL = $(shell pwd)/$(STATUS_TMP)
     26 
     27 ## Files to remove for 'make clean'
     28 CLEANFILES = *~ $(STATUS_TMP)
     29 
     30 SUBDIRS = testdata intltest $(IOTEST) cintltst $(LETEST)
     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	\
     36 check check-recursive check-local xcheck xcheck-recursive xcheck-local	\
     37 check-exhaustive check-exhaustive-recursive
     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
     52 	$(RMV) hdrtst/Makefile
     53 	$(RMV) perf/convperf/Makefile
     54 	$(RMV) $(STATUS_TMP)
     55 
     56 dist: dist-recursive dist-local
     57 check: everything check-recursive check-local
     58 check-recursive: all-recursive
     59 # the xcheck targets create a ../test-*.xml file in JUnit format.
     60 xcheck: everything xcheck-recursive xcheck-local
     61 xcheck-recursive: all-recursive
     62 check-exhaustive: everything check-exhaustive-recursive check-local
     63 
     64 ## Recursive targets
     65 all-recursive install-recursive clean-recursive distclean-recursive dist-recursive:
     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 
     82 xcheck-recursive check-recursive check-exhaustive-recursive:
     83 	@$(MKINSTALLDIRS) $(STATUS_TMP)
     84 	@mystatus=$(STATUS_FULL)/status.$$$$.deleteme ; \
     85 	$(RMV) "$$mystatus".* ; \
     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"; \
     92 	  if (cd $$subdir && $(MAKE) $$local_target TEST_STATUS_FILE="$$mystatus.$$subdir" ); then \
     93 	    goods="$$goods $$subdir"; \
     94           else \
     95             bads="$$bads $$subdir"; \
     96           fi; \
     97 	done; \
     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; \
    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 
    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 
    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 
    181 xcheck-local check-local: all-local
    182 
    183 Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
    184 	cd $(top_builddir) \
    185 	&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
    186 
    187