123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- #! /bin/sh
- . test-init.sh
- LANG=C LANGUAGE=C LC_ALL=C
- export LANG LANGUAGE LC_ALL
- cat > Makefile.am << 'END'
- TEST_LOG_COMPILER = true
- TESTS =
- errmsg = ::OOPS:: Recursion too deep
- if IS_GNU_MAKE
- is_too_deep := $(shell test $(MAKELEVEL) -lt 10 && echo no)
- ifeq ($(is_too_deep),no)
- else
- $(error $(errmsg), $(MAKELEVEL) levels)
- endif
- else !IS_GNU_MAKE
- recursion-not-too-deep:
- @ok=no; \
- for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 \
- 18 19 20 21 22 23 24 25 26 27 28 29; \
- do \
- echo " mkdir rec-$$i.d"; \
- if mkdir rec-$$i.d; then \
- ok=yes; break; \
- else :; fi; \
- done; \
- test $$ok = yes || { echo '$(errmsg)' >&2; exit 1; }
- .PHONY: recursion-not-too-deep
- clean-local:
- rmdir rec-[0-9].d
- targets = all check recheck $(TESTS) $(TEST_LOGS) $(TEST_SUITE_LOG)
- $(targets): recursion-not-too-deep
- .BEGIN: recursion-not-too-deep
- endif !IS_GNU_MAKE
- END
- if using_gmake; then
- cond=:
- else
- cond=false
- fi
- cat >> configure.ac << END
- AM_CONDITIONAL([IS_GNU_MAKE], [$cond])
- AC_OUTPUT
- END
- if (ulimit -t 8); then ulimit -t 8; fi
- $ACLOCAL
- $AUTOCONF
- $AUTOMAKE -a -Wno-portability
- ./configure
- do_check ()
- {
- log=$1; shift
- run_make -M -e IGNORE -- "$@" check
- $FGREP '::OOPS::' output && exit 1
-
- test ! -e "$log"
- if using_gmake; then
- grep "[Cc]ircular.*dependency" output | $FGREP "$log"
- test $am_make_rc -gt 0
- else
-
-
-
-
-
-
-
- err_seen=no
- for err_rx in \
- 'circular.* depend' \
- 'depend.* circular' \
- 'graph cycle' \
- 'infinite (loop|recursion)' \
- 'depend.* on itself' \
- ; do
- $EGREP -i "$err_rx" output | $FGREP "$log" || continue
- err_seen=yes
- break
- done
- test $err_seen = yes || exit 1
- fi
- }
- : > test-suite.test
- do_check test-suite.log TESTS=test-suite.test
- rm -f *.log *.test
- : > 0.test
- : > 1.test
- : > 2.test
- : > 3.test
- : > foobar.test
- do_check foobar.log TEST_LOGS='0.log 1.log foobar.log 2.log 3.log' \
- TEST_SUITE_LOG=foobar.log
- rm -f *.log *.test
- :
|