]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: allow depmod.tap to only run a subset of its tests
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 9 Sep 2011 11:02:11 +0000 (13:02 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 9 Sep 2011 11:03:56 +0000 (13:03 +0200)
* tests/depmod.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.

ChangeLog
tests/depmod.tap

index 04959add3deb06a5b7e598e51dedf67b5178f836..da911d5ae62074d7d5300d0f1b3b49db583f3895 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-09-09  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tests: allow depmod.tap to only run a subset of its tests
+       * tests/depmod.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>
 
        tests: allow instspc.tap to only run a subset of its tests
index 6f6a73e9f9ea441126a3bcba1e88db47ad33a486..f2f59b4e54b823d69179aed8981331da942d6500 100755 (executable)
 required=cc
 . ./defs || Exit 99
 
-# Per each valid depmode three kinds of VPATH, and per each of them
-# a test on "./configure" and one on "make & remake"; so there are
-# 17 * 3 * 2 = 102.
-plan_ 102
-
-ocwd=`pwd` || fatal_ "cannot get current working directory"
-
 # Keep this in sync with the contents of depend.m4.
 all_depmodes=`\
   sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_scriptdir/depcomp" \
@@ -70,6 +63,30 @@ all_depmodes=`\
   && test -n "$all_depmodes" \
   || fatal_ "can't extract list of valid depmodes"
 
+# Allow the user to select a subset of the tests.
+if test $# -gt 0; then
+  tested_depmodes=$*
+  for depmode in $tested_depmodes; do
+    case " $all_depmodes " in
+      *" $depmode "*);;
+      *) fatal_ "invalid user-specified depmode '$depmode'"
+    esac
+  done
+  n=`for m in $tested_depmodes; do echo $m; done | wc -l`
+  # We need to determine the TAP plan adaptively.
+  # Per each valid depmode three kinds of VPATH, and per each of them
+  # a test on "./configure" and one on "make & remake"; so there are
+  # $n * 3 * 2 tests.
+  plan_ `expr $n '*' 6`
+  unset n
+else
+  tested_depmodes=$all_depmodes
+  # Prefer static TAP plan if possible, minimizes the chance of errors.
+  plan_ 102
+fi
+
+ocwd=`pwd` || fatal_ "cannot get current working directory"
+
 srctree=depmod-1.0
 mkdir $srctree
 mv missing install-sh depcomp configure.in $srctree
@@ -129,7 +146,7 @@ cp -pR $srctree/* $longpath || fatal_ "cannot populate long path"
 cp -pR $srctree/* . || fatal_ "cannot populate top-level directory"
 
 for vpath in simple long absolute; do
-  for depmode in $all_depmodes; do
+  for depmode in $tested_depmodes; do
     case $vpath in
       simple)
         srcdir=..;;