aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Haslam <stuart.haslam@linaro.org>2015-04-23 11:43:56 +0100
committerKoen Kooi <koen.kooi@linaro.org>2015-08-11 10:17:42 +0000
commit76500b5285156a8b0f6d2067f5d5042a3ed79498 (patch)
tree625431bf64e00200b4354b2c3d5804af16f87f5c
parentb736d85a0d1cdf00307209010d19d5c4977f5485 (diff)
downloadmeta-linaro-76500b5285156a8b0f6d2067f5d5042a3ed79498.tar.gz
odp: add support for ptest
ODP has a comprehensive set of API validation tests, so build and install these in order for them to be run on the target platform. The ptest framework is used to do this, allowing some previously unused PACKAGECONFIG options to be tidied up. To enable this feature "ptest" must be added to DISTRO_FEATURES. Change-Id: I1cc9beb4876ae2ec1fe4e4d05b841cee5bf779e0 Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
-rw-r--r--meta-linaro/recipes-extra/odp/odp/run-ptest41
-rw-r--r--meta-linaro/recipes-extra/odp/odp_v1.0.3.bb34
2 files changed, 65 insertions, 10 deletions
diff --git a/meta-linaro/recipes-extra/odp/odp/run-ptest b/meta-linaro/recipes-extra/odp/odp/run-ptest
new file mode 100644
index 00000000..a3e2cf66
--- /dev/null
+++ b/meta-linaro/recipes-extra/odp/odp/run-ptest
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Run all of the ODP test applications and report status in a format
+# that matches the automake "make check" output.
+#
+res=0
+
+if [ "$1" != "-v" ]; then
+ verbose=0
+ mkdir -p logs
+else
+ verbose=1
+fi
+
+TESTS=$(find test/* -type f -executable | grep -v .debug | sort)
+
+if [ "$TESTS" = "" ]; then
+ echo "Failed to find any test executables"
+ exit 1
+fi
+
+for tc in $TESTS; do
+ tcname=$(basename $tc)
+
+ if [ "$verbose" = "0" ]; then
+ logfile=logs/${tcname}.log
+ touch $logfile || logfile=/dev/null
+ $tc > $logfile 2>&1
+ else
+ $tc
+ fi
+
+ tres=$?
+ case $tres in
+ 0) echo "PASS: $tcname" ;;
+ 77) echo "SKIP: $tcname" ;;
+ *) echo "FAIL: $tcname"; res=1 ;;
+ esac
+done
+
+exit $res
diff --git a/meta-linaro/recipes-extra/odp/odp_v1.0.3.bb b/meta-linaro/recipes-extra/odp/odp_v1.0.3.bb
index fea51c81..c9124f0f 100644
--- a/meta-linaro/recipes-extra/odp/odp_v1.0.3.bb
+++ b/meta-linaro/recipes-extra/odp/odp_v1.0.3.bb
@@ -6,24 +6,38 @@ SECTION = "console/network"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4ccfa994aa96974cfcd39a59faee20a2"
-DEPENDS = "openssl"
+DEPENDS = "openssl cunit"
-SRC_URI = "git://git.linaro.org/lng/odp.git;name=odp"
+SRC_URI = "git://git.linaro.org/lng/odp.git;name=odp \
+ file://run-ptest"
SRCREV_odp = "1bc6f09703cfa1cb0cb6632af2106ed4238784b0"
SRCREV_FORMAT = "odp"
S = "${WORKDIR}/git"
-inherit autotools
+inherit autotools ptest
-RDEPENDS_${PN} = "bash libcrypto"
-
-#PACKAGECONFIG ?= "perf"
-#PACKAGECONFIG ?= "perf vald" NOTE: add 'vald' to above list and uncomment
-#the PACKAGECONFIG[vald] line below to enable cunit tests when available
PACKAGECONFIG[perf] = "--enable-test-perf,,,"
-#PACKAGECONFIG[vald] = "--enable-test-vald,,cunit,cunit"
-# ODP primary shipped as static library plus some API test and samples/
+do_configure_ptest() {
+ oe_runconf --enable-test-vald
+}
+
+do_compile_ptest() {
+ oe_runmake -C test/validation buildtest-TESTS
+}
+
+do_install_ptest() {
+ DESTDIR=${D}/${PTEST_PATH}/test/
+ oe_runmake -C test/validation install-binPROGRAMS \
+ BUILDDIR=${B} DESTDIR=${DESTDIR}
+ find ${DESTDIR} -type f -executable -exec mv -f {} ${DESTDIR} \;
+ rm -rf ${DESTDIR}/usr
+}
+
+# ODP is primarily shipped as static library plus some API test and samples/
FILES_${PN}-staticdev += "${datadir}/opendataplane/*.la"
+
+RDEPENDS_${PN} = "bash libcrypto"
+RDEPENDS_${PN}-ptest = "cunit"