comparison tests/run-tests.py @ 23933:769027075e21 stable

run-tests.py: execute hghave with same env vars as ones for actual tests Before this patch, "run-tests.py" executes "hghave" process without any modifications for environment variables, even though actual tests are executed with LC_ALL, LANG and LANGUAGE explicitly assigned "C". When "run-tests.py" is executed: - with non-"C" locale environment variables on any platforms, or - without any explicit locale environment setting on Windows (only for "outer-repo" feature using "hg root") external commands indirectly executed by "hghave" may show translated messages. This causes incorrect "hghave" result and skipping tests, because some regexp matching of "hghave" expect external commands to show un-translated messages. To prevent external commands from showing translated messages, this patch makes "run-tests.py" execute "hghave" with same environment variables as ones for actual tests. This patch doesn't make "hghave" execute external commands forcibly with LC_ALL, LANG and LANGUAGE explicitly assigned "C", because changing "run-tests.py" is cheaper than changing "hghave": - "os.popen" should be replaced by "subprocess.Popen" or so, and - setting up environment variables should be newly added
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Thu, 22 Jan 2015 00:03:58 +0900
parents 661b246bf1c4
children d64dd1252386
comparison
equal deleted inserted replaced
23932:d7a90949fc18 23933:769027075e21
784 def _hghave(self, reqs): 784 def _hghave(self, reqs):
785 # TODO do something smarter when all other uses of hghave are gone. 785 # TODO do something smarter when all other uses of hghave are gone.
786 tdir = self._testdir.replace('\\', '/') 786 tdir = self._testdir.replace('\\', '/')
787 proc = Popen4('%s -c "%s/hghave %s"' % 787 proc = Popen4('%s -c "%s/hghave %s"' %
788 (self._shell, tdir, ' '.join(reqs)), 788 (self._shell, tdir, ' '.join(reqs)),
789 self._testtmp, 0) 789 self._testtmp, 0, self._getenv())
790 stdout, stderr = proc.communicate() 790 stdout, stderr = proc.communicate()
791 ret = proc.wait() 791 ret = proc.wait()
792 if wifexited(ret): 792 if wifexited(ret):
793 ret = os.WEXITSTATUS(ret) 793 ret = os.WEXITSTATUS(ret)
794 if ret == 2: 794 if ret == 2: