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