mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl <post@lespocky.de>
To: ptxdist@pengutronix.de
Cc: Alexander Dahl <ada@thorsis.com>,
	Rouven Czerwinski <r.czerwinski@pengutronix.de>
Subject: [ptxdist] [PATCH v3 1/3] cmocka: new package
Date: Thu,  2 Jan 2020 22:36:23 +0100	[thread overview]
Message-ID: <20200102213625.24091-2-post@lespocky.de> (raw)
In-Reply-To: <20200102213625.24091-1-post@lespocky.de>

From: Alexander Dahl <ada@thorsis.com>

This adds the unit testing framework for C called 'cmocka'.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
---

Notes:
    v1 -> v2:
        * use make $(basename …) for building URL from VERSION

 rules/cmocka.in   | 13 ++++++++++
 rules/cmocka.make | 60 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 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..a25939bbe
--- /dev/null
+++ b/rules/cmocka.make
@@ -0,0 +1,60 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2019 by Alexander Dahl <ada@thorsis.com>
+#
+# 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_VERSION		:= 1.1.5
+CMOCKA_MD5		:= 91f95cd5db88b9b120d191b18d367193
+CMOCKA			:= cmocka-$(CMOCKA_VERSION)
+CMOCKA_SUFFIX		:= tar.xz
+CMOCKA_URL		:= https://cmocka.org/files/$(basename $(CMOCKA_VERSION))/$(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 <ada@thorsis.com>")
+	@$(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

  reply	other threads:[~2020-01-02 21:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02 21:36 [ptxdist] [PATCH v3 0/3] " Alexander Dahl
2020-01-02 21:36 ` Alexander Dahl [this message]
2020-01-02 21:36 ` [ptxdist] [PATCH v3 2/3] opensc: version bump 0.19.0 -> 0.20.0 Alexander Dahl
2020-01-06 16:04   ` Michael Olbrich
2020-01-02 21:36 ` [ptxdist] [PATCH v3 3/3] opensc: Reactivate testsuite option Alexander Dahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200102213625.24091-2-post@lespocky.de \
    --to=post@lespocky.de \
    --cc=ada@thorsis.com \
    --cc=ptxdist@pengutronix.de \
    --cc=r.czerwinski@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox