123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- #! /bin/sh
- . test-init.sh
- cat >> configure.ac << 'END'
- AC_SUBST([acsubst_compiler], [t-compiler])
- AC_CONFIG_LINKS([chk-compiler:chk-compiler])
- AC_OUTPUT
- END
- cat > Makefile.am << 'END'
- TESTS = foo.chk bar.test baz bla.t bli.suff sub/test
- TEST_EXTENSIONS = .chk .test .t
- CHK_LOG_COMPILER = ./chk-compiler
- TEST_LOG_COMPILER = $(SHELL) $(srcdir)/test-compiler
- T_LOG_COMPILER = @acsubst_compiler@
- LOG_COMPILER = @SHELL@ -x $(srcdir)/noext-compiler
- CHK_LOG_FLAGS = --chk
- AM_TEST_LOG_FLAGS = --am-test
- T_LOG_FLAGS = --t
- AM_T_LOG_FLAGS = --am-t
- AM_LOG_FLAGS = -a
- LOG_FLAGS = -b
- EXTRA_DIST = $(TESTS) chk-compiler test-compiler noext-compiler
- END
- mkdir sub
- cat > chk-compiler <<'END'
- #! /bin/sh
- test x"$1" = x"--chk" || {
- echo "$0: invalid command line: $*" >&2
- exit 1
- }
- shift
- exec "$@"
- exit 127
- END
- sed 's/--chk/--am-test/' chk-compiler > test-compiler
- mkdir bin
- PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
- cat > bin/t-compiler <<'END'
- #! /bin/sh
- if test x"$1,$2" != x"--am-t,--t"; then
- echo "$0: invalid command line: $*" >&2
- exit 1
- fi
- shift; shift
- exec "$@"
- exit 127
- END
- sed 's/--am-t,--t/-a,-b/' bin/t-compiler > noext-compiler
- chmod a+x chk-compiler chk-compiler test-compiler bin/t-compiler noext-compiler
- cat >foo.chk << 'END'
- #! /bin/sh
- exit 0
- END
- chmod a+x foo.chk
- cp foo.chk bar.test
- cp foo.chk baz
- cp foo.chk bla.t
- cp foo.chk bli.suff
- cp foo.chk sub/test
- $ACLOCAL
- $AUTOCONF
- $AUTOMAKE -a
- ./configure
- $MAKE check || { cat test-suite.log; exit 1; }
- ls -l . sub
- cat test-suite.log
- test -f foo.log
- test -f bar.log
- test -f baz.log
- test -f bla.log
- test -f bli.suff.log
- test -f sub/test.log
- run_make -e FAIL T_LOG_FLAGS=--bad check
- cat test-suite.log
- cat bla.log
- $EGREP '(^ *|/)t-compiler:.* invalid .*--bad' bla.log
- grep -v '^FAIL: bla\.t ' bla.log | grep 'FAIL:' && exit 1
- $MAKE distcheck
- :
|