From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Alexander Dahl Date: Fri, 29 Nov 2019 10:11:24 +0100 Message-Id: <20191129091124.8652-1-post@lespocky.de> MIME-Version: 1.0 Subject: [ptxdist] [PATCH] cmocka: new package List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Alexander Dahl , Rouven Czerwinski From: Alexander Dahl This adds the unit testing framework for C called 'cmocka'. Signed-off-by: Alexander Dahl --- I tried modifying the opensc package for building its cmocka based tests, but autoconf could not find or interpret the pkg-config file provided by cmocka. Maybe someone else wants to look deeper into this? --- rules/cmocka.in | 13 ++++++++++ rules/cmocka.make | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 rules/cmocka.in create mode 100644 rules/cmocka.make diff --git a/rules/cmocka.in b/rules/cmocka.in new file mode 100644 index 000000000..d18cf00ff --- /dev/null +++ b/rules/cmocka.in @@ -0,0 +1,13 @@ +## SECTION=test_suites + +config CMOCKA + tristate + prompt "cmocka" + select HOST_CMAKE + help + 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. + +# vim: ft=kconfig noet tw=72 ts=8 sw=8 diff --git a/rules/cmocka.make b/rules/cmocka.make new file mode 100644 index 000000000..a4d25aece --- /dev/null +++ b/rules/cmocka.make @@ -0,0 +1,62 @@ +# -*-makefile-*- +# +# Copyright (C) 2019 by Alexander Dahl +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_CMOCKA) += cmocka + +# +# Paths and names +# +CMOCKA_VER_MINOR := 1.1 +CMOCKA_VER_PATCH := 5 +CMOCKA_VERSION := $(CMOCKA_VER_MINOR).$(CMOCKA_VER_PATCH) +CMOCKA_MD5 := 91f95cd5db88b9b120d191b18d367193 +CMOCKA := cmocka-$(CMOCKA_VERSION) +CMOCKA_SUFFIX := tar.xz +CMOCKA_URL := https://cmocka.org/files/$(CMOCKA_VER_MINOR)/$(CMOCKA).$(CMOCKA_SUFFIX) +CMOCKA_SOURCE := $(SRCDIR)/$(CMOCKA).$(CMOCKA_SUFFIX) +CMOCKA_DIR := $(BUILDDIR)/$(CMOCKA) +CMOCKA_LICENSE := Apache-2.0 +CMOCKA_LICENSE_FILES := file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57 + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +CMOCKA_CONF_TOOL := cmake +CMOCKA_CONF_OPT := \ + $(CROSS_CMAKE_USR) \ + -DBUILD_TESTING=OFF \ + -DPICKY_DEVELOPER:BOOL=OFF \ + -DUNIT_TESTING:BOOL=OFF \ + -DWITH_CMOCKERY_SUPPORT:BOOL=OFF \ + -DWITH_EXAMPLES:BOOL=OFF \ + -DWITH_STATIC_LIB=OFF + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/cmocka.targetinstall: + @$(call targetinfo) + + @$(call install_init, cmocka) + @$(call install_fixup, cmocka,PRIORITY,optional) + @$(call install_fixup, cmocka,SECTION,base) + @$(call install_fixup, cmocka,AUTHOR,"Alexander Dahl ") + @$(call install_fixup, cmocka,DESCRIPTION,missing) + + @$(call install_lib, cmocka, 0, 0, 0644, libcmocka) + + @$(call install_finish, cmocka) + + @$(call touch) + +# vim: ft=make noet tw=72 ts=8 sw=8 -- 2.20.1 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de