[DRE-commits] [SCM] gem2deb.git branch, master, updated. debian/0.2.3-58-g54ef768

Antonio Terceiro terceiro at softwarelivre.org
Thu Jul 21 18:42:01 UTC 2011


The following commit has been merged in the master branch:
commit e9091e3effc45441cd4fc5f014758d79f577cfa2
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date:   Thu Jul 21 11:05:31 2011 -0700

    Revert "Remove Build-Depends: on rake"
    
    This reverts commit 94ab8f2d317efe3a44de63ce2094ab620c8ab2f3.

diff --git a/Rakefile b/Rakefile
index bf5d5e7..739b49e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -2,16 +2,23 @@ require 'rake/testtask'
 
 task :default => :test
 
-task :test do
-  sh './test/run'
+task :test => :version_check do
+  puts '=> Unit tests'
+  Rake::Task['test:unit'].invoke
+  puts '=> Integration tests'
+  Rake::Task['test:integration'].invoke
 end
 
-task 'test:unit' do
-  sh './test/run unit'
+Rake::TestTask.new('test:unit') do |t|
+  t.libs << "test"
+  t.test_files = FileList['test/unit/*_test.rb']
+  t.verbose = true
 end
 
-task 'test:integration' do
-  sh './test/run integration'
+Rake::TestTask.new('test:integration') do |t|
+  t.libs << 'test'
+  t.test_files = FileList['test/integration/*_test.rb']
+  t.verbose = true
 end
 
 desc "Run tests in debug mode (e.g. don't delete temporary files)"
@@ -36,3 +43,18 @@ task :snapshot do
   sh 'ls debian/changelog.git'
   sh 'mv debian/changelog.git debian/changelog'
 end
+
+desc "Checks for inconsistencies between version numbers in the code and in debian/changelog"
+task :version_check do
+  code_version = `ruby -Ilib -rgem2deb -e 'puts Gem2Deb::VERSION'`.strip
+  debian_version = `dpkg-parsechangelog | grep '^Version: ' | cut -d ' ' -f 2`.strip
+  if code_version != debian_version
+    msg ="W: Inconsistent version numbers: lib/gem2deb.rb says #{code_version}, debian/changelog says #{debian_version}"
+    if STDIN.isatty && STDOUT.isatty && STDERR.isatty
+      # highlight the message in red
+      puts("\033[31;40m%s\033[m" % msg)
+    else
+      puts msg
+    end
+  end
+end
diff --git a/debian/control b/debian/control
index 709ba66..f5e8340 100644
--- a/debian/control
+++ b/debian/control
@@ -3,10 +3,10 @@ Section: ruby
 Priority: optional
 Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers at lists.alioth.debian.org>
 Uploaders: Lucas Nussbaum <lucas at debian.org>, 
-           Antonio Terceiro <terceiro at debian.org>,
+           Antonio Terceiro <terceiro at softwarelivre.org>,
            Vincent Fourmond <fourmond at debian.org>
 DM-Upload-Allowed: yes
-Build-Depends: debhelper (>= 7.0.50~), ruby-shoulda-context, ruby-mocha, rubygems1.8, ruby1.8, ruby1.8-dev, ruby1.9.1, ruby1.9.1-dev, devscripts, ruby-setup
+Build-Depends: debhelper (>= 7.0.50~), rake, ruby-shoulda-context, ruby-mocha, rubygems1.8, ruby1.8, ruby1.8-dev, ruby1.9.1, ruby1.9.1-dev, devscripts, ruby-setup
 Standards-Version: 3.9.2
 Vcs-Git: git://git.debian.org/pkg-ruby-extras/gem2deb.git
 Vcs-Browser: http://git.debian.org/?p=pkg-ruby-extras/gem2deb.git;a=summary
diff --git a/debian/rules b/debian/rules
index 7f610c9..5f6c5eb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,7 +6,7 @@
 override_dh_auto_build:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	# NO_PKG_MANGLE=1 is only useful on Ubuntu buildds, to disable pkgbinarymangler
-	NO_PKG_MANGLE=1 ./test/run
+	NO_PKG_MANGLE=1 rake test
 endif
 	mkdir -p man
 	for i in bin/*; do pod2man -c "" -r "" $$i > man/$$(basename $$i).1; done
diff --git a/test/loader.rb b/test/loader.rb
deleted file mode 100644
index 6317837..0000000
--- a/test/loader.rb
+++ /dev/null
@@ -1 +0,0 @@
-ARGV.each { |f| require f }
diff --git a/test/run b/test/run
deleted file mode 100755
index 9750a8a..0000000
--- a/test/run
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-set -e
-
-RUBY='ruby1.8'
-
-run_unit_tests=false
-run_integration_tests=false
-run_version_check_tests=false
-which_tests="$1"
-case "$which_tests" in
-  unit|integration|version_check)
-    eval "run_${which_tests}_tests=true"
-    ;;
-  '')
-    run_unit_tests=true
-    run_integration_tests=true
-    run_version_check_tests=true
-    ;;
-  *)
-    echo "usage: $0 [unit|integration|version_check]"
-    exit 1
-    ;;
-esac
-
-run_tests() {
-  echo $RUBY -Ilib:test test/loader.rb $@
-  $RUBY -Ilib:test test/loader.rb $@
-}
-
-maybe_check_version_number() {
-  if test $run_version_check_tests != true; then
-    return
-  fi
-  code_version=$(ruby -Ilib -rgem2deb -e 'puts Gem2Deb::VERSION')
-  debian_version=$(dpkg-parsechangelog | grep '^Version: ' | cut -d ' ' -f 2)
-  if test "$code_version" != "debian_version"; then
-    msg="W: Inconsistent version numbers: lib/gem2deb.rb says ${code_version}, debian/changelog says ${debian_version}"
-    if test -t 0 && test -t 1 && test -t 2; then
-      printf "\033[31;40m${msg}\033[m\n"
-    else
-      printf "$msg\n"
-    fi
-  fi
-}
-
-maybe_run_unit_tests() {
-  if test $run_unit_tests = true; then
-    echo "Running unit tests"
-    run_tests test/unit/*_test.rb
-  fi
-}
-maybe_run_integration_tests() {
-  if test $run_integration_tests = true; then
-    echo "Running integration tests"
-    run_tests test/integration/*_test.rb
-  fi
-}
-
-maybe_check_version_number
-maybe_run_unit_tests
-maybe_run_integration_tests

-- 
gem2deb.git



More information about the Pkg-ruby-extras-commits mailing list