blob: 44077a0d3597968a93a70247a3e9f21cb7875b44 [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 Geisslerfc113ea2023-03-31 09:59:46 -05009SRCREV = "a01cc69ee9536f90e57c61a198f2d1944d3d4313"
Andrew Geissler4b7c1152020-11-30 19:55:29 -060010PV .= "+git${SRCPV}"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050011SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git;protocol=https;branch=stable-1.1 \
12 file://0001-include-Check-for-previous-declaration-of-uintptr_t.patch \
Andrew Geisslera2681d92020-10-16 10:17:07 -050013 file://run-ptest \
Andrew Geisslera2681d92020-10-16 10:17:07 -050014 "
15
16S = "${WORKDIR}/git"
17
18inherit cmake ptest
19
Andrew Geissler4b7c1152020-11-30 19:55:29 -060020EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=ON', '', d)}"
21# Use -Wl,wrap linker flag, which does not work with LTO
22LTO = ""
Andrew Geisslera2681d92020-10-16 10:17:07 -050023
Patrick Williams213cb262021-08-07 19:21:33 -050024do_install:append () {
Andrew Geisslera2681d92020-10-16 10:17:07 -050025 install -d ${D}${datadir}/${BPN}/example
26 install -d ${D}${datadir}/${BPN}/example/mock/chef_wrap
27 install -d ${D}${datadir}/${BPN}/example/mock/uptime
28
29 install -m 0755 ${B}/example/*_test ${D}/${datadir}/${BPN}/example
30 install -m 0755 ${B}/example/mock/chef_wrap/waiter_test_wrap ${D}/${datadir}/${BPN}/example/mock/chef_wrap
31 install -m 0755 ${B}/example/mock/uptime/uptime ${D}/${datadir}/${BPN}/example/mock/uptime
32 install -m 0755 ${B}/example/mock/uptime/test_uptime ${D}/${datadir}/${BPN}/example/mock/uptime
Andrew Geissler4b7c1152020-11-30 19:55:29 -060033 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 -050034}
35
36do_install_ptest () {
37 install -d ${D}${PTEST_PATH}/tests
38 install -m 0755 ${B}/tests/test_* ${D}${PTEST_PATH}/tests
39}
40
41PACKAGE_BEFORE_PN += "${PN}-examples"
42
Patrick Williams213cb262021-08-07 19:21:33 -050043FILES:${PN}-examples = "${datadir}/${BPN}/example"
44INSANE_SKIP:${PN}-examples = "libdir"