diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2016-12-01 21:31:45 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2017-02-13 20:43:48 +0200 |
commit | 95f50dc923c4d9694c37d1a3b50965a9a869663e (patch) | |
tree | ab4b145f57f0f1d5d88a315b08eaba7e9a086ade /scripts/vsp-tests.sh | |
parent | c76d10c29ff54f120220e5c041c5e6e8b1bdc515 (diff) |
scripts: Test suite runner
Provide a utility script to execute all vsp unit tests, as well
as the option to execute multiple iterations of the suite.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'scripts/vsp-tests.sh')
-rwxr-xr-x | scripts/vsp-tests.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/vsp-tests.sh b/scripts/vsp-tests.sh new file mode 100755 index 0000000..6a10f70 --- /dev/null +++ b/scripts/vsp-tests.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +## +## VSP Tests runner +## +## Automatically execute all vsp-unit tests +## Move test failure results to a specific folder for +## the running kernel version +## +## An argument can be provided to specify the number of +## iterations to perform +## +## usage: +## ./vsp-tests.sh <n> +## +## n: Number of iterations to execute test suite +## + +KERNEL_VERSION=`uname -r` + +run_test() { + local script=$1 + local iteration=$2 + + echo "- $script" + ./$script + + if [ $(ls *.bin 2>/dev/null | wc -l) != 0 ] ; then + local dir=$KERNEL_VERSION/test-$script/$iteration/ + + mkdir -p $dir + mv *.bin $dir + fi +} + +run_suite() { + echo "--- Test loop $1 ---" + + for test in vsp-unit-test*.sh; do + run_test $test $1 + done; +} + +for loop in `seq 1 1 $1`; do + run_suite $loop +done; |