2 # Copyright (C) 2011-2017 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 # Custom test drivers: check that the test name passed to the test
18 # driver has any VPATH prefix stripped.
22 ocwd
=$
(pwd) || fatal_
"cannot get current working directory"
25 mv install-sh missing configure.ac src
30 cat >> configure.ac
<< 'END'
34 cat > Makefile.am
<< 'END'
35 # The directories of the 'bar.test' and 'baz.test' tests are deliberately
36 # called as the source directory, to verify that the VPATH-stripping code
37 # doesn't get too easily confused.
38 # The $(empty) are for eliciting VPATH rewrites on make implementations
39 # that support it (e.g., Solaris make), to improve coverage.
41 TESTS
= $
(empty
) foo.
test src
/bar.
test .
/src
/baz.
test $
(empty
)
43 TEST_LOG_DRIVER
= $
(srcdir
)/checkstrip-driver
44 EXTRA_DIST
= checkstrip-driver
47 cat > checkstrip-driver
<<'END'
50 while test $# -gt 0; do
52 --log-file) log_file=$2; shift;;
53 --trs-file) trs_file=$2; shift;;
54 --test-name) test_name=$2; shift;;
55 --expect-failure|--color-tests|--enable-hard-errors) shift;;
57 *) echo "$0: invalid option/argument: '$1'" >&2; exit 2;;
61 echo "test name: $test_name" # For debugging.
63 foo.test|./foo.test|src/ba[rz].test|./src/ba[rz].test);;
66 echo dummy > "$log_file"
67 echo dummy > "$trs_file"
69 chmod a
+x checkstrip-driver
80 # "$MAKE -n" is for debugging, should highlight any VPATH rewrite.
88 # "$MAKE -n" is for debugging, should highlight any VPATH rewrite.