blob: 554d582a57d1599e2012d835ddafdc2ade48930b [file] [log] [blame]
Andrew Geisslera2681d92020-10-16 10:17:07 -05001DESCRIPTION = "cmocka is an elegant unit testing framework for C with support for mock \
2objects. It only requires the standard C library, works on a range of computing \
3platforms (including embedded) and with different compilers."
4HOMEPAGE = "https://cmocka.org/"
5
6LICENSE = "Apache-2.0"
7LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
8
Andrew Geissler4b7c1152020-11-30 19:55:29 -06009SRCREV = "a4fc3dd7705c277e3a57432895e9852ea105dac9"
10PV .= "+git${SRCPV}"
Andrew Geissler595f6302022-01-24 19:11:47 +000011SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git;protocol=https;branch=master \
Andrew Geisslera2681d92020-10-16 10:17:07 -050012 file://run-ptest \
Andrew Geisslera2681d92020-10-16 10:17:07 -050013 "
14
15S = "${WORKDIR}/git"
16
17inherit cmake ptest
18
Andrew Geissler4b7c1152020-11-30 19:55:29 -060019EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=ON', '', d)}"
20# Use -Wl,wrap linker flag, which does not work with LTO
21LTO = ""
Andrew Geisslera2681d92020-10-16 10:17:07 -050022
Patrick Williams213cb262021-08-07 19:21:33 -050023do_install:append () {
Andrew Geisslera2681d92020-10-16 10:17:07 -050024 install -d ${D}${datadir}/${BPN}/example
25 install -d ${D}${datadir}/${BPN}/example/mock/chef_wrap
26 install -d ${D}${datadir}/${BPN}/example/mock/uptime
27
28 install -m 0755 ${B}/example/*_test ${D}/${datadir}/${BPN}/example
29 install -m 0755 ${B}/example/mock/chef_wrap/waiter_test_wrap ${D}/${datadir}/${BPN}/example/mock/chef_wrap
30 install -m 0755 ${B}/example/mock/uptime/uptime ${D}/${datadir}/${BPN}/example/mock/uptime
31 install -m 0755 ${B}/example/mock/uptime/test_uptime ${D}/${datadir}/${BPN}/example/mock/uptime
Andrew Geissler4b7c1152020-11-30 19:55:29 -060032 install -m 0644 ${B}/example/mock/uptime/libproc_uptime.so ${D}/${datadir}/${BPN}/example/mock/libproc_uptime.so
Andrew Geisslera2681d92020-10-16 10:17:07 -050033}
34
35do_install_ptest () {
36 install -d ${D}${PTEST_PATH}/tests
37 install -m 0755 ${B}/tests/test_* ${D}${PTEST_PATH}/tests
38}
39
40PACKAGE_BEFORE_PN += "${PN}-examples"
41
Patrick Williams213cb262021-08-07 19:21:33 -050042FILES:${PN}-examples = "${datadir}/${BPN}/example"
43INSANE_SKIP:${PN}-examples = "libdir"