summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSakib Sajal <sakib.sajal@windriver.com>2020-07-09 15:43:15 -0400
committerKhem Raj <raj.khem@gmail.com>2020-07-09 17:03:24 -0700
commit27ec5216af1ce6f76fcee2c8dbefb9c23df66dba (patch)
tree48e5dbaa1fdd0bb91051dd78228872a7e2a86180
parent9019ceb2ccfd32789b7bc680269b3af234ebd397 (diff)
downloadmeta-openembedded-27ec5216af1ce6f76fcee2c8dbefb9c23df66dba.tar.gz
cunit: add ptest
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-test/cunit/cunit_2.1-3.bb18
-rw-r--r--meta-oe/recipes-test/cunit/files/run-ptest19
2 files changed, 35 insertions, 2 deletions
diff --git a/meta-oe/recipes-test/cunit/cunit_2.1-3.bb b/meta-oe/recipes-test/cunit/cunit_2.1-3.bb
index babf8048ab..c877d3bf1c 100644
--- a/meta-oe/recipes-test/cunit/cunit_2.1-3.bb
+++ b/meta-oe/recipes-test/cunit/cunit_2.1-3.bb
@@ -7,16 +7,30 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7734aa853b85d6f935466f081490ddbb"
7S = "${WORKDIR}/CUnit-${PV}" 7S = "${WORKDIR}/CUnit-${PV}"
8 8
9SRC_URI = "${SOURCEFORGE_MIRROR}/project/cunit/CUnit/${PV}/CUnit-${PV}.tar.bz2 \ 9SRC_URI = "${SOURCEFORGE_MIRROR}/project/cunit/CUnit/${PV}/CUnit-${PV}.tar.bz2 \
10 file://fixup-install-docdir.patch" 10 file://fixup-install-docdir.patch \
11 file://run-ptest \
12 "
11SRC_URI[md5sum] = "b5f1a9f6093869c070c6e4a9450cc10c" 13SRC_URI[md5sum] = "b5f1a9f6093869c070c6e4a9450cc10c"
12SRC_URI[sha256sum] = "f5b29137f845bb08b77ec60584fdb728b4e58f1023e6f249a464efa49a40f214" 14SRC_URI[sha256sum] = "f5b29137f845bb08b77ec60584fdb728b4e58f1023e6f249a464efa49a40f214"
13 15
14UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/cunit/files/releases" 16UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/cunit/files/releases"
15 17
16inherit autotools-brokensep remove-libtool 18inherit autotools-brokensep remove-libtool ptest
17 19
18EXTRA_OECONF = "--enable-memtrace --enable-automated --enable-basic --enable-console" 20EXTRA_OECONF = "--enable-memtrace --enable-automated --enable-basic --enable-console"
19 21
22TESTBIN = "/CUnit/Sources/Test/test_cunit"
23
24PACKAGECONFIG ?= "${@bb.utils.contains('PTEST_ENABLED', '1', 'test','', d)} \
25 "
26
27PACKAGECONFIG[test] = "--enable-test,,,"
28
29do_install_ptest() {
30 install -d ${D}${PTEST_PATH}/tests
31 install -m 0755 ${S}${TESTBIN} ${D}${PTEST_PATH}/tests/
32}
33
20FILES_${PN}-dev += "${datadir}/CUnit" 34FILES_${PN}-dev += "${datadir}/CUnit"
21FILES_${PN}-doc += "${docdir}" 35FILES_${PN}-doc += "${docdir}"
22 36
diff --git a/meta-oe/recipes-test/cunit/files/run-ptest b/meta-oe/recipes-test/cunit/files/run-ptest
new file mode 100644
index 0000000000..903c8c8d95
--- /dev/null
+++ b/meta-oe/recipes-test/cunit/files/run-ptest
@@ -0,0 +1,19 @@
1#!/bin/sh
2
3ptestdir=$(dirname "$(readlink -f "$0")")
4cd $ptestdir/tests
5./test_cunit > cunit_test_out.tmp
6
7echo "--- Test output ---"
8cat cunit_test_out.tmp
9echo ""
10echo "--- ptest result ---"
11
12grep "Failures: 0" cunit_test_out.tmp > /dev/null
13if [ $? -eq 0 ]; then
14 echo "PASS: cunit"
15else
16 echo "FAIL: cunit"
17fi
18
19rm -f cunit_test_out.tmp