From: Stefano Lattarini Date: Fri, 9 Sep 2011 10:47:57 +0000 (+0200) Subject: tests: allow instspc.tap to only run a subset of its tests X-Git-Tag: ng-0.5a~89^2~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95a2d8b3b02c25e64b167223a4b314f8f8d57fa8;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index 0aa5bc51e..04959add3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-09-09 Stefano Lattarini + + 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 coverage: distcheck-hook to catch missing/outdated *.m4 files diff --git a/tests/instspc.tap b/tests/instspc.tap index 46f4b4e2d..6f819efbc 100755 --- a/tests/instspc.tap +++ b/tests/instspc.tap @@ -21,8 +21,6 @@ . ./defs || Exit 99 -plan_ 94 # Two tests per "problematic string". - # Usage: is_in_list ITEM [LIST...] is_in_list () { @@ -41,7 +39,7 @@ define_problematic_string () 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, @@ -55,7 +53,7 @@ define_problematic_string () } # Be sure to avoid interferences from the environment. -test_names_list='' +all_test_names_list='' builddir_xfails='' destdir_xfails='' @@ -210,6 +208,25 @@ unset def # 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