aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-test/cmocka/cmocka_1.1.5.bb
blob: 5aee5ef931038204680f56d162234cfe0b0850bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
DESCRIPTION = "cmocka is an elegant unit testing framework for C with support for mock \
objects. It only requires the standard C library, works on a range of computing \
platforms (including embedded) and with different compilers."
HOMEPAGE = "https://cmocka.org/"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"

SRCREV = "56eb3a183fc222120f86d0c54fd033992c30135e"
SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git \
           file://run-ptest \
           file://cmocka-uintptr_t.patch \
          "

S = "${WORKDIR}/git"

inherit cmake ptest

EXTRA_OECMAKE = "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=ON', '', d)}"

do_install_append () {
    install -d ${D}${datadir}/${BPN}/example
    install -d ${D}${datadir}/${BPN}/example/mock/chef_wrap
    install -d ${D}${datadir}/${BPN}/example/mock/uptime

    install -m 0755 ${B}/example/*_test ${D}/${datadir}/${BPN}/example
    install -m 0755 ${B}/example/mock/chef_wrap/waiter_test_wrap ${D}/${datadir}/${BPN}/example/mock/chef_wrap
    install -m 0755 ${B}/example/mock/uptime/uptime ${D}/${datadir}/${BPN}/example/mock/uptime
    install -m 0755 ${B}/example/mock/uptime/test_uptime ${D}/${datadir}/${BPN}/example/mock/uptime
}

do_install_ptest () {
    install -d ${D}${PTEST_PATH}/tests
    install -m 0755 ${B}/tests/test_* ${D}${PTEST_PATH}/tests
}

PACKAGE_BEFORE_PN += "${PN}-examples"

FILES_${PN}-examples = "${datadir}/${BPN}/example"