[DRE-commits] [kwalify] 01/03: [patch] fix several paths problems

Marc Dequènes duck at moszumanska.debian.org
Wed Aug 5 01:01:12 UTC 2015


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

duck pushed a commit to branch master
in repository kwalify.

commit 9edc9176ec54b233c7e14ae460e8c06672fb7f61
Author: Marc Dequènes (Duck) <Duck at DuckCorp.org>
Date:   Wed Aug 5 00:58:07 2015 +0200

    [patch] fix several paths problems
    
    - fixed badly computed path in UsersGuideTest
    - all tests: properly load lib and exec paths in the right order
      (in case package already installed) and with exec support (used
      by tests)
---
 debian/changelog                    |  1 +
 debian/patches/series               |  1 +
 debian/patches/test_paths_fix.patch | 36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 04fd895..1234d78 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ kwalify (0.7.2-3) UNRELEASED; urgency=medium
   * Added patch to fix hash manipulation in the metavalidator test.
   * Added patch to remove broken test data.
   * Added patch to fix string conversion into array of lines.
+  * Added patch to fix several path problems in tests.
 
  -- Marc Dequènes (Duck) <Duck at DuckCorp.org>  Tue, 04 Aug 2015 21:33:19 +0200
 
diff --git a/debian/patches/series b/debian/patches/series
index 7bcb4ed..2b980c7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ yaml_tests_quoting_fix.patch
 test-metavalidator_hash_manip_fix.patch
 broken_test_documents_removal.patch
 proper_string_split.patch
+test_paths_fix.patch
diff --git a/debian/patches/test_paths_fix.patch b/debian/patches/test_paths_fix.patch
new file mode 100644
index 0000000..af9443e
--- /dev/null
+++ b/debian/patches/test_paths_fix.patch
@@ -0,0 +1,36 @@
+Index: kwalify/test/test-users-guide.rb
+===================================================================
+--- kwalify.orig/test/test-users-guide.rb
++++ kwalify/test/test-users-guide.rb
+@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__
+ 
+ class UsersGuideTest < Test::Unit::TestCase
+ 
+-  DATA_DIR = 'data/users-guide'
++  DATA_DIR = File.join(TESTDIR, 'data', 'users-guide')
+   CURR_DIR = Dir.pwd
+   for item in Dir.glob("#{DATA_DIR}/*.result").sort()
+     filename = File.basename(item)
+Index: kwalify/test/test.rb
+===================================================================
+--- kwalify.orig/test/test.rb
++++ kwalify/test/test.rb
+@@ -5,10 +5,14 @@
+ ###
+ 
+ unless defined?(TESTDIR)
+-  TESTDIR = File.dirname(__FILE__)
+-  #libdir  = TESTDIR == '.' ? '../lib' : File.dirname(TESTDIR) + "/lib"
+-  libdir  = TESTDIR == '.' ? File.expand_path('../lib') : File.dirname(TESTDIR) + "/lib"
+-  $LOAD_PATH << libdir << TESTDIR
++  TESTDIR = File.expand_path(File.dirname(__FILE__))
++  $LOAD_PATH.unshift TESTDIR
++  libdir  = File.expand_path(File.join(TESTDIR, "..", "lib"))
++  $LOAD_PATH.unshift libdir
++  # kwalify commands are exec-ed in the tests
++  ENV['RUBYLIB'] = libdir
++  bindir  = File.expand_path(File.join(TESTDIR, "..", "bin"))
++  ENV['PATH'] = bindir + ":" + ENV['PATH']
+ end
+ 
+ 

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



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