summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-06-10 22:46:48 +0000
committerIan Lynagh <igloo@earth.li>2009-06-10 22:46:48 +0000
commit05a65110594caf94420dd7d2db10c87d79bb80c5 (patch)
tree12fbe5cb6a46e7936c36a02df9770abf29d37507
parent7e39a735eebacb767b0b2c4cd636f420afebf47e (diff)
downloadhaskell-05a65110594caf94420dd7d2db10c87d79bb80c5.tar.gz
Try and find a utf8 locale to use
In other locales we get some test failures for some ghci unicode tests
-rw-r--r--testsuite/driver/runtests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index 8f93bb8b3d..2e7e9d88da 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -22,6 +22,22 @@ from testglobals import *
# value.
os.environ['TERM'] = 'vt100'
+# Try and find a utf8 locale to use
+# First see if 'locale -a' works
+h = os.popen('locale -a', 'r')
+v = h.read()
+h.close()
+if v != '':
+ # If it does then use the first utf8 locale that is available
+ h = os.popen('locale -a | grep -i utf8 | head', 'r')
+ v = h.read()
+ h.close()
+ if v != '':
+ os.environ['LC_ALL'] = v
+ else:
+ print 'WARNING: No UTF8 locale found.'
+ print 'You may get some spurious test failures.'
+
global config
config = getConfig() # get it from testglobals