aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-test/cmocka/cmocka_1.1.5.bb
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2020-09-28 07:15:59 -0700
committerKhem Raj <raj.khem@gmail.com>2020-09-28 09:17:18 -0700
commitf946444879576d8833493a27a22244530b8644d4 (patch)
treef37806e20a2fbe5f19e59f846e981b5a961fc4a9 /meta-oe/recipes-test/cmocka/cmocka_1.1.5.bb
parent916158a379a71062daa42606a87d5e04659ec157 (diff)
downloadmeta-openembedded-contrib-f946444879576d8833493a27a22244530b8644d4.tar.gz
meta-openembedded-contrib-f946444879576d8833493a27a22244530b8644d4.tar.bz2
meta-openembedded-contrib-f946444879576d8833493a27a22244530b8644d4.zip
cmocka: add recipe
includes ptest and bundling of examples that can be used for testing Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-test/cmocka/cmocka_1.1.5.bb')
-rw-r--r--meta-oe/recipes-test/cmocka/cmocka_1.1.5.bb39
1 files changed, 39 insertions, 0 deletions
diff --git a/meta-oe/recipes-test/cmocka/cmocka_1.1.5.bb b/meta-oe/recipes-test/cmocka/cmocka_1.1.5.bb
new file mode 100644
index 0000000000..5aee5ef931
--- /dev/null
+++ b/meta-oe/recipes-test/cmocka/cmocka_1.1.5.bb
@@ -0,0 +1,39 @@
+DESCRIPTION = "cmocka is an elegant unit testing framework for C with support for mock \
+objects. It only requires the standard C library, works on a range of computing \
+platforms (including embedded) and with different compilers."
+HOMEPAGE = "https://cmocka.org/"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+SRCREV = "56eb3a183fc222120f86d0c54fd033992c30135e"
+SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git \
+ file://run-ptest \
+ file://cmocka-uintptr_t.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit cmake ptest
+
+EXTRA_OECMAKE = "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=ON', '', d)}"
+
+do_install_append () {
+ install -d ${D}${datadir}/${BPN}/example
+ install -d ${D}${datadir}/${BPN}/example/mock/chef_wrap
+ install -d ${D}${datadir}/${BPN}/example/mock/uptime
+
+ install -m 0755 ${B}/example/*_test ${D}/${datadir}/${BPN}/example
+ install -m 0755 ${B}/example/mock/chef_wrap/waiter_test_wrap ${D}/${datadir}/${BPN}/example/mock/chef_wrap
+ install -m 0755 ${B}/example/mock/uptime/uptime ${D}/${datadir}/${BPN}/example/mock/uptime
+ install -m 0755 ${B}/example/mock/uptime/test_uptime ${D}/${datadir}/${BPN}/example/mock/uptime
+}
+
+do_install_ptest () {
+ install -d ${D}${PTEST_PATH}/tests
+ install -m 0755 ${B}/tests/test_* ${D}${PTEST_PATH}/tests
+}
+
+PACKAGE_BEFORE_PN += "${PN}-examples"
+
+FILES_${PN}-examples = "${datadir}/${BPN}/example"