run-tests: allow hg executable to be hg.exe
authorKostia Balytskyi <ikostia@fb.com>
Wed, 17 May 2017 12:51:40 -0700
changeset 32328 531e6a57abd2
parent 32327 3546a771e376
child 32329 799615bbf5bf
run-tests: allow hg executable to be hg.exe When running tests on Windows (via msys), user sometimes does not want to run them against source hg, but against compiled hg.exe. For that purpose, --with-hg option can be used, but currently run-tests.py prints a warning if the value of this argument is not a file with basename 'hg'. This patch allows such file to be 'hg.exe'.
tests/run-tests.py
--- a/tests/run-tests.py	Tue May 09 16:29:31 2017 -0700
+++ b/tests/run-tests.py	Wed May 17 12:51:40 2017 -0700
@@ -357,7 +357,7 @@
         if not (os.path.isfile(options.with_hg) and
                 os.access(options.with_hg, os.X_OK)):
             parser.error('--with-hg must specify an executable hg script')
-        if not os.path.basename(options.with_hg) == b'hg':
+        if os.path.basename(options.with_hg) not in [b'hg', b'hg.exe']:
             sys.stderr.write('warning: --with-hg should specify an hg script\n')
     if options.local:
         testdir = os.path.dirname(_bytespath(canonpath(sys.argv[0])))