]> git.saurik.com Git - apt.git/commitdiff
implement i quiet run-tests mode which prints only one line per testcase
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 16 Jan 2011 12:33:24 +0000 (13:33 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 16 Jan 2011 12:33:24 +0000 (13:33 +0100)
test/integration/framework
test/integration/run-tests

index 4bbe1b408e15c0b12a8fc7f50b4b6a5abe0972b4..5d54e49b67986a7f2328e4a29632f82ce628dac0 100644 (file)
@@ -39,6 +39,10 @@ fi
 if [ $MSGLEVEL -le 2 ]; then
        msgmsg() { true; }
        msgnmsg() { true; }
+       msgtest() { true; }
+       msgpass() { echo -n " ${CPASS}P${CNORMAL}" >&2; }
+       msgskip() { echo -n " ${CWARNING}S${CNORMAL}" >&2; }
+       msgfail() { echo -n " ${CFAIL}FAIL${CNORMAL}" >&2; }
 fi
 if [ $MSGLEVEL -le 3 ]; then
        msginfo() { true; }
index c7ea0a61ac3567fa05c5d6b7ed18c0abcd5cc7d9..5644f0a05ddfeb8198111341a7c5a31d85e89818 100755 (executable)
@@ -2,7 +2,19 @@
 set -e
 
 DIR=$(readlink -f $(dirname $0))
+if [ "$1" = "-q" ]; then
+       export MSGLEVEL=2
+elif [ "$1" = "-v" ]; then
+       export MSGLEVEL=5
+fi
 for testcase in $(run-parts --list $DIR | grep '/test-'); do
-       echo "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m"
+       if [ "$1" = "-q" ]; then
+               echo -n "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m"
+       else
+               echo "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m"
+       fi
        ${testcase}
+       if [ "$1" = "-q" ]; then
+               echo
+       fi
 done