added my Recipes
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
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 = "a01cc69ee9536f90e57c61a198f2d1944d3d4313"
|
||||
PV .= "+git${SRCPV}"
|
||||
SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git;protocol=https;branch=stable-1.1 \
|
||||
file://0001-include-Check-for-previous-declaration-of-uintptr_t.patch \
|
||||
file://run-ptest \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit cmake ptest
|
||||
|
||||
EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=ON', '', d)}"
|
||||
# Use -Wl,wrap linker flag, which does not work with LTO
|
||||
LTO = ""
|
||||
|
||||
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
|
||||
install -m 0644 ${B}/example/mock/uptime/libproc_uptime.so ${D}/${datadir}/${BPN}/example/mock/libproc_uptime.so
|
||||
}
|
||||
|
||||
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"
|
||||
INSANE_SKIP:${PN}-examples = "libdir"
|
||||
@@ -0,0 +1,43 @@
|
||||
From a54e035f802e79e3292d8ad39a14bd7c060eb7b1 Mon Sep 17 00:00:00 2001
|
||||
From: Breno Leitao <breno.leitao@gmail.com>
|
||||
Date: Tue, 21 Mar 2023 21:58:28 -0700
|
||||
Subject: [PATCH] include: Check for previous declaration of uintptr_t
|
||||
|
||||
Adding a extra check before declaring uintptr_t. Currently musl uses
|
||||
macro __DEFINED_uintptr_t once it defines uintptr_t type. Checking
|
||||
this macro before defining it, and, defining it when uintptr_t is
|
||||
defined.
|
||||
|
||||
Taken from Alpine
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
include/cmocka.h | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/cmocka.h b/include/cmocka.h
|
||||
index a21d965..f540793 100644
|
||||
--- a/include/cmocka.h
|
||||
+++ b/include/cmocka.h
|
||||
@@ -121,7 +121,7 @@ typedef uintmax_t LargestIntegralType;
|
||||
((LargestIntegralType)(value))
|
||||
|
||||
/* Smallest integral type capable of holding a pointer. */
|
||||
-#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(HAVE_UINTPTR_T)
|
||||
+#if !defined(_UINTPTR_T) && !defined(_UINTPTR_T_DEFINED) && !defined(HAVE_UINTPTR_T) && !defined(__DEFINED_uintptr_t)
|
||||
# if defined(_WIN32)
|
||||
/* WIN32 is an ILP32 platform */
|
||||
typedef unsigned int uintptr_t;
|
||||
@@ -147,6 +147,7 @@ typedef uintmax_t LargestIntegralType;
|
||||
|
||||
# define _UINTPTR_T
|
||||
# define _UINTPTR_T_DEFINED
|
||||
+# define __DEFINED_uintptr_t
|
||||
#endif /* !defined(_UINTPTR_T) || !defined(_UINTPTR_T_DEFINED) */
|
||||
|
||||
/* Perform an unsigned cast to uintptr_t. */
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd tests
|
||||
for i in `ls *`; do
|
||||
if [ ./$i ] ; then
|
||||
echo "PASS: $i"
|
||||
else
|
||||
echo "FAIL: $i"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user