Mercurial > hg
comparison tests/run-tests.py @ 25177:c3459555318e
run-tests: resurrect the wifexited polyfill (backout 6ab5a1c9ea3c)
Python 2.7.3 on Windows doesn't have os.WIFEXITED, and the test output looked
like this before I interrupted it.
$ ./run-tests.py --local -j2 -t700
EEEEEEEEEEEEEEEEEEEEEE
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 18 May 2015 15:34:42 -0400 |
parents | 153b9c5235c2 |
children | 27600986a0d9 |
comparison
equal
deleted
inserted
replaced
25176:665a9deae8dd | 25177:c3459555318e |
---|---|
100 # help keep code consistent between platforms. | 100 # help keep code consistent between platforms. |
101 def _bytespath(p): | 101 def _bytespath(p): |
102 return p | 102 return p |
103 | 103 |
104 _strpath = _bytespath | 104 _strpath = _bytespath |
105 | |
106 # For Windows support | |
107 wifexited = getattr(os, "WIFEXITED", lambda x: False) | |
105 | 108 |
106 def checkportisavailable(port): | 109 def checkportisavailable(port): |
107 """return true if a port seems free to bind on localhost""" | 110 """return true if a port seems free to bind on localhost""" |
108 try: | 111 try: |
109 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | 112 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
802 vlog('# Handling keyboard interrupt') | 805 vlog('# Handling keyboard interrupt') |
803 cleanup() | 806 cleanup() |
804 raise | 807 raise |
805 | 808 |
806 ret = proc.wait() | 809 ret = proc.wait() |
807 if os.WIFEXITED(ret): | 810 if wifexited(ret): |
808 ret = os.WEXITSTATUS(ret) | 811 ret = os.WEXITSTATUS(ret) |
809 | 812 |
810 if proc.timeout: | 813 if proc.timeout: |
811 ret = 'timeout' | 814 ret = 'timeout' |
812 | 815 |
903 proc = Popen4(b'%s -c "%s/hghave %s"' % | 906 proc = Popen4(b'%s -c "%s/hghave %s"' % |
904 (self._shell, tdir, b' '.join(reqs)), | 907 (self._shell, tdir, b' '.join(reqs)), |
905 self._testtmp, 0, self._getenv()) | 908 self._testtmp, 0, self._getenv()) |
906 stdout, stderr = proc.communicate() | 909 stdout, stderr = proc.communicate() |
907 ret = proc.wait() | 910 ret = proc.wait() |
908 if os.WIFEXITED(ret): | 911 if wifexited(ret): |
909 ret = os.WEXITSTATUS(ret) | 912 ret = os.WEXITSTATUS(ret) |
910 if ret == 2: | 913 if ret == 2: |
911 print(stdout) | 914 print(stdout) |
912 sys.exit(1) | 915 sys.exit(1) |
913 | 916 |