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:28:34 +0000
commita13333c3e9ab601a11c10aba2a0a55c7fdea2e24 (patch)
tree1e6c75d4e36f56c0b50dc82eee619e084856f50e /meta/recipes-support
parent8fe45badd3dfe44fa5161229324b6439594123fd (diff)
downloadopenembedded-core-contrib-a13333c3e9ab601a11c10aba2a0a55c7fdea2e24.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" Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
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 @@
#!/bin/sh
-ANYFAILED=no
-echo "START: $0"
-for libdir in /usr/lib*
-do
+determine_ptests_to_run()
+{
+ for libdir in /usr/lib*
+ do
+ [ ! -d "$libdir" ] && continue
- [ ! -d "$libdir" ] && continue
+ for x in `ls -d $libdir/*/ptest 2>/dev/null`
+ do
+ [ ! -f $x/run-ptest ] && continue
+ [ -h `dirname $x` ] && continue
- for x in `ls -d $libdir/*/ptest 2>/dev/null`
- do
- [ ! -f $x/run-ptest ] && continue
- [ -h `dirname $x` ] && continue
+ #found a ptest in the system
+ PTEST_FOUND=$(basename $(dirname $x))
+
+ # when no pkg-names were specified, by default run each one
+ if [[ -z $@ ]]; then
+ printf " $x"
+ else
+ #check if this ptest has been asked for and add it
+ if [[ $@ =~ $PTEST_FOUND ]]; then
+ printf " $x"
+ fi
+ fi
+ done
+ done
+}
+run_ptests()
+{
+ ANYFAILED=no
+
+ #the paths were sanity-checked in determine_ptests_to_run()
+ for ptst_path in $PTESTS_TO_RUN
+ do
date "+%Y-%m-%dT%H:%M"
- echo "BEGIN: $x"
- cd "$x"
+ echo "BEGIN: $ptst_path"
+ cd "$ptst_path"
./run-ptest || ANYFAILED=yes
- echo "END: $x"
+ echo "END: $ptest_path"
date "+%Y-%m-%dT%H:%M"
done
-done
+}
+
+echo "START: $0"
+PTESTS_TO_RUN=$(determine_ptests_to_run $@)
+run_ptests
echo "STOP: $0"
+
if [ "$ANYFAILED" = "yes" ]; then
exit 1
fi