[Pkg-libvirt-commits] [ruby-libvirt] 01/02: Add gemspec and autopkg tests

Guido Guenther agx at moszumanska.debian.org
Tue Apr 19 06:26:39 UTC 2016


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to annotated tag debian/0.6.0-2
in repository ruby-libvirt.

commit 03566de4d66204957167e2903b1b671dce2e503a
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Mon Apr 18 19:26:08 2016 +0200

    Add gemspec and autopkg tests
---
 debian/changelog       | 13 +++++++++++++
 debian/control         |  7 ++++---
 debian/gemspec.rake    |  8 ++++++++
 debian/ruby-tests.rake | 12 ++++++++++++
 debian/rules           | 12 +++++++-----
 debian/tests/control   |  2 ++
 6 files changed, 46 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ae985c1..11f545d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+ruby-libvirt (0.6.0-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * debian/rules: remove manual test run in favor of gem2deb's own mechanism
+    for running tests, avoiding building the C extension twice on every Debian
+    build.
+    * This also gives us autopkgtest support almost for free; so add
+      `Testsuite: autopkgtest` in debian/control
+  * debian/rules: call debian/gemspec.rake to build a gemspec during the build
+    (Closes: #795603)
+
+ -- Antonio Terceiro <terceiro at debian.org>  Sun, 17 Apr 2016 14:04:22 -0300
+
 ruby-libvirt (0.6.0-1) unstable; urgency=medium
 
   * [dc7846f] New upstream version 0.6.0
diff --git a/debian/control b/debian/control
index ead6b6f..4812a2e 100644
--- a/debian/control
+++ b/debian/control
@@ -7,11 +7,12 @@ Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.6.0), libvirt-dev, pkg-conf
 # for the tests
  rake,
  libvirt-daemon
-Standards-Version: 3.9.6
-Vcs-Git: git://anonscm.debian.org/git/pkg-libvirt/ruby-libvirt.git
-Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-libvirt/ruby-libvirt.git;a=summary
+Standards-Version: 3.9.7
+Vcs-Git: https://anonscm.debian.org/git/pkg-libvirt/ruby-libvirt.git
+Vcs-Browser: https://anonscm.debian.org/cgit/pkg-libvirt/ruby-libvirt.git
 Homepage: http://libvirt.org/ruby/
 XS-Ruby-Versions: all
+Testsuite: autopkgtest
 
 Package: ruby-libvirt
 Architecture: any
diff --git a/debian/gemspec.rake b/debian/gemspec.rake
new file mode 100644
index 0000000..dc1d957
--- /dev/null
+++ b/debian/gemspec.rake
@@ -0,0 +1,8 @@
+load 'Rakefile'
+
+gemspec = "ruby-libvirt-#{PKG_VERSION}.gemspec"
+
+task :gemspec => gemspec
+file gemspec do |t|
+  File.open(t.name, 'w') { |f| f.write(SPEC.to_ruby) }
+end
diff --git a/debian/ruby-tests.rake b/debian/ruby-tests.rake
new file mode 100644
index 0000000..afde7f6
--- /dev/null
+++ b/debian/ruby-tests.rake
@@ -0,0 +1,12 @@
+topdir = File.dirname(File.dirname(__FILE__))
+ENV['XDG_RUNTIME_DIR'] = topdir
+ENV['XDG_CONFIG_HOME'] = topdir
+ENV['LIBVIRT_DEFAULT_URI'] = 'test:///default'
+ENV['RUBY_LIBVIRT_TEST_URI'] = 'test:///default'
+
+require 'gem2deb/rake/testtask'
+Gem2Deb::Rake::TestTask.new do |t|
+  t.test_files = [ 'tests/test_nodedevice.rb',
+                   'tests/test_open.rb',
+                   'tests/test_stream.rb' ]
+end
diff --git a/debian/rules b/debian/rules
index 22f52c6..5a258a8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,8 +4,10 @@
 %:
 	dh $@ --buildsystem=ruby --with ruby
 
-override_dh_auto_test:
-	XDG_RUNTIME_DIR=$(CURDIR) \
-	XDG_CONFIG_HOME=$(CURDIR) \
-	LIBVIRT_DEFAULT_URI=test:///default \
-	RUBY_LIBVIRT_TEST_URI=test:///default rake test
+override_dh_auto_install:
+	rake -f debian/gemspec.rake gemspec
+	dh_auto_install
+
+override_dh_auto_clean:
+	$(RM) *.gemspec
+	dh_auto_clean
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..4e11623
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Test-Command: rake -f debian/gemspec.rake gemspec && gem2deb-test-runner --autopkgtest --check-dependencies 2>&1
+Depends: @, libvirt-dev,pkg-config,rake,libvirt-daemon, gem2deb-test-runner

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/ruby-libvirt.git



More information about the Pkg-libvirt-commits mailing list