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