aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"