Bug#758587: gjs: add autopackage tests
Tim
darkxst at fastmail.fm
Mon Aug 18 23:32:45 UTC 2014
Package: gjs
Version: 1.41.4-0ubuntu1
Severity: wishlist
I heard Debian now supports running autopkgtests, here is a patch that merges our gjs autopkgtest config from Ubuntu.
-------------- next part --------------
From 9140941a406c22e852668794b67217772acfb173 Mon Sep 17 00:00:00 2001
From: Tim Lunn <tim at feathertop.org>
Date: Mon, 18 Aug 2014 11:40:41 +1000
Subject: [PATCH 1/2] Merge autopkgtests from Ubuntu
---
debian/changelog | 13 +++++++++++++
debian/control | 14 ++++++++++++++
debian/control.in | 14 ++++++++++++++
debian/gjs-tests.install | 3 +++
debian/rules | 9 ++++++++-
debian/tests/build | 27 +++++++++++++++++++++++++++
debian/tests/control | 5 +++++
debian/tests/installed-tests | 10 ++++++++++
8 files changed, 94 insertions(+), 1 deletion(-)
create mode 100644 debian/gjs-tests.install
create mode 100755 debian/tests/build
create mode 100644 debian/tests/control
create mode 100755 debian/tests/installed-tests
diff --git a/debian/changelog b/debian/changelog
index 5ec9676..379ac58 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+gjs (1.40.1-3) UNRELEASED; urgency=medium
+
+ * Add installed-tests as autopkgtests
+ + debian/control.in:
+ - set XS-Testsuite for autopkgtests
+ - add -tests package for installed tests
+ + debian/tests: Add autopkgtests
+ + debian/rules:
+ - configure with --enable-installed-tests
+ - Make tests fatal except for powerpc
+
+ -- Tim Lunn <tim at feathertop.org> Mon, 18 Aug 2014 11:24:16 +1000
+
gjs (1.40.1-2) unstable; urgency=medium
* Bump Standards-Version to 3.9.5
diff --git a/debian/control b/debian/control
index 70be506..973608e 100644
--- a/debian/control
+++ b/debian/control
@@ -28,6 +28,7 @@ Standards-Version: 3.9.5
Vcs-Svn: svn://anonscm.debian.org/pkg-gnome/desktop/unstable/gjs
Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-gnome/desktop/unstable/gjs
Homepage: https://wiki.gnome.org/Gjs
+XS-Testsuite: autopkgtest
Package: gjs
Architecture: any
@@ -40,6 +41,19 @@ Description: Mozilla-based javascript bindings for the GNOME platform
.
This package contains the interactive console application.
+Package: gjs-tests
+Architecture: any
+Depends: ${shlibs:Depends},
+ ${misc:Depends},
+ gir1.2-gtk-3.0
+Description: Mozilla-based javascript bindings for the GNOME platform
+ Makes it possible for applications to use all of GNOME's platform
+ libraries using the Javascript language. It's mainly based on the
+ Mozilla javascript engine and the GObject introsepection framework.
+ .
+ This package contains test programs, designed to be run as part of a
+ regression testsuite.
+
Package: libgjs0e
Architecture: any
Section: libs
diff --git a/debian/control.in b/debian/control.in
index 85d489e..2e4bd59 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -23,6 +23,7 @@ Standards-Version: 3.9.5
Vcs-Svn: svn://anonscm.debian.org/pkg-gnome/desktop/unstable/gjs
Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-gnome/desktop/unstable/gjs
Homepage: https://wiki.gnome.org/Gjs
+XS-Testsuite: autopkgtest
Package: gjs
Architecture: any
@@ -35,6 +36,19 @@ Description: Mozilla-based javascript bindings for the GNOME platform
.
This package contains the interactive console application.
+Package: gjs-tests
+Architecture: any
+Depends: ${shlibs:Depends},
+ ${misc:Depends},
+ gir1.2-gtk-3.0
+Description: Mozilla-based javascript bindings for the GNOME platform
+ Makes it possible for applications to use all of GNOME's platform
+ libraries using the Javascript language. It's mainly based on the
+ Mozilla javascript engine and the GObject introsepection framework.
+ .
+ This package contains test programs, designed to be run as part of a
+ regression testsuite.
+
Package: libgjs0e
Architecture: any
Section: libs
diff --git a/debian/gjs-tests.install b/debian/gjs-tests.install
new file mode 100644
index 0000000..10bf715
--- /dev/null
+++ b/debian/gjs-tests.install
@@ -0,0 +1,3 @@
+usr/share/installed-tests
+usr/lib/gjs/gjs/installed-tests
+usr/lib/gjs/lib*
diff --git a/debian/rules b/debian/rules
index 91c2feb..6781df7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,12 +7,19 @@ include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk
+# configure flags
+DEB_CONFIGURE_EXTRA_FLAGS := --enable-installed-tests
+
# Use recursive variables since this variable must not be expanded until
# files have been installed.
LIBMOZJS = $(shell objdump -p debian/tmp/usr/lib/libgjs.so | awk '$$1=="NEEDED" && $$2~/^libmozjs/ { print $$2 }' | sed s/\\.so\\./-/ )
DEB_DH_MAKESHLIBS_ARGS_libgjs0e = -Xusr/lib/gjs-1.0/ -V'libgjs0e (>= $(DEB_UPSTREAM_VERSION)), libgjs0-$(LIBMOZJS)' -- -c4
-DEB_MAKE_CHECK_TARGET := check || true
+DEB_MAKE_CHECK_TARGET := check
+
+ifeq ($(DEB_HOST_ARCH), powerpc)
+ DEB_MAKE_CHECK_TARGET := check || true
+endif
install/libgjs0e::
echo gjs:Provides=libgjs0-$(LIBMOZJS) >> debian/$(cdbs_curpkg).substvars
diff --git a/debian/tests/build b/debian/tests/build
new file mode 100755
index 0000000..80f6c01
--- /dev/null
+++ b/debian/tests/build
@@ -0,0 +1,27 @@
+#!/bin/sh
+# autopkgtest check: Build and run a program against glib, to verify that the
+# headers and pkg-config file are installed correctly
+# (C) 2012 Canonical Ltd.
+# Author: Martin Pitt <martin.pitt at ubuntu.com>
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+cat <<EOF > gjstest.c
+#include <gjs/gjs.h>
+
+int main()
+{
+ GjsContext* context;
+ context = gjs_context_new();
+ return 0;
+}
+EOF
+
+gcc -o gjstest gjstest.c `pkg-config --cflags --libs gjs-1.0`
+echo "build: OK"
+[ -x gjstest ]
+./gjstest
+echo "run: OK"
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..cf4968d
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,5 @@
+Tests: build
+Depends: libgjs-dev, build-essential
+
+Tests: installed-tests
+Depends: gjs-tests, dbus-x11, xvfb, gnome-desktop-testing
diff --git a/debian/tests/installed-tests b/debian/tests/installed-tests
new file mode 100755
index 0000000..8749f3c
--- /dev/null
+++ b/debian/tests/installed-tests
@@ -0,0 +1,10 @@
+#!/bin/sh
+# autopkgtest check: Run the installed-tests to verify glib works correctly
+# (C) 2013 Canonical Ltd.
+# Author: Iain Lane <iain.lane at canonical.com>
+
+set -e
+
+export XDG_RUNTIME_DIR=$ADTTMP
+
+dbus-launch xvfb-run -a gnome-desktop-testing-runner gjs
--
2.1.0.rc1
From 8919605dfc9e8034887b51e7df9adb737d5874c5 Mon Sep 17 00:00:00 2001
From: Tim Lunn <tim at feathertop.org>
Date: Mon, 18 Aug 2014 11:46:27 +1000
Subject: [PATCH 2/2] Drop lintian overrides, no longer needed
---
debian/changelog | 1 +
debian/gjs.lintian-overrides | 2 --
2 files changed, 1 insertion(+), 2 deletions(-)
delete mode 100644 debian/gjs.lintian-overrides
diff --git a/debian/changelog b/debian/changelog
index 379ac58..45c70e8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ gjs (1.40.1-3) UNRELEASED; urgency=medium
+ debian/rules:
- configure with --enable-installed-tests
- Make tests fatal except for powerpc
+ * Drop lintian overrides no longer needed
-- Tim Lunn <tim at feathertop.org> Mon, 18 Aug 2014 11:24:16 +1000
diff --git a/debian/gjs.lintian-overrides b/debian/gjs.lintian-overrides
deleted file mode 100644
index ab52cf6..0000000
--- a/debian/gjs.lintian-overrides
+++ /dev/null
@@ -1,2 +0,0 @@
-# we use mozilla libraries, that are in a private library path
-gjs: binary-or-shlib-defines-rpath
--
2.1.0.rc1
More information about the pkg-gnome-maintainers
mailing list