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 | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 9 | SRCREV = "a4fc3dd7705c277e3a57432895e9852ea105dac9" |
| 10 | PV .= "+git${SRCPV}" |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 11 | SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git \ |
| 12 | file://run-ptest \ |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 13 | " |
| 14 | |
| 15 | S = "${WORKDIR}/git" |
| 16 | |
| 17 | inherit cmake ptest |
| 18 | |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 19 | EXTRA_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 |
| 21 | LTO = "" |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 22 | |
| 23 | do_install_append () { |
| 24 | 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 Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 32 | 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] | 33 | } |
| 34 | |
| 35 | do_install_ptest () { |
| 36 | install -d ${D}${PTEST_PATH}/tests |
| 37 | install -m 0755 ${B}/tests/test_* ${D}${PTEST_PATH}/tests |
| 38 | } |
| 39 | |
| 40 | PACKAGE_BEFORE_PN += "${PN}-examples" |
| 41 | |
| 42 | FILES_${PN}-examples = "${datadir}/${BPN}/example" |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 43 | INSANE_SKIP_${PN}-examples = "libdir" |