Mercurial > hg
comparison tests/run-tests.py @ 37342:4e6a6d0dccee
tests: conditionalize tests based on presence of custom extensions
The test harness supports injecting extensions via --extra-config-opt.
However, if you do this, various tests that print state about loaded
extensions fail.
This commit teaches the test harness to recognize when custom
extensions are loaded so that tests can use feature sniffing to
conditionalize tests based on that.
Differential Revision: https://phab.mercurial-scm.org/D3039
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 04 Apr 2018 13:21:34 -0700 |
parents | 5890e5872f36 |
children | 700aaa19de63 |
comparison
equal
deleted
inserted
replaced
37341:d62d2e346acf | 37342:4e6a6d0dccee |
---|---|
1067 env["HGMERGE"] = "internal:merge" | 1067 env["HGMERGE"] = "internal:merge" |
1068 env["HGUSER"] = "test" | 1068 env["HGUSER"] = "test" |
1069 env["HGENCODING"] = "ascii" | 1069 env["HGENCODING"] = "ascii" |
1070 env["HGENCODINGMODE"] = "strict" | 1070 env["HGENCODINGMODE"] = "strict" |
1071 env['HGIPV6'] = str(int(self._useipv6)) | 1071 env['HGIPV6'] = str(int(self._useipv6)) |
1072 | |
1073 extraextensions = [] | |
1074 for opt in self._extraconfigopts: | |
1075 section, key = opt.encode('utf-8').split(b'.', 1) | |
1076 if section != 'extensions': | |
1077 continue | |
1078 name = key.split(b'=', 1)[0] | |
1079 extraextensions.append(name) | |
1080 | |
1081 if extraextensions: | |
1082 env['HGTESTEXTRAEXTENSIONS'] = b' '.join(extraextensions) | |
1072 | 1083 |
1073 # LOCALIP could be ::1 or 127.0.0.1. Useful for tests that require raw | 1084 # LOCALIP could be ::1 or 127.0.0.1. Useful for tests that require raw |
1074 # IP addresses. | 1085 # IP addresses. |
1075 env['LOCALIP'] = self._localip() | 1086 env['LOCALIP'] = self._localip() |
1076 | 1087 |