Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 1 | DESCRIPTION = "cmocka is an elegant unit testing framework for C with support for mock \ |
| 2 | objects. It only requires the standard C library, works on a range of computing \ |
| 3 | platforms (including embedded) and with different compilers." |
| 4 | HOMEPAGE = "https://cmocka.org/" |
| 5 | |
| 6 | LICENSE = "Apache-2.0" |
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" |
| 8 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 9 | SRCREV = "a01cc69ee9536f90e57c61a198f2d1944d3d4313" |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 10 | PV .= "+git${SRCPV}" |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 11 | SRC_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 Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 13 | file://run-ptest \ |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 14 | " |
| 15 | |
| 16 | S = "${WORKDIR}/git" |
| 17 | |
| 18 | inherit cmake ptest |
| 19 | |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 20 | EXTRA_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 |
| 22 | LTO = "" |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 23 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 24 | do_install:append () { |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 25 | 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 Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 33 | install -m 0644 ${B}/example/mock/uptime/libproc_uptime.so ${D}/${datadir}/${BPN}/example/mock/libproc_uptime.so |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | do_install_ptest () { |
| 37 | install -d ${D}${PTEST_PATH}/tests |
| 38 | install -m 0755 ${B}/tests/test_* ${D}${PTEST_PATH}/tests |
| 39 | } |
| 40 | |
| 41 | PACKAGE_BEFORE_PN += "${PN}-examples" |
| 42 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 43 | FILES:${PN}-examples = "${datadir}/${BPN}/example" |
| 44 | INSANE_SKIP:${PN}-examples = "libdir" |