* [ptxdist] [PATCH] cmocka: new package
@ 2019-11-29 9:11 Alexander Dahl
2019-12-05 15:19 ` Michael Olbrich
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Dahl @ 2019-11-29 9:11 UTC (permalink / raw)
To: ptxdist; +Cc: Alexander Dahl, Rouven Czerwinski
From: Alexander Dahl <ada@thorsis.com>
This adds the unit testing framework for C called 'cmocka'.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
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 <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_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 <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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ptxdist] [PATCH] cmocka: new package
2019-11-29 9:11 [ptxdist] [PATCH] cmocka: new package Alexander Dahl
@ 2019-12-05 15:19 ` Michael Olbrich
2019-12-05 21:42 ` Alexander Dahl
0 siblings, 1 reply; 5+ messages in thread
From: Michael Olbrich @ 2019-12-05 15:19 UTC (permalink / raw)
To: ptxdist; +Cc: Alexander Dahl, Rouven Czerwinski
On Fri, Nov 29, 2019 at 10:11:24AM +0100, Alexander Dahl wrote:
> From: Alexander Dahl <ada@thorsis.com>
>
> This adds the unit testing framework for C called 'cmocka'.
>
> Signed-off-by: Alexander Dahl <ada@thorsis.com>
> ---
> 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?
What kind of error do you get there?
Michael
> ---
> 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 <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_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_URL := https://cmocka.org/files/$(basename $(CMOCKA_VERSION))/$(CMOCKA).$(CMOCKA_SUFFIX)
Then you can just define CMOCKA_VERSION.
Michael
> +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
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ptxdist] [PATCH] cmocka: new package
2019-12-05 15:19 ` Michael Olbrich
@ 2019-12-05 21:42 ` Alexander Dahl
2019-12-06 10:16 ` Michael Olbrich
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Dahl @ 2019-12-05 21:42 UTC (permalink / raw)
To: ptxdist, Alexander Dahl, Rouven Czerwinski
[-- Attachment #1.1: Type: text/plain, Size: 6405 bytes --]
Hei hei,
seems I stumbled over some magic I was not aware of, see below.
On Thu, Dec 05, 2019 at 04:19:15PM +0100, Michael Olbrich wrote:
> On Fri, Nov 29, 2019 at 10:11:24AM +0100, Alexander Dahl wrote:
> > From: Alexander Dahl <ada@thorsis.com>
> >
> > This adds the unit testing framework for C called 'cmocka'.
> >
> > Signed-off-by: Alexander Dahl <ada@thorsis.com>
> > ---
> > 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?
>
> What kind of error do you get there?
I could solve the prepare stage. Seems like pkg-config behaves
differently depending on menuconfig settings in ptxdist? What I tried
first:
config OPENSC_TESTSUITE
bool "install testsuite"
depends on CMOCKA
This gets me the following in
..latform-v7a/build-target/OpenSC-0.19.0/config.log:
configure:15477: checking for cmocka >= 1.0.1
configure:15484: $PKG_CONFIG --exists --print-errors "cmocka >= 1.0.1"
arm-v7a-linux-gnueabihf-pkg-config: warning: blocking 'cmocka': not selected by 'opensc'
configure:15487: $? = 1
configure:15501: $PKG_CONFIG --exists --print-errors "cmocka >= 1.0.1"
arm-v7a-linux-gnueabihf-pkg-config: warning: blocking 'cmocka': not selected by 'opensc'
configure:15504: $? = 1
configure:15518: result: no
arm-v7a-linux-gnueabihf-pkg-config: warning: blocking 'cmocka': not selected by 'opensc'
I used the usual 'select CMOCKA if OPENSC_TESTSUITE' then, which
succeeds. Alas, I had to add another 'depends on OPENSC_OPENSSL'
there. I can send that patch along with a v2 series, beware it won't
build, because compilation fails then, because upstream OpenSC did not
put a header file they have in their git tree into their tarball …
> > ---
> > 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 <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_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_URL := https://cmocka.org/files/$(basename $(CMOCKA_VERSION))/$(CMOCKA).$(CMOCKA_SUFFIX)
>
> Then you can just define CMOCKA_VERSION.
Nice, that makes CMOCKA_VERSION := 1.1.5 possible, which is much more
readable. I'll put that into v2.
Alex
>
> Michael
>
> > +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
> >
>
> --
> Pengutronix e.K. | |
> Steuerwalder Str. 21 | http://www.pengutronix.de/ |
> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
--
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN | speech censured, the first thought forbidden, the
X AGAINST | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie)
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 92 bytes --]
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ptxdist] [PATCH] cmocka: new package
2019-12-05 21:42 ` Alexander Dahl
@ 2019-12-06 10:16 ` Michael Olbrich
2019-12-08 11:28 ` Alexander Dahl
0 siblings, 1 reply; 5+ messages in thread
From: Michael Olbrich @ 2019-12-06 10:16 UTC (permalink / raw)
To: ptxdist; +Cc: Alexander Dahl, Rouven Czerwinski
On Thu, Dec 05, 2019 at 10:42:54PM +0100, Alexander Dahl wrote:
> Hei hei,
>
> seems I stumbled over some magic I was not aware of, see below.
>
> On Thu, Dec 05, 2019 at 04:19:15PM +0100, Michael Olbrich wrote:
> > On Fri, Nov 29, 2019 at 10:11:24AM +0100, Alexander Dahl wrote:
> > > From: Alexander Dahl <ada@thorsis.com>
> > >
> > > This adds the unit testing framework for C called 'cmocka'.
> > >
> > > Signed-off-by: Alexander Dahl <ada@thorsis.com>
> > > ---
> > > 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?
> >
> > What kind of error do you get there?
>
> I could solve the prepare stage. Seems like pkg-config behaves
> differently depending on menuconfig settings in ptxdist? What I tried
> first:
>
> config OPENSC_TESTSUITE
> bool "install testsuite"
> depends on CMOCKA
>
> This gets me the following in
> ..latform-v7a/build-target/OpenSC-0.19.0/config.log:
>
> configure:15477: checking for cmocka >= 1.0.1
> configure:15484: $PKG_CONFIG --exists --print-errors "cmocka >= 1.0.1"
> arm-v7a-linux-gnueabihf-pkg-config: warning: blocking 'cmocka': not selected by 'opensc'
> configure:15487: $? = 1
> configure:15501: $PKG_CONFIG --exists --print-errors "cmocka >= 1.0.1"
> arm-v7a-linux-gnueabihf-pkg-config: warning: blocking 'cmocka': not selected by 'opensc'
> configure:15504: $? = 1
> configure:15518: result: no
> arm-v7a-linux-gnueabihf-pkg-config: warning: blocking 'cmocka': not selected by 'opensc'
This is expected. With just 'depends on CMOCKA' the build order is
undefined. So our pkg-configs wrapper explicitly blocks any packages
without explicit or implicit dependencies. This way, it always fails and
not just if opensc is built before cmocka.
> I used the usual 'select CMOCKA if OPENSC_TESTSUITE' then, which
> succeeds. Alas, I had to add another 'depends on OPENSC_OPENSSL'
> there. I can send that patch along with a v2 series, beware it won't
> build, because compilation fails then, because upstream OpenSC did not
> put a header file they have in their git tree into their tarball …
:-/
Michael
> > > ---
> > > 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 <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_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_URL := https://cmocka.org/files/$(basename $(CMOCKA_VERSION))/$(CMOCKA).$(CMOCKA_SUFFIX)
> >
> > Then you can just define CMOCKA_VERSION.
>
> Nice, that makes CMOCKA_VERSION := 1.1.5 possible, which is much more
> readable. I'll put that into v2.
>
> Alex
>
> >
> > Michael
> >
> > > +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
> > >
> >
> > --
> > Pengutronix e.K. | |
> > Steuerwalder Str. 21 | http://www.pengutronix.de/ |
> > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
> >
> > _______________________________________________
> > ptxdist mailing list
> > ptxdist@pengutronix.de
>
> --
> /"\ ASCII RIBBON | »With the first link, the chain is forged. The first
> \ / CAMPAIGN | speech censured, the first thought forbidden, the
> X AGAINST | first freedom denied, chains us all irrevocably.«
> / \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie)
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ptxdist] [PATCH] cmocka: new package
2019-12-06 10:16 ` Michael Olbrich
@ 2019-12-08 11:28 ` Alexander Dahl
0 siblings, 0 replies; 5+ messages in thread
From: Alexander Dahl @ 2019-12-08 11:28 UTC (permalink / raw)
To: ptxdist, Alexander Dahl, Rouven Czerwinski
[-- Attachment #1.1: Type: text/plain, Size: 3161 bytes --]
Hello,
On Fri, Dec 06, 2019 at 11:16:18AM +0100, Michael Olbrich wrote:
> On Thu, Dec 05, 2019 at 10:42:54PM +0100, Alexander Dahl wrote:
> > On Thu, Dec 05, 2019 at 04:19:15PM +0100, Michael Olbrich wrote:
> > > On Fri, Nov 29, 2019 at 10:11:24AM +0100, Alexander Dahl wrote:
> > > > From: Alexander Dahl <ada@thorsis.com>
> > > >
> > > > This adds the unit testing framework for C called 'cmocka'.
> > > >
> > > > Signed-off-by: Alexander Dahl <ada@thorsis.com>
> > > > ---
> > > > 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?
> > >
> > > What kind of error do you get there?
> >
> > I could solve the prepare stage. Seems like pkg-config behaves
> > differently depending on menuconfig settings in ptxdist? What I tried
> > first:
> >
> > config OPENSC_TESTSUITE
> > bool "install testsuite"
> > depends on CMOCKA
> >
> > This gets me the following in
> > ..latform-v7a/build-target/OpenSC-0.19.0/config.log:
> >
> > configure:15477: checking for cmocka >= 1.0.1
> > configure:15484: $PKG_CONFIG --exists --print-errors "cmocka >= 1.0.1"
> > arm-v7a-linux-gnueabihf-pkg-config: warning: blocking 'cmocka': not selected by 'opensc'
> > configure:15487: $? = 1
> > configure:15501: $PKG_CONFIG --exists --print-errors "cmocka >= 1.0.1"
> > arm-v7a-linux-gnueabihf-pkg-config: warning: blocking 'cmocka': not selected by 'opensc'
> > configure:15504: $? = 1
> > configure:15518: result: no
> > arm-v7a-linux-gnueabihf-pkg-config: warning: blocking 'cmocka': not selected by 'opensc'
>
> This is expected. With just 'depends on CMOCKA' the build order is
> undefined. So our pkg-configs wrapper explicitly blocks any packages
> without explicit or implicit dependencies. This way, it always fails and
> not just if opensc is built before cmocka.
>
> > I used the usual 'select CMOCKA if OPENSC_TESTSUITE' then, which
> > succeeds. Alas, I had to add another 'depends on OPENSC_OPENSSL'
> > there. I can send that patch along with a v2 series, beware it won't
> > build, because compilation fails then, because upstream OpenSC did not
> > put a header file they have in their git tree into their tarball …
>
> :-/
Out of curiosity I tried v0.20.0-rc4 and hat one builds successfully.
However I don't use that package by myself, so anyone else should test
that after OpenSC releases 0.20.0 eventually.
Other projects using CMocka: libssh, openvpn, samba, … maybe that
package authors also want to test it with CMocka by themselves then?
Greets
Alex
--
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN | speech censured, the first thought forbidden, the
X AGAINST | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie)
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 92 bytes --]
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-12-08 11:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-29 9:11 [ptxdist] [PATCH] cmocka: new package Alexander Dahl
2019-12-05 15:19 ` Michael Olbrich
2019-12-05 21:42 ` Alexander Dahl
2019-12-06 10:16 ` Michael Olbrich
2019-12-08 11:28 ` Alexander Dahl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox