2 # Copyright (C) 2011-2012 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: if a log file has a directory component (as in
18 # e.g., 'sub/foo.log'), the Automake test harness must ensure that
19 # directory exists before calling any custom test driver.
23 cat >> configure.ac
<< 'END'
27 cat > Makefile.am
<< 'END'
28 # The extra '.' components below are meant.
29 TESTS
= sub
/foo sub
/subsub
/bar.
test .
/.
/sub
1/.
/baz
31 LOG_DRIVER
= $
(srcdir
)/checkdir-driver
32 TEST_LOG_DRIVER
= $
(LOG_DRIVER
)
33 EXTRA_DIST
= checkdir-driver
35 check-local
: $
(TEST_SUITE_LOG
)
40 test -f sub
/subsub
/bar.log
43 test -f sub
/subsub
/bar.trs
47 echo "#!$AM_TEST_RUNNER_SHELL" > checkdir-driver
48 cat >> checkdir-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|--expect-failure|--color-tests|--enable-hard-errors) shift;;
56 *) echo "$0: invalid option/argument: '$1'" >&2; exit 2;;
60 echo "log: $log_file" # For debugging.
61 echo "trs: $trs_file" # Ditto.
62 case $log_file in */*);; *) exit 1;; esac
63 dir_log=${log_file%/*}
64 dir_trs=${trs_file%/*}
65 echo "dir_log: $dir_log" # For debugging.
66 echo "dir_trs: $dir_trs" # Likewise.
67 test x"$dir_trs" = x"$dir_log" || exit 1
68 test -d "$dir_log" || exit 1
69 echo dummy1 > "$log_file"
70 echo dummy2 > "$trs_file"
72 chmod a
+x checkdir-driver