summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support
diff options
context:
space:
mode:
authorIoan-Adrian Ratiu <adrian.ratiu@ni.com>2015-10-30 16:49:54 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-16 11:39:31 +0000
commit54df9117488f793b634edd3d2662df62e7491e1d (patch)
tree0fc642330ceccc3fe723fcd63a2085107f8ec36d /meta/recipes-support
parent54325b298b59f481ab937d0427d574518a856b7e (diff)
downloadpoky-54df9117488f793b634edd3d2662df62e7491e1d.tar.gz
ptest-runner: Allow running of specific tests
By default ptest-runner executes all ptests found in a system. With this change, ptest-runner can be given a list of ptest package names to run (the default is still available). For example, to run only the zlib and rt-tests ptests: "ptest-runner zlib rt-tests" (From OE-Core rev: a13333c3e9ab601a11c10aba2a0a55c7fdea2e24) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
-rwxr-xr-x[-rw-r--r--]meta/recipes-support/ptest-runner/files/ptest-runner53
1 files changed, 40 insertions, 13 deletions
diff --git a/meta/recipes-support/ptest-runner/files/ptest-runner b/meta/recipes-support/ptest-runner/files/ptest-runner
index c618f1148d..204cbdfc76 100644..100755
--- a/meta/recipes-support/ptest-runner/files/ptest-runner
+++ b/meta/recipes-support/ptest-runner/files/ptest-runner
@@ -1,26 +1,53 @@
1#!/bin/sh 1#!/bin/sh
2ANYFAILED=no
3echo "START: $0"
4 2
5for libdir in /usr/lib* 3determine_ptests_to_run()
6do 4{
5 for libdir in /usr/lib*
6 do
7 [ ! -d "$libdir" ] && continue
7 8
8 [ ! -d "$libdir" ] && continue 9 for x in `ls -d $libdir/*/ptest 2>/dev/null`
10 do
11 [ ! -f $x/run-ptest ] && continue
12 [ -h `dirname $x` ] && continue
9 13
10 for x in `ls -d $libdir/*/ptest 2>/dev/null` 14 #found a ptest in the system
11 do 15 PTEST_FOUND=$(basename $(dirname $x))
12 [ ! -f $x/run-ptest ] && continue 16
13 [ -h `dirname $x` ] && continue 17 # when no pkg-names were specified, by default run each one
18 if [[ -z $@ ]]; then
19 printf " $x"
20 else
21 #check if this ptest has been asked for and add it
22 if [[ $@ =~ $PTEST_FOUND ]]; then
23 printf " $x"
24 fi
25 fi
26 done
27 done
28}
14 29
30run_ptests()
31{
32 ANYFAILED=no
33
34 #the paths were sanity-checked in determine_ptests_to_run()
35 for ptst_path in $PTESTS_TO_RUN
36 do
15 date "+%Y-%m-%dT%H:%M" 37 date "+%Y-%m-%dT%H:%M"
16 echo "BEGIN: $x" 38 echo "BEGIN: $ptst_path"
17 cd "$x" 39 cd "$ptst_path"
18 ./run-ptest || ANYFAILED=yes 40 ./run-ptest || ANYFAILED=yes
19 echo "END: $x" 41 echo "END: $ptest_path"
20 date "+%Y-%m-%dT%H:%M" 42 date "+%Y-%m-%dT%H:%M"
21 done 43 done
22done 44}
45
46echo "START: $0"
47PTESTS_TO_RUN=$(determine_ptests_to_run $@)
48run_ptests
23echo "STOP: $0" 49echo "STOP: $0"
50
24if [ "$ANYFAILED" = "yes" ]; then 51if [ "$ANYFAILED" = "yes" ]; then
25 exit 1 52 exit 1
26fi 53fi