summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support
diff options
context:
space:
mode:
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