]> git.donarmstrong.com Git - debbugs.git/commitdiff
Set LC_ALL to an UTF-8 locale before running tests
authorNiels Thykier <niels@thykier.net>
Sun, 21 Aug 2016 09:46:32 +0000 (09:46 +0000)
committerDon Armstrong <don@donarmstrong.com>
Wed, 7 Sep 2016 18:59:20 +0000 (11:59 -0700)
To avoid noisy warnings from some tests that implicitly expect to be
run under an UTF-8 locale.

Signed-off-by: Niels Thykier <niels@thykier.net>
Makefile

index 3e6dd584fc60715edf3f62f80d583f48118f3bc8..3e48fc1fc28d45926a35493f2fa115d935532d3e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,8 @@ install_exec  := install -m755 -p
 install_data   := install -m644 -p
 
 PERL ?= /usr/bin/perl
+# Some tests need to run under an UTF-8 locale.
+UTF8_LOCALE ?= C.UTF-8
 
 all: build test
 
@@ -32,13 +34,13 @@ build:
        $(MAKE) -f Makefile.perl
 
 test:
-       $(PERL) -MTest::Harness -I. -e 'runtests(glob(q(t/*.t)))'
+       LC_ALL=$(UTF8_LOCALE) $(PERL) -MTest::Harness -I. -e 'runtests(glob(q(t/*.t)))'
 
 test_%: t/%.t
-       $(PERL) -MTest::Harness -I. -e 'runtests(q($<))'
+       LC_ALL=$(UTF8_LOCALE) $(PERL) -MTest::Harness -I. -e 'runtests(q($<))'
 
 testcover:
-       PERL5LIB=t/cover_lib/:. cover -test
+       LC_ALL=$(UTF8_LOCALE) PERL5LIB=t/cover_lib/:. cover -test
 
 clean:
        if [ -e Makefile.perl ]; then \