xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-test/cmocka/cmocka_1.1.5.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunDESCRIPTION = "cmocka is an elegant unit testing framework for C with support for mock \
2*4882a593Smuzhiyunobjects. It only requires the standard C library, works on a range of computing \
3*4882a593Smuzhiyunplatforms (including embedded) and with different compilers."
4*4882a593SmuzhiyunHOMEPAGE = "https://cmocka.org/"
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunLICENSE = "Apache-2.0"
7*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunSRCREV = "a4fc3dd7705c277e3a57432895e9852ea105dac9"
10*4882a593SmuzhiyunPV .= "+git${SRCPV}"
11*4882a593SmuzhiyunSRC_URI = "git://git.cryptomilk.org/projects/cmocka.git;protocol=https;branch=master \
12*4882a593Smuzhiyun           file://run-ptest \
13*4882a593Smuzhiyun          "
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunS = "${WORKDIR}/git"
16*4882a593Smuzhiyun
17*4882a593Smuzhiyuninherit cmake ptest
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunEXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=ON', '', d)}"
20*4882a593Smuzhiyun# Use -Wl,wrap linker flag, which does not work with LTO
21*4882a593SmuzhiyunLTO = ""
22*4882a593Smuzhiyun
23*4882a593Smuzhiyundo_install:append () {
24*4882a593Smuzhiyun    install -d ${D}${datadir}/${BPN}/example
25*4882a593Smuzhiyun    install -d ${D}${datadir}/${BPN}/example/mock/chef_wrap
26*4882a593Smuzhiyun    install -d ${D}${datadir}/${BPN}/example/mock/uptime
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun    install -m 0755 ${B}/example/*_test ${D}/${datadir}/${BPN}/example
29*4882a593Smuzhiyun    install -m 0755 ${B}/example/mock/chef_wrap/waiter_test_wrap ${D}/${datadir}/${BPN}/example/mock/chef_wrap
30*4882a593Smuzhiyun    install -m 0755 ${B}/example/mock/uptime/uptime ${D}/${datadir}/${BPN}/example/mock/uptime
31*4882a593Smuzhiyun    install -m 0755 ${B}/example/mock/uptime/test_uptime ${D}/${datadir}/${BPN}/example/mock/uptime
32*4882a593Smuzhiyun    install -m 0644 ${B}/example/mock/uptime/libproc_uptime.so ${D}/${datadir}/${BPN}/example/mock/libproc_uptime.so
33*4882a593Smuzhiyun}
34*4882a593Smuzhiyun
35*4882a593Smuzhiyundo_install_ptest () {
36*4882a593Smuzhiyun    install -d ${D}${PTEST_PATH}/tests
37*4882a593Smuzhiyun    install -m 0755 ${B}/tests/test_* ${D}${PTEST_PATH}/tests
38*4882a593Smuzhiyun}
39*4882a593Smuzhiyun
40*4882a593SmuzhiyunPACKAGE_BEFORE_PN += "${PN}-examples"
41*4882a593Smuzhiyun
42*4882a593SmuzhiyunFILES:${PN}-examples = "${datadir}/${BPN}/example"
43*4882a593SmuzhiyunINSANE_SKIP:${PN}-examples = "libdir"
44