123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- #! /bin/sh
- required='cc native'
- . test-init.sh
- cat >> configure.ac << 'END'
- AC_PROG_CC
- AC_OUTPUT
- END
- cat > Makefile.am << 'END'
- TEST_EXTENSIONS = .bin .test
- EXTRA_PROGRAMS =
- TESTS =
- END
- cat >> Makefile.am <<'END'
- EXTRA_PROGRAMS += foo.bin
- TESTS += foo.bin
- foo_bin_SOURCES = foo.c
- END
- cat > foo.c <<'END'
- int main (void)
- {
- printf ("foofoofoo\n");
- return 0;
- }
- END
- cat >> Makefile.am <<'END'
- EXTRA_PROGRAMS += bar.bin
- TESTS += bar.bin
- bar_bin_SOURCES = bar.c
- bar.c: foo.c
- sed -e 's/foofoofoo/barbarbar/' foo.c > $@
- END
- cat >> Makefile.am <<'END'
- EXTRA_PROGRAMS += y
- TESTS += baz.test
- baz.log: y$(EXEEXT)
- END
- cat > baz.test <<'END'
- #!/bin/sh
- $srcdir/y "$@" | sed 's/.*/&ep&ep&ep/'
- END
- chmod a+x baz.test
- cat > y.c <<'END'
- int main (void)
- {
- printf ("y\n");
- return 0;
- }
- END
- cat >> Makefile.am <<'END'
- EXTRA_PROGRAMS += none.bin
- TESTS += none.bin
- none_bin_SOURCES = none.c
- END
- $ACLOCAL
- $AUTOCONF
- $AUTOMAKE -a
- ./configure
- run_make -E -O -e IGNORE -- -k check
- ls -l
- if using_gmake; then
- test $am_make_rc -gt 0 || exit 1
- else
-
- $MAKE check && exit 1
- : For shells with busted 'set -e'.
- fi
- cat bar.c
- grep foofoofoo foo.log
- grep barbarbar bar.log
- grep yepyepyep baz.log
- test ! -e none.log
- test ! -e test-suite.log
- grep '^PASS: baz\.test$' stdout
- grep '^PASS: foo\.bin' stdout
- grep '^PASS: bar\.bin' stdout
- $EGREP 'none\.(bin|o|c)' stderr stdout
- : > stamp
- $sleep
- echo 'int main (void) { return 0; }' > none.c
- run_make -O -e IGNORE check RECHECK_LOGS=
- ls -l
- test $am_make_rc -eq 0 || exit 1
- stat stamp foo.log bar.log baz.log || :
- is_newest stamp foo.log bar.log baz.log
- test -f none.log
- test -f test-suite.log
- $EGREP '(foo|bar)\.bin|baz\.test$' stdout && exit 1
- grep '^PASS: none\.bin' stdout
- :
|