2 # Copyright (C) 2011-2013 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)
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 that the testsuite driver can find test in the srcdir as
18 # well as in builddir, and that is prefers those in the builddir.
20 # For gen-testsuite-part: ==> try-with-serial-tests <==
23 cat >> configure.ac << 'END'
27 cat > Makefile.am << 'END'
28 TESTS = foo.test bar.test
32 cat > foo.test << 'END'
34 exit ${FOO_EXIT_STATUS-0}
49 cat > bar.test << 'END'
56 # The serial test driver does not strip VPATH components from
57 # the name of the test, but the parallel driver should.
58 if test x"$am_serial_tests" = x"yes"; then
59 grep '^PASS: .*foo\.test *$' output
61 grep '\.\./foo' output && exit 1
62 grep '^PASS: foo\.test *$' output
64 grep '^PASS: bar\.test *$' output
66 rm -f test-suite.log foo.log bar.log
68 run_make -M -e FAIL FOO_EXIT_STATUS=1 check
69 # The serial test driver does not strip VPATH components from
70 # the name of the test, but the parallel driver should.
71 if test x"$am_serial_tests" = x"yes"; then
72 grep '^FAIL: .*foo\.test *$' output
74 grep '\.\./foo' output && exit 1
75 grep '^FAIL: foo\.test *$' output
77 grep '^PASS: bar\.test *$' output
79 rm -f test-suite.log foo.log bar.log
81 # Check that if the same test is present in srcdir and builddir,
82 # the one in builddir is preferred.
84 run_make -M FOO_EXIT_STATUS=1 check
85 grep '^PASS: foo\.test *$' output
86 grep '^PASS: bar\.test *$' output
88 # The tests in the builddir must be preferred also by "make dist".
89 FOO_EXIT_STATUS=1 $MAKE distcheck