summaryrefslogtreecommitdiff
path: root/scripts/vsp-tests.sh
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-02-13 14:37:39 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-02-13 20:43:48 +0200
commit2b923a64ce11f4dc4e12cc024ce9b30b09b162a4 (patch)
treece75fd55cf3a84dbbddeca64eed74895cfe3a4cd /scripts/vsp-tests.sh
parent95f50dc923c4d9694c37d1a3b50965a9a869663e (diff)
scripts: Add statistics to test suite runner
Print the number of passed, failed and skipped tests. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'scripts/vsp-tests.sh')
-rwxr-xr-xscripts/vsp-tests.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/vsp-tests.sh b/scripts/vsp-tests.sh
index 6a10f70..1ed8171 100755
--- a/scripts/vsp-tests.sh
+++ b/scripts/vsp-tests.sh
@@ -21,9 +21,17 @@ KERNEL_VERSION=`uname -r`
run_test() {
local script=$1
local iteration=$2
+ local IFS="$(printf '\n\t')"
echo "- $script"
- ./$script
+
+ local output=$(./$script 2>&1 | tee /proc/self/fd/2)
+ for line in $output ; do
+ (echo "$line" | grep -q 'fail$') && num_fail=$((num_fail+1))
+ (echo "$line" | grep -q 'pass$') && num_pass=$((num_pass+1))
+ (echo "$line" | grep -q 'skipped$') && num_skip=$((num_skip+1))
+ num_test=$((num_test+1))
+ done
if [ $(ls *.bin 2>/dev/null | wc -l) != 0 ] ; then
local dir=$KERNEL_VERSION/test-$script/$iteration/
@@ -36,9 +44,16 @@ run_test() {
run_suite() {
echo "--- Test loop $1 ---"
+ num_fail=0
+ num_pass=0
+ num_skip=0
+ num_test=0
+
for test in vsp-unit-test*.sh; do
run_test $test $1
done;
+
+ echo "$num_test tests: $num_pass passed, $num_fail failed, $num_skip skipped"
}
for loop in `seq 1 1 $1`; do