tests: expose weaknesses in make flags analysis
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 1 May 2013 22:43:33 +0000 (00:43 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 1 May 2013 22:44:23 +0000 (00:44 +0200)
This introduces some failures in the testsuite, that will be fixed
soon enough by follow-up patches.

* t/make-dryrun.tap: Enhance and extend.
* t/make-keepgoing.tap: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/make-dryrun.tap
t/make-keepgoing.tap

index c7d8963..0dbe3bb 100755 (executable)
@@ -18,7 +18,7 @@
 
 . test-init.sh
 
-plan_ 20
+plan_ 60
 
 if echo "all: ; +@printf %sbb%s aa cc" | $MAKE -n -f - | grep aabbcc; then
   make_plus_silence () { return 0; }
@@ -48,7 +48,7 @@ END
 
 check_make ()
 {
-  r=ok msg= mode= condition=: directive= reason= skip_reason=
+  msg= mode= condition=: directive= reason= skip_reason=
   case $1 in
     --dry) mode=dry;;
     --run) mode=run;;
@@ -64,17 +64,20 @@ check_make ()
     esac
     shift
   done
-  msg=${mode}${msg:+" [$msg]"}
-  if $condition; then
-    $MAKE "$mode" ${1+"$@"} || r='not ok'
-    test -f from-$mode      || r='not ok'
-    test ! -e bad           || r='not ok'
-    rm -f bad from-*        || fatal_ "cleaning up"
-  else
-    directive=SKIP reason=$skip_reason
-  fi
-  result_ "$r" -D "$directive" -r "$reason" "$msg"
-  unset r msg mode condition directive reason skip_reason
+  for opts in '' '-s'  '-s -r'; do
+    r=ok
+    pmsg=${mode}${msg:+" [$msg]"}${opts:+" ($opts)"}
+    if $condition; then
+      $MAKE $opts "$mode" ${1+"$@"} || r='not ok'
+      test -f from-$mode            || r='not ok'
+      test ! -e bad                 || r='not ok'
+      rm -f bad from-*              || fatal_ "cleaning up"
+    else
+      directive=SKIP reason=$skip_reason
+    fi
+    result_ "$r" -D "$directive" -r "$reason" "$pmsg"
+  done
+  unset r msg pmsg opts mode condition directive reason skip_reason
 }
 
 # ----------------------------------------------------------------------
index 0e416ca..f9db028 100755 (executable)
@@ -18,7 +18,7 @@
 
 . test-init.sh
 
-plan_ 20
+plan_ 60
 
 mkdir kool # Also used later.
 if echo nil: | $MAKE -I kool -f -; then
@@ -42,7 +42,7 @@ END
 
 check_make ()
 {
-  r=ok msg= mode= condition=: directive= reason= skip_reason=
+  msg= mode= condition=: directive= reason= skip_reason=
   case $1 in
     k-[yn]) mode=$1;;
     *) fatal_ "check_run: invalid usage";;
@@ -58,14 +58,17 @@ check_make ()
     esac
     shift
   done
-  msg=${mode}${msg:+" [$msg]"}
-  if $condition; then
-    $MAKE "$mode" ${1+"$@"} || r='not ok'
-  else
-    directive=SKIP reason=$skip_reason
-  fi
-  result_ "$r" -D "$directive" -r "$reason" "$msg"
-  unset r msg mode condition directive reason skip_reason
+  for opts in '' '-s'  '-s -r'; do
+    r=ok
+    pmsg=${mode}${msg:+" [$msg]"}${opts:+" ($opts)"}
+    if $condition; then
+      $MAKE $opts "$mode" ${1+"$@"} || r='not ok'
+    else
+      directive=SKIP reason=$skip_reason
+    fi
+    result_ "$r" -D "$directive" -r "$reason" "$pmsg"
+  done
+  unset r msg pmsg opts mode condition directive reason skip_reason
 }
 
 # ----------------------------------------------------------------------