Package: pygobject Version: 2.28.0-2 Tags: patch User: [email protected] Usertags: origin-ubuntu ubuntu-patch natty
Hello, currently pygobject calls the upstream test suite during package build, but it fails badly due to various reasons. As the entire GI thing is still very much in flux, and I love tests in general, I worked on making the test runs more useful. With attached patch, when building under current Ubuntu Natty I get all tests passed in all four build flavours; under sid/experimental I have afew failures, as we still need some catch-up (I might also miss some newer versions from experimental). Therefore I kept test failures as non-fatal for now. Once they work, I think we should make them fatal, though, to avoid architecture specific regressions, etc. Thanks for considering, Martin -- Martin Pitt | http://www.piware.de Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
diff -Nru pygobject-2.28.0/debian/changelog pygobject-2.28.0/debian/changelog --- pygobject-2.28.0/debian/changelog 2011-03-22 09:34:49.000000000 +0100 +++ pygobject-2.28.0/debian/changelog 2011-03-22 15:42:42.000000000 +0100 @@ -1,3 +1,27 @@ +pygobject (2.28.0-3pitti1) experimental; urgency=low + + * Fix test suite calls during package build: + - debian/rules: Copy Python files from our modules into build tree, so + that the tests actually find them. In Python you can't have Python + modules and compiled extensions which belong to the same import in + different directories. (Unfortunately it's hard to upstream this, so + keep it as a Debian specific hack for now.) + - debian/rules: Run the tests under xvfb so that the Gdk/Gtk ones can + succeed. + - debian/rules: Disable fakeroot for the tests by unsetting $LD_PRELOAD. + Otherwise the tests try to connect to root's session D-BUS. + - Add 50_gio_tests_for_separate_build_tree.patch, + 51_gschema_tests_for_separate_build_tree.patch: Various fixes to allow + the tests to succeed with a separate build tree. Also committed into + upstream git. + - 99_autoreconf.patch: Refreshed to pick up changes from above patches. + - debian/control.in: Add build dependencies: xvfb (as we now use it in + debian/rules), dbus-x11 (as the test suite uses dbus-launch), and + python-apt-dbg/python-cairo-dbg, so that the test cases for the debug + builds have all dependencies met. + + -- Martin Pitt <[email protected]> Tue, 22 Mar 2011 11:40:55 +0100 + pygobject (2.28.0-3) experimental; urgency=low * debian/rules: Move from pysupport (which is being deprecated) to diff -Nru pygobject-2.28.0/debian/control pygobject-2.28.0/debian/control --- pygobject-2.28.0/debian/control 2011-03-22 10:10:55.000000000 +0100 +++ pygobject-2.28.0/debian/control 2011-03-22 15:42:51.000000000 +0100 @@ -20,9 +20,13 @@ libgirepository1.0-dev (>= 0.10.2), python-cairo-dev (>= 1.2.0), xsltproc, + xvfb, + dbus-x11, docbook-xsl, autotools-dev, python-all-dbg, + python-apt-dbg, + python-cairo-dbg XS-Python-Version: >= 2.5 Standards-Version: 3.9.1 Vcs-Svn: svn://svn.debian.org/svn/pkg-gnome/desktop/unstable/pygobject diff -Nru pygobject-2.28.0/debian/control.in pygobject-2.28.0/debian/control.in --- pygobject-2.28.0/debian/control.in 2011-03-21 16:38:29.000000000 +0100 +++ pygobject-2.28.0/debian/control.in 2011-03-22 15:42:24.000000000 +0100 @@ -15,9 +15,13 @@ libgirepository1.0-dev (>= 0.10.2), python-cairo-dev (>= 1.2.0), xsltproc, + xvfb, + dbus-x11, docbook-xsl, autotools-dev, python-all-dbg, + python-apt-dbg, + python-cairo-dbg XS-Python-Version: >= 2.5 Standards-Version: 3.9.1 Vcs-Svn: svn://svn.debian.org/svn/pkg-gnome/desktop/unstable/pygobject diff -Nru pygobject-2.28.0/debian/patches/50_gio_tests_for_separate_build_tree.patch pygobject-2.28.0/debian/patches/50_gio_tests_for_separate_build_tree.patch --- pygobject-2.28.0/debian/patches/50_gio_tests_for_separate_build_tree.patch 1970-01-01 01:00:00.000000000 +0100 +++ pygobject-2.28.0/debian/patches/50_gio_tests_for_separate_build_tree.patch 2011-03-22 14:04:11.000000000 +0100 @@ -0,0 +1,85 @@ +From 178df3e438835bec9b40dea243867784dee35815 Mon Sep 17 00:00:00 2001 +From: Martin Pitt <[email protected]> +Date: Tue, 22 Mar 2011 13:21:27 +0100 +Subject: [PATCH] GIO tests: Fix for separate build tree + +When using a separate build tree, "test_gio.py" is not in the current working +dir (which is the build tree), but in the srcdir. Use __file__ instead. +--- + tests/test_gio.py | 14 +++++++------- + 1 files changed, 7 insertions(+), 7 deletions(-) + +Index: pygobject-2.28.0/tests/test_gio.py +=================================================================== +--- pygobject-2.28.0.orig/tests/test_gio.py 2011-03-08 00:55:32.000000000 +0100 ++++ pygobject-2.28.0/tests/test_gio.py 2011-03-22 13:47:55.277516915 +0100 +@@ -516,13 +516,13 @@ + + class TestGFileEnumerator(unittest.TestCase): + def setUp(self): +- self.file = gio.File(".") ++ self.file = gio.File(os.path.dirname(__file__)) + + def testEnumerateChildren(self): + enumerator = self.file.enumerate_children( + "standard::*", gio.FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) + for file_info in enumerator: +- if file_info.get_name() == 'test_gio.py': ++ if file_info.get_name() == os.path.basename(__file__): + break + else: + raise AssertionError +@@ -531,7 +531,7 @@ + def callback(gfile, result): + try: + for file_info in gfile.enumerate_children_finish(result): +- if file_info.get_name() == 'test_gio.py': ++ if file_info.get_name() == __file__: + break + else: + raise AssertionError +@@ -547,7 +547,7 @@ + def callback(enumerator, result): + try: + for file_info in enumerator.next_files_finish(result): +- if file_info.get_name() == 'test_gio.py': ++ if file_info.get_name() == __file__: + break + else: + raise AssertionError +@@ -594,7 +594,7 @@ + self.assertEquals(self.stream.read(), '') + + self.stream = gio.MemoryInputStream() +- some_data = open("test_gio.py", "rb").read() ++ some_data = open(__file__, "rb").read() + self.stream.add_data(some_data) + self.assertEquals(self.stream.read(), some_data) + +@@ -631,7 +631,7 @@ + 'testing') + + stream = gio.MemoryInputStream() +- some_data = open('test_gio.py', 'rb').read() ++ some_data = open(__file__, 'rb').read() + stream.add_data(some_data) + self.assertEquals(self._read_in_loop(stream, + lambda: stream.read_part(50), +@@ -807,7 +807,7 @@ + + def test_write_part(self): + stream = gio.MemoryOutputStream() +- some_data = open('test_gio.py', 'rb').read() ++ some_data = open(__file__, 'rb').read() + buffer = some_data + + # In fact this makes only one looping (memory stream is fast, +@@ -963,7 +963,7 @@ + + class TestFileInfo(unittest.TestCase): + def setUp(self): +- self.fileinfo = gio.File("test_gio.py").query_info("*") ++ self.fileinfo = gio.File(__file__).query_info("*") + + def testListAttributes(self): + attributes = self.fileinfo.list_attributes("standard") diff -Nru pygobject-2.28.0/debian/patches/51_gschema_tests_for_separate_build_tree.patch pygobject-2.28.0/debian/patches/51_gschema_tests_for_separate_build_tree.patch --- pygobject-2.28.0/debian/patches/51_gschema_tests_for_separate_build_tree.patch 1970-01-01 01:00:00.000000000 +0100 +++ pygobject-2.28.0/debian/patches/51_gschema_tests_for_separate_build_tree.patch 2011-03-22 15:08:09.000000000 +0100 @@ -0,0 +1,46 @@ +From cd38572b9781502d3228e74c017cb7cc39a07b3d Mon Sep 17 00:00:00 2001 +From: Martin Pitt <[email protected]> +Date: Tue, 22 Mar 2011 15:04:01 +0100 +Subject: [PATCH] Fix GSchema tests for separate build tree + +When using a separate build tree, the compiled GSettings schema will be in the +build tree, but as the test scripts are only in the source tree they won't find +the compiled schema. Pass the build dir as environment variable and prefer it +over test_overrides.py's directory. +--- + tests/Makefile.am | 3 ++- + tests/test_overrides.py | 4 +++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 9cdb57f..bad15f0 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -116,7 +116,8 @@ RUN_TESTS_ENV_VARS= \ + PYTHONPATH=$(top_builddir):$(top_builddir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \ + LD_LIBRARY_PATH=$(builddir)/.libs:$$LD_LIBRARY_PATH \ + GI_TYPELIB_PATH=$(builddir):$$GI_TYPELIB_PATH \ +- XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share ++ XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share \ ++ TESTS_BUILDDIR=$(builddir) + RUN_TESTS_LAUNCH=$(RUN_TESTS_ENV_VARS) $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py + + # run tests in separately to avoid loading static and introspection bindings in the same process +diff --git a/tests/test_overrides.py b/tests/test_overrides.py +index ea28d18..3421c3a 100644 +--- a/tests/test_overrides.py ++++ b/tests/test_overrides.py +@@ -1383,7 +1383,9 @@ class TestGtk(unittest.TestCase): + class TestGio(unittest.TestCase): + def setUp(self): + os.environ['GSETTINGS_BACKEND'] = 'memory' +- os.environ['GSETTINGS_SCHEMA_DIR'] = os.path.dirname(__file__) ++ # support a separate build tree, so look in build dir first ++ os.environ['GSETTINGS_SCHEMA_DIR'] = os.environ.get('TESTS_BUILDDIR', ++ os.path.dirname(__file__)) + self.settings = Gio.Settings('org.gnome.test') + # we change the values in the tests, so set them to predictable start + # value +-- +1.7.4.1 + diff -Nru pygobject-2.28.0/debian/patches/99_autoreconf.patch pygobject-2.28.0/debian/patches/99_autoreconf.patch --- pygobject-2.28.0/debian/patches/99_autoreconf.patch 2011-03-21 14:00:01.000000000 +0100 +++ pygobject-2.28.0/debian/patches/99_autoreconf.patch 2011-03-22 15:23:51.000000000 +0100 @@ -1,5 +1,7 @@ ---- a/Makefile.in -+++ b/Makefile.in +Index: pygobject-2.28.0/Makefile.in +=================================================================== +--- pygobject-2.28.0.orig/Makefile.in 2011-03-22 15:08:12.997515384 +0100 ++++ pygobject-2.28.0/Makefile.in 2011-03-22 15:23:44.587515088 +0100 @@ -238,7 +238,6 @@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -8,8 +10,10 @@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ ---- a/aclocal.m4 -+++ b/aclocal.m4 +Index: pygobject-2.28.0/aclocal.m4 +=================================================================== +--- pygobject-2.28.0.orig/aclocal.m4 2011-03-22 15:08:13.097515384 +0100 ++++ pygobject-2.28.0/aclocal.m4 2011-03-22 15:08:31.357515378 +0100 @@ -13,8 +13,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], @@ -48,8 +52,10 @@ python2.1 python2.0]) m4_if([$1],[],[ ---- a/codegen/Makefile.in -+++ b/codegen/Makefile.in +Index: pygobject-2.28.0/codegen/Makefile.in +=================================================================== +--- pygobject-2.28.0.orig/codegen/Makefile.in 2011-03-22 15:08:12.947515384 +0100 ++++ pygobject-2.28.0/codegen/Makefile.in 2011-03-22 15:23:43.027515088 +0100 @@ -173,7 +173,6 @@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -58,8 +64,10 @@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ ---- a/configure -+++ b/configure +Index: pygobject-2.28.0/configure +=================================================================== +--- pygobject-2.28.0.orig/configure 2011-03-22 15:08:12.967515384 +0100 ++++ pygobject-2.28.0/configure 2011-03-22 15:08:31.397515378 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. @@ -1918,8 +1926,10 @@ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. ---- a/docs/Makefile.in -+++ b/docs/Makefile.in +Index: pygobject-2.28.0/docs/Makefile.in +=================================================================== +--- pygobject-2.28.0.orig/docs/Makefile.in 2011-03-22 15:08:13.027515384 +0100 ++++ pygobject-2.28.0/docs/Makefile.in 2011-03-22 15:23:43.137515088 +0100 @@ -170,7 +170,6 @@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -1928,8 +1938,10 @@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ ---- a/examples/Makefile.in -+++ b/examples/Makefile.in +Index: pygobject-2.28.0/examples/Makefile.in +=================================================================== +--- pygobject-2.28.0.orig/examples/Makefile.in 2011-03-22 15:08:13.107515384 +0100 ++++ pygobject-2.28.0/examples/Makefile.in 2011-03-22 15:23:43.227515088 +0100 @@ -146,7 +146,6 @@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -1938,8 +1950,10 @@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ ---- a/gi/Makefile.in -+++ b/gi/Makefile.in +Index: pygobject-2.28.0/gi/Makefile.in +=================================================================== +--- pygobject-2.28.0.orig/gi/Makefile.in 2011-03-22 15:08:13.077515384 +0100 ++++ pygobject-2.28.0/gi/Makefile.in 2011-03-22 15:23:43.467515088 +0100 @@ -73,7 +73,7 @@ am__installdirs = "$(DESTDIR)$(pygidir)" "$(DESTDIR)$(pygidir)" LTLIBRARIES = $(pygi_LTLIBRARIES) @@ -1984,8 +1998,10 @@ _gi_cairo_la_SOURCES = pygi-foreign-cairo.c pygi_LTLIBRARIES = _gi.la $(am__append_1) ---- a/gi/overrides/Makefile.in -+++ b/gi/overrides/Makefile.in +Index: pygobject-2.28.0/gi/overrides/Makefile.in +=================================================================== +--- pygobject-2.28.0.orig/gi/overrides/Makefile.in 2011-03-22 15:08:13.067515384 +0100 ++++ pygobject-2.28.0/gi/overrides/Makefile.in 2011-03-22 15:23:43.567515088 +0100 @@ -170,7 +170,6 @@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -1994,8 +2010,10 @@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ ---- a/gi/repository/Makefile.in -+++ b/gi/repository/Makefile.in +Index: pygobject-2.28.0/gi/repository/Makefile.in +=================================================================== +--- pygobject-2.28.0.orig/gi/repository/Makefile.in 2011-03-22 15:08:13.047515384 +0100 ++++ pygobject-2.28.0/gi/repository/Makefile.in 2011-03-22 15:23:43.657515088 +0100 @@ -170,7 +170,6 @@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -2004,8 +2022,10 @@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ ---- a/gio/Makefile.in -+++ b/gio/Makefile.in +Index: pygobject-2.28.0/gio/Makefile.in +=================================================================== +--- pygobject-2.28.0.orig/gio/Makefile.in 2011-03-22 15:08:13.017515384 +0100 ++++ pygobject-2.28.0/gio/Makefile.in 2011-03-22 15:23:43.847515088 +0100 @@ -92,7 +92,7 @@ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(_gio_la_CFLAGS) \ $(CFLAGS) $(_gio_la_LDFLAGS) $(LDFLAGS) -o $@ @@ -2032,8 +2052,10 @@ unix_la_SOURCES = unixmodule.c nodist_unix_la_SOURCES = unix.c all: all-am ---- a/glib/Makefile.in -+++ b/glib/Makefile.in +Index: pygobject-2.28.0/glib/Makefile.in +=================================================================== +--- pygobject-2.28.0.orig/glib/Makefile.in 2011-03-22 15:08:13.127515384 +0100 ++++ pygobject-2.28.0/glib/Makefile.in 2011-03-22 15:23:44.057515088 +0100 @@ -90,8 +90,7 @@ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(_glib_la_CFLAGS) \ $(CFLAGS) $(_glib_la_LDFLAGS) $(LDFLAGS) -o $@ @@ -2061,8 +2083,10 @@ libpyglib_2_0_@PYTHON_BASENAME@_la_SOURCES = \ pyglib.c \ pyglib.h \ ---- a/gobject/Makefile.in -+++ b/gobject/Makefile.in +Index: pygobject-2.28.0/gobject/Makefile.in +=================================================================== +--- pygobject-2.28.0.orig/gobject/Makefile.in 2011-03-22 15:08:12.977515384 +0100 ++++ pygobject-2.28.0/gobject/Makefile.in 2011-03-22 15:23:44.257515088 +0100 @@ -223,7 +223,6 @@ PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -2071,8 +2095,10 @@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ ---- a/tests/Makefile.in -+++ b/tests/Makefile.in +Index: pygobject-2.28.0/tests/Makefile.in +=================================================================== +--- pygobject-2.28.0.orig/tests/Makefile.in 2011-03-22 15:08:12.927515384 +0100 ++++ pygobject-2.28.0/tests/Makefile.in 2011-03-22 15:23:44.447515088 +0100 @@ -72,8 +72,7 @@ $(CFLAGS) $(libregress_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_INTROSPECTION_TRUE@am_libregress_la_rpath = @@ -2100,3 +2126,13 @@ testhelper_la_SOURCES = \ testhelpermodule.c \ test-floating.c \ +@@ -322,7 +320,8 @@ + PYTHONPATH=$(top_builddir):$(top_builddir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \ + LD_LIBRARY_PATH=$(builddir)/.libs:$$LD_LIBRARY_PATH \ + GI_TYPELIB_PATH=$(builddir):$$GI_TYPELIB_PATH \ +- XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share ++ XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share \ ++ TESTS_BUILDDIR=$(builddir) + + RUN_TESTS_LAUNCH = $(RUN_TESTS_ENV_VARS) $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py + all: all-am diff -Nru pygobject-2.28.0/debian/patches/series pygobject-2.28.0/debian/patches/series --- pygobject-2.28.0/debian/patches/series 2011-03-21 14:00:58.000000000 +0100 +++ pygobject-2.28.0/debian/patches/series 2011-03-22 15:08:24.000000000 +0100 @@ -1,4 +1,6 @@ 20_deprecated_spam.patch 30_[gi-overrides]-fix-exception-block-so-it-works-in-Python-2.5.patch 40_revert_libpython_link.patch +50_gio_tests_for_separate_build_tree.patch +51_gschema_tests_for_separate_build_tree.patch 99_autoreconf.patch diff -Nru pygobject-2.28.0/debian/rules pygobject-2.28.0/debian/rules --- pygobject-2.28.0/debian/rules 2011-03-22 10:10:48.000000000 +0100 +++ pygobject-2.28.0/debian/rules 2011-03-22 15:42:06.000000000 +0100 @@ -76,11 +76,17 @@ build: $(PYVERS:%=build-%/build-stamp) $(PYVERS:%=dbg-build-%/build-stamp) build-%/check-stamp: build-%/build-stamp - -PYTHON=/usr/bin/python$* $(MAKE) -C build-$* check + find gi glib gobject gio -name '*.py' -exec cp '$(CURDIR)/{}' build-$*/'{}' \; + # don't run the tests under fakeroot, otherwise they will try to + # connect to root's session D-BUS + -PYTHON=/usr/bin/python$* LD_PRELOAD= xvfb-run $(MAKE) -C build-$* check touch $@ dbg-build-%/check-stamp: dbg-build-%/build-stamp - -PYTHON=/usr/bin/python$*-dbg $(MAKE) -C dbg-build-$* check + find gi glib gobject gio -name '*.py' -exec cp '$(CURDIR)/{}' dbg-build-$*/'{}' \; + # don't run the tests under fakeroot, otherwise they will try to + # connect to root's session D-BUS + -PYTHON=/usr/bin/python$*-dbg LD_PRELOAD= xvfb-run $(MAKE) -C dbg-build-$* check touch $@ check: $(PYVERS:%=build-%/check-stamp) $(PYVERS:%=dbg-build-%/check-stamp)
signature.asc
Description: Digital signature

