[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.4.3-196-g89887aa



The following commit has been merged in the master branch:
commit 89887aa066a0187d876e3f8a46cef57b40825ac2
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Jan 27 23:33:48 2011 +0100

    Made wrapper script for runtests to setup en_US.UTF-8 locale
    
    This is required by some checks (manpages) to function correctly
    and could cause tests to fail.

diff --git a/debian/rules b/debian/rules
index 92ee8d6..4084769 100755
--- a/debian/rules
+++ b/debian/rules
@@ -25,8 +25,7 @@ runtests: $(neededfiles) $(allchecks) $(allcollect) $(tagfiles) $(testfiles)
 	@echo .... running tests ....
 	rm -rf debian/tests
 	mkdir debian/tests
-	LINTIAN_ROOT="" $(PERL) t/runtests -k t debian/tests $(onlyrun)
-	LINTIAN_ROOT="" $(PERL) testset/runtests -k testset debian/tests $(onlyrun)
+	private/runtests $(onlyrun)
 	if [ "$(onlyrun)" = "" ]; then touch $@; fi
 
 # Like runtests but only runs tests affecting a particular tag.  That tag
@@ -37,7 +36,7 @@ check-tag:
 	fi
 	rm -rf debian/tests
 	mkdir debian/tests
-	LINTIAN_ROOT="" $(PERL) t/runtests -k -t $(tag) t debian/tests
+	private/runtests -t $(tag)
 
 # this target is only run manually
 refresh-perl-provides:
@@ -71,6 +70,7 @@ clean: $(neededfiles)
 	rm -rf doc/lintian.html/ doc/lintian.txt
 	rm -rf debian/tests
 	rm -rf man/man1/
+	rm -fr debian/test.locale
 	find -name "*.py?" -print0 | xargs -0r rm
 	dh_clean
 
diff --git a/private/runtests b/private/runtests
new file mode 100755
index 0000000..aba2291
--- /dev/null
+++ b/private/runtests
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "-t" ] ; then
+    TAG=yes
+fi
+
+LANG="en_US.UTF-8"
+LC_COLLATE="C"
+LINTIAN_ROOT=""
+LOCPATH="$(pwd)/debian/test.locale"
+
+export LANG
+export LC_COLLCATE
+export LINTIAN_ROOT
+export LOCPATH
+
+fail(){
+    echo "$1" >&2
+    exit 1
+}
+
+if [ ! -e "$LOCPATH"/en_US.UTF-8 ] ; then
+    echo "Generating en_US.UTF-8 locale for the test suite"
+    mkdir -p "$LOCPATH"
+    localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias \
+        --quiet "$LOCPATH"/en_US.UTF-8 || fail "Locale generation failed"
+fi
+
+t/runtests -k t debian/tests "$@"
+if [ "$TAG" = "" ] ; then
+    testset/runtests -k testset debian/tests "$@"
+fi

-- 
Debian package checker


Reply to: