+2011-09-09 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: allow instspc.tap to only run a subset of its tests
+ * tests/instspc.tap: If command-line arguments are passed to the
+ tests, they are now taken as the list of test names for which the
+ checks are to be run.
+
2011-09-09 Stefano Lattarini <stefano.lattarini@gmail.com>
coverage: distcheck-hook to catch missing/outdated *.m4 files
. ./defs || Exit 99
-plan_ 94 # Two tests per "problematic string".
-
# Usage: is_in_list ITEM [LIST...]
is_in_list ()
{
eval "instspc__$tst=\$1" \
|| fatal_ "define_problematic_string: bad argument: '$tst'"
shift
- test_names_list="$test_names_list $tst"
+ all_test_names_list="$all_test_names_list $tst"
# Some of the "problematic" characters cannot be used in the name of
# a build or install directory on a POSIX host. These lists should
# be empty, but are not due to limitations in Autoconf, Automake, Make,
}
# Be sure to avoid interferences from the environment.
-test_names_list=''
+all_test_names_list=''
builddir_xfails=''
destdir_xfails=''
# Test data end #
# =============== #
+# Allow the user to select a subset of the tests.
+if test $# -gt 0; then
+ test_names_list=$*
+ for test_name in $test_names_list; do
+ case " $all_test_names_list " in
+ *" $test_name "*);;
+ *) fatal_ "invalid user-specified test_name '$test_name'"
+ esac
+ done
+ # We need to determine the TAP plan adaptively.
+ n=`for t in $test_names_list; do echo $t; done | wc -l`
+ plan_ `expr $n '*' 2` # Two tests per "problematic string".
+ unset n
+else
+ test_names_list=$all_test_names_list
+ # Prefer static TAP plan if possible, minimizes the chance of errors.
+ plan_ 94
+fi
+
ocwd=`pwd` || fatal_ "cannot get current working directory"
create_input_data