Hash :
087f0c70
Author :
Date :
2011-05-31T21:42:16
testsuite: avoid generating `*-p.test' tests, use a wrapper script The generated `*-p.test' tests had already become just thin layers around the corresponding test scripts. This change makes the final step, converting to the use of a generic wrapper script and thus avoiding the extra test generation (similarly to what is done for the `*.instspc' and `*.depmod' tests). * tests/parallel-tests.sh: New file, driver script to run checks the on the `parallel-tests' semantics by wrapping tests that use the generic "Simple Tests" driver. * tests/gen-parallel-tests: Update, mostly to reflect the new `.ptest' extensions used for tests in $(parallel_tests). * Makefile.am (TESTS_EXTENSIONS): Add `.ptest'. (PTEST_LOG_COMPILER): Define, it calls `parallel-tests.sh'. ($(parallel_tests)): Do not really generate `*-p.test' tests anymore; this is now just a dummy dependency declaration required in order to have make actually produce expected log files from the `.ptest.log' suffix rule. (EXTRA_DIST): Distribute `parallel-tests.sh'. (MAINTAINERCLEANFILES): Don't remove the `$(parallel_tests)', it is not necessary anymore. (generated_tests): Variable definition removed. (TESTS): Update, by listing `$(parallel_tests)' directly instead of `$(generated_tests)' (expected_list_of_tests): Remove `$(generated_tests)'. (maintainer-check-list-of-tests): No need to explicitly depend on `$(expected_list_of_tests)' anymore.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
#! /bin/sh
# Copyright (C) 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Driver script to run checks the on the `parallel-tests' semantics
# by wrapping tests that use the generic "Simple Tests" driver.
set -e
fatal_ () { echo "$0: $*" >&2; exit 99; }
# Ensure proper definition of $testsrcdir.
. ./defs-static || exit 99
test -n "$testsrcdir" || fatal_ "\$testsrcdir is empty or undefined"
case $#,$1 in
0,) fatal_ "missing argument";;
1,*-p.ptest) test_name=`expr /"$1" : '.*/\(.*\)-p\.ptest'`;;
1,*) fatal_ "invalid argument \`$1'";;
*) fatal_ "too many arguments";;
esac
# Run the test with Automake's parallel-tests driver enabled.
parallel_tests=yes
# This is required to have the wrapped test use a proper temporary
# directory to run into.
me=$test_name-p
# In the spirit of VPATH, we prefer a test in the build tree
# over one in the source tree.
if test -f "./$test_name.test"; then
. "./$test_name.test"
exit $?
elif test -f "$testsrcdir/$test_name.test"; then
. "$testsrcdir/$test_name.test"
exit $?
else
fatal_ "cannot find wrapped test \`$test_name.test'"
fi
exit 255 # Not reached.