summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-08-18 13:20:16 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-08-18 13:20:16 +0200
commitfc89263e0dc1eceb016d52f2007a458b2dc5afaf (patch)
tree943ef45a7f7b0d178c1118299d3668d5dc5e264f
parentce9864a8bfdfc7f5380b3335a6a14f305d372d45 (diff)
add proper MSGLEVEL handling by overriding methods dynamic
-rw-r--r--test/integration/framework36
1 files changed, 31 insertions, 5 deletions
diff --git a/test/integration/framework b/test/integration/framework
index e3d77c5cd..a4c857f17 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -28,11 +28,37 @@ msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; }
msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; }
# enable / disable Debugging
-msginfo() { true; }
-msgdebug() { true; }
-msgninfo() { true; }
-msgndebug() { true; }
-msgdone() { if [ "$1" = "debug" -o "$1" = "info" ]; then true; else echo "${CDONE}DONE${CNORMAL}" >&2; fi }
+MSGLEVEL=${MSGLEVEL:-3}
+if [ $MSGLEVEL -le 0 ]; then
+ msgdie() { true; }
+fi
+if [ $MSGLEVEL -le 1 ]; then
+ msgwarn() { true; }
+ msgnwarn() { true; }
+fi
+if [ $MSGLEVEL -le 2 ]; then
+ msgmsg() { true; }
+ msgnmsg() { true; }
+fi
+if [ $MSGLEVEL -le 3 ]; then
+ msginfo() { true; }
+ msgninfo() { true; }
+fi
+if [ $MSGLEVEL -le 4 ]; then
+ msgdebug() { true; }
+ msgndebug() { true; }
+fi
+msgdone() {
+ if [ "$1" = "debug" -a $MSGLEVEL -le 4 ] ||
+ [ "$1" = "info" -a $MSGLEVEL -le 3 ] ||
+ [ "$1" = "msg" -a $MSGLEVEL -le 2 ] ||
+ [ "$1" = "warn" -a $MSGLEVEL -le 1 ] ||
+ [ "$1" = "die" -a $MSGLEVEL -le 0 ]; then
+ true;
+ else
+ echo "${CDONE}DONE${CNORMAL}" >&2;
+ fi
+}
runapt() {
msgdebug "Executing: ${CCMD}$*${CDEBUG} "