Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] dbus-glib: support unit tests compile and install
@ 2012-07-13 20:08 Yao Zhao
  0 siblings, 0 replies; 3+ messages in thread
From: Yao Zhao @ 2012-07-13 20:08 UTC (permalink / raw)
  To: openembedded-core

test-service-glib-include-glib-only.patch: fixes the compiling failure
that test-service-glib.c includes glib/gquark.h not glib.h directly.

test-install-makefile.patch: install unit tests for test purpose

dbus-glib.inc: default turn off unit test as libdbus-glib-1.so.2.2.2 will
have unit test code if DBUS_BUILD_TESTS enabled.

Add tests and tests-dbg package.

Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
---
 .../dbus-glib-0.98/test-install-makefile.patch     |   42 ++++++++++++++++++++
 .../test-service-glib-include-glib-only.patch      |   13 ++++++
 meta/recipes-core/dbus/dbus-glib.inc               |   15 ++++++-
 3 files changed, 68 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/dbus/dbus-glib-0.98/test-install-makefile.patch
 create mode 100644 meta/recipes-core/dbus/dbus-glib-0.98/test-service-glib-include-glib-only.patch

diff --git a/meta/recipes-core/dbus/dbus-glib-0.98/test-install-makefile.patch b/meta/recipes-core/dbus/dbus-glib-0.98/test-install-makefile.patch
new file mode 100644
index 0000000..2a085ec
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib-0.98/test-install-makefile.patch
@@ -0,0 +1,42 @@
+diff --git a/test/Makefile.am b/test/Makefile.am
+index 7ba11a8..e1e56fd 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -13,7 +13,8 @@ else
+ TEST_BINARIES=
+ endif
+ 
+-noinst_PROGRAMS= $(TEST_BINARIES)
++testdir = /opt/@PACKAGE@-tests
++test_PROGRAMS= $(TEST_BINARIES)
+ 
+ test_service_SOURCES=				\
+ 	test-service.c
+diff --git a/test/core/Makefile.am b/test/core/Makefile.am
+index ef6cb26..3bef634 100644
+--- a/test/core/Makefile.am
++++ b/test/core/Makefile.am
+@@ -46,7 +46,8 @@ endif
+ 
+ ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
+ ## build even when not doing "make check"
+-noinst_PROGRAMS = \
++testdir = /opt/@PACKAGE@-tests/core
++test_PROGRAMS = \
+ 	test-dbus-glib \
+ 	test-service-glib \
+ 	$(THREAD_APPS) \
+diff --git a/test/interfaces/Makefile.am b/test/interfaces/Makefile.am
+index 3cb2c39..8ea9c4e 100644
+--- a/test/interfaces/Makefile.am
++++ b/test/interfaces/Makefile.am
+@@ -39,7 +39,8 @@ if DBUS_BUILD_TESTS
+ 
+ ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
+ ## build even when not doing "make check"
+-noinst_PROGRAMS = test-service test-client
++testdir = /opt/@PACKAGE@-tests/interfaces
++test_PROGRAMS = test-service test-client
+ 
+ test_service_SOURCES = \
+ 	test-interfaces.c \
diff --git a/meta/recipes-core/dbus/dbus-glib-0.98/test-service-glib-include-glib-only.patch b/meta/recipes-core/dbus/dbus-glib-0.98/test-service-glib-include-glib-only.patch
new file mode 100644
index 0000000..e0bc0c6
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib-0.98/test-service-glib-include-glib-only.patch
@@ -0,0 +1,13 @@
+diff --git a/test/core/test-service-glib.c b/test/core/test-service-glib.c
+index 3355890..7291f35 100644
+--- a/test/core/test-service-glib.c
++++ b/test/core/test-service-glib.c
+@@ -11,7 +11,7 @@
+ #include <string.h>
+ #include <glib/gi18n.h>
+ #include <glib-object.h>
+-#include <glib/gquark.h>
++#include <glib.h>
+ 
+ #include "my-object.h"
+ #include "my-object-subclass.h"
diff --git a/meta/recipes-core/dbus/dbus-glib.inc b/meta/recipes-core/dbus/dbus-glib.inc
index da2845a..6e116d2 100644
--- a/meta/recipes-core/dbus/dbus-glib.inc
+++ b/meta/recipes-core/dbus/dbus-glib.inc
@@ -11,15 +11,20 @@ DEPENDS = "expat glib-2.0 virtual/libintl dbus-glib-native dbus"
 DEPENDS_virtclass-native = "glib-2.0-native dbus-native"
 
 SRC_URI = "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-${PV}.tar.gz \
-           file://no-examples.patch"
+           file://no-examples.patch \
+           file://test-service-glib-include-glib-only.patch \
+           file://test-install-makefile.patch \
+"
 
 inherit autotools pkgconfig gettext
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[tests] = "--enable-tests,,,"
 
 EXTRA_OECONF = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml \
                 --with-dbus-binding-tool=${STAGING_BINDIR_NATIVE}/dbus-binding-tool"
 EXTRA_OECONF_virtclass-native = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml"
 
