tests: fix a timestamp-related spurious failures
[automake.git] / tests / parallel-tests8.test
blob524b82bbbe611021343e0874cde3d9d20474023f
1 #! /bin/sh
2 # Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Check parallel-tests features:
18 # - generated distributed tests.
19 # - listing $(srcdir)/ or $(top_srcdir)/ in TESTS doesn't work ATM,
20 # and is thus diagnosed.
22 # TODO: this test should also ensure that the `make' implementation
23 # properly adheres to rules in all cases. See the Autoconf
24 # manual for the ugliness in this area, when VPATH comes into
25 # play. :-/
27 parallel_tests=yes
28 . ./defs || Exit 1
30 set -e
32 cat >> configure.in << 'END'
33 AC_OUTPUT
34 END
36 cat > Makefile.am << 'END'
37 TESTS = foo.test
38 ## the next line will cause automake to error out:
39 TESTS += $(srcdir)/bar.test $(top_srcdir)/baz.test
40 .in.test:
41 ## Account for VPATH issues on weaker make implementations (e.g. IRIX 6.5)
42 cp `test -f '$<' || echo $(srcdir)/`$< $@
43 chmod +x $@
44 check_SCRIPTS = $(TESTS)
45 EXTRA_DIST = foo.in foo.test
46 DISTCLEANFILES = foo.test
47 END
49 cat >>foo.in <<'END'
50 #! /bin/sh
51 echo "this is $0"
52 exit 0
53 END
55 $ACLOCAL
56 $AUTOCONF
57 AUTOMAKE_fails -a
58 grep '(srcdir.*bar' stderr
59 grep 'top_srcdir.*baz' stderr
61 sed '/^TESTS +=.*srcdir/d' < Makefile.am > t
62 mv -f t Makefile.am
63 $AUTOMAKE -a
65 ./configure
66 $MAKE check
67 $MAKE distcheck
68 $MAKE distclean
70 mkdir build
71 cd build
72 ../configure
73 $MAKE check
74 test ! -f ../foo.log
75 $MAKE distcheck