-PACKAGES += "${PN}-bash-completion"
+PACKAGES += "${PN}-bash-completion ${PN}-tests-dbg ${PN}-tests"
 
 FILES_${PN} = "${libdir}/lib*${SOLIBS}"
 FILES_${PN}-bash-completion = "${sysconfdir}/bash_completion.d/dbus-bash-completion.sh \
@@ -27,4 +32,10 @@ FILES_${PN}-bash-completion = "${sysconfdir}/bash_completion.d/dbus-bash-complet
 FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
 FILES_${PN}-dev += "${bindir}/dbus-binding-tool"
 
+RDEPENDS_${PN}-tests += "dbus-x11"
+FILES_${PN}-tests = "/opt/${PN}-tests"
+FILES_${PN}-tests-dbg = "/opt/${PN}-tests/.debug/* \
+                         /opt/${PN}-tests/core/.debug/* \
+                         /opt/${PN}-tests/interfaces/.debug/*"
+
 BBCLASSEXTEND = "native"
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] dbus-glib: support unit tests compile and install
@ 2012-07-13 20:49 Yao Zhao
  2012-07-16 10:28 ` Burton, Ross
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Zhao @ 2012-07-13 20:49 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 4992 bytes --]

test-service-glib-include-glib-only.patch: fixes the compiling failure
that test-service-glib.c includes glib/gquark.h not glib.h directly.

test-install-makefile.patch: install unit tests for test purpose

dbus-glib.inc: default turn off unit test as libdbus-glib-1.so.2.2.2 will
have unit test code if DBUS_BUILD_TESTS enabled.

Add tests and tests-dbg package.

Signed-off-by: Yao Zhao<yao.zhao@windriver.com>
---
  .../dbus-glib-0.98/test-install-makefile.patch     |   42 ++++++++++++++++++++
  .../test-service-glib-include-glib-only.patch      |   13 ++++++
  meta/recipes-core/dbus/dbus-glib.inc               |   15 ++++++-
  3 files changed, 68 insertions(+), 2 deletions(-)
  create mode 100644 meta/recipes-core/dbus/dbus-glib-0.98/test-install-makefile.patch
  create mode 100644 meta/recipes-core/dbus/dbus-glib-0.98/test-service-glib-include-glib-only.patch

diff --git a/meta/recipes-core/dbus/dbus-glib-0.98/test-install-makefile.patch b/meta/recipes-core/dbus/dbus-glib-0.98/test-install-makefile.patch
new file mode 100644
index 0000000..2a085ec
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib-0.98/test-install-makefile.patch
@@ -0,0 +1,42 @@
+diff --git a/test/Makefile.am b/test/Makefile.am
+index 7ba11a8..e1e56fd 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -13,7 +13,8 @@ else
+ TEST_BINARIES=
+ endif
+
+-noinst_PROGRAMS= $(TEST_BINARIES)
++testdir =/opt/@PACKAGE@-tests
++test_PROGRAMS= $(TEST_BINARIES)
+
+ test_service_SOURCES=				\
+ 	test-service.c
+diff --git a/test/core/Makefile.am b/test/core/Makefile.am
+index ef6cb26..3bef634 100644
+--- a/test/core/Makefile.am
++++ b/test/core/Makefile.am
+@@ -46,7 +46,8 @@ endif
+
+ ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
+ ## build even when not doing "make check"
+-noinst_PROGRAMS = \
++testdir =/opt/@PACKAGE@-tests/core
++test_PROGRAMS = \
+ 	test-dbus-glib \
+ 	test-service-glib \
+ 	$(THREAD_APPS) \
+diff --git a/test/interfaces/Makefile.am b/test/interfaces/Makefile.am
+index 3cb2c39..8ea9c4e 100644
+--- a/test/interfaces/Makefile.am
++++ b/test/interfaces/Makefile.am
+@@ -39,7 +39,8 @@ if DBUS_BUILD_TESTS
+
+ ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
+ ## build even when not doing "make check"
+-noinst_PROGRAMS = test-service test-client
++testdir =/opt/@PACKAGE@-tests/interfaces
++test_PROGRAMS = test-service test-client
+
+ test_service_SOURCES = \
+ 	test-interfaces.c \
diff --git a/meta/recipes-core/dbus/dbus-glib-0.98/test-service-glib-include-glib-only.patch b/meta/recipes-core/dbus/dbus-glib-0.98/test-service-glib-include-glib-only.patch
new file mode 100644
index 0000000..e0bc0c6
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib-0.98/test-service-glib-include-glib-only.patch
@@ -0,0 +1,13 @@
+diff --git a/test/core/test-service-glib.c b/test/core/test-service-glib.c
+index 3355890..7291f35 100644
+--- a/test/core/test-service-glib.c
++++ b/test/core/test-service-glib.c
+@@ -11,7 +11,7 @@
+ #include <string.h>
+ #include <glib/gi18n.h>
+ #include <glib-object.h>
+-#include <glib/gquark.h>
++#include <glib.h>
+
+ #include "my-object.h"
+ #include "my-object-subclass.h"
diff --git a/meta/recipes-core/dbus/dbus-glib.inc b/meta/recipes-core/dbus/dbus-glib.inc
index da2845a..6e116d2 100644
--- a/meta/recipes-core/dbus/dbus-glib.inc
+++ b/meta/recipes-core/dbus/dbus-glib.inc
@@ -11,15 +11,20 @@ DEPENDS = "expat glib-2.0 virtual/libintl dbus-glib-native dbus"
  DEPENDS_virtclass-native = "glib-2.0-native dbus-native"
  
  SRC_URI = "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-${PV}.tar.gz \
-file://no-examples.patch"
+file://no-examples.patch  \
+file://test-service-glib-include-glib-only.patch  \
+file://test-install-makefile.patch  \
+"
  
  inherit autotools pkgconfig gettext
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[tests] = "--enable-tests,,,"
  
  EXTRA_OECONF = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml \
                  --with-dbus-binding-tool=${STAGING_BINDIR_NATIVE}/dbus-binding-tool"
  EXTRA_OECONF_virtclass-native = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml"
  
-PACKAGES += "${PN}-bash-completion"
+PACKAGES += "${PN}-bash-completion ${PN}-tests-dbg ${PN}-tests"
  
  FILES_${PN} = "${libdir}/lib*${SOLIBS}"
  FILES_${PN}-bash-completion = "${sysconfdir}/bash_completion.d/dbus-bash-completion.sh \
@@ -27,4 +32,10 @@ FILES_${PN}-bash-completion = "${sysconfdir}/bash_completion.d/dbus-bash-complet
  FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
  FILES_${PN}-dev += "${bindir}/dbus-binding-tool"
  
+RDEPENDS_${PN}-tests += "dbus-x11"
+FILES_${PN}-tests = "/opt/${PN}-tests"
+FILES_${PN}-tests-dbg = "/opt/${PN}-tests/.debug/* \
+/opt/${PN}-tests/core/.debug/* \
+/opt/${PN}-tests/interfaces/.debug/*"
+
  BBCLASSEXTEND = "native"
-- 1.7.9.5


[-- Attachment #2: Type: text/html, Size: 6488 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dbus-glib: support unit tests compile and install
  2012-07-13 20:49 [PATCH] dbus-glib: support unit tests compile and install Yao Zhao
@ 2012-07-16 10:28 ` Burton, Ross
  0 siblings, 0 replies; 3+ messages in thread
From: Burton, Ross @ 2012-07-16 10:28 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 13 July 2012 21:49, Yao Zhao <yao.zhao@windriver.com> wrote:
> +-noinst_PROGRAMS= $(TEST_BINARIES)
> ++testdir = /opt/@PACKAGE@-tests
> ++test_PROGRAMS= $(TEST_BINARIES)

/opt is not for package-managed files, please install into /usr/ somewhere.

> +PACKAGECONFIG ??= ""
> +PACKAGECONFIG[tests] = "--enable-tests,,,"

It took me a while to figure out that the -tests packages will be
dropped as they are empty by default, and I presume your intention is
that people who want the tests can set
PACKAGECONFIG_pn-dbus-glib="tests" in a configuration file somewhere.

A little documentation inline would be very useful.

Probably worth splitting the gquark compile fix out as a separate commit too.

Ross



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-16 10:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-13 20:49 [PATCH] dbus-glib: support unit tests compile and install Yao Zhao
2012-07-16 10:28 ` Burton, Ross
  -- strict thread matches above, loose matches on Subject: below --
2012-07-13 20:08 Yao Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox