Author: mattip <[email protected]>
Branch:
Changeset: r72040:9cf39ce9af62
Date: 2014-06-13 12:12 +0300
http://bitbucket.org/pypy/pypy/changeset/9cf39ce9af62/
Log: fix test for windows
diff --git a/pypy/tool/release/test/test_package.py
b/pypy/tool/release/test/test_package.py
--- a/pypy/tool/release/test/test_package.py
+++ b/pypy/tool/release/test/test_package.py
@@ -18,9 +18,16 @@
pypy_c = py.path.local(pypydir).join('goal', basename)
if not pypy_c.check():
if sys.platform == 'win32':
- assert False, "test on win32 requires exe"
- pypy_c.write("#!/bin/sh")
- pypy_c.chmod(0755)
+ import os, shutil
+ for d in os.environ['PATH'].split(';'):
+ if os.path.exists(os.path.join(d, 'cmd.exe')):
+ shutil.copy(os.path.join(d, 'cmd.exe'), str(pypy_c))
+ break
+ else:
+ assert False, 'could not find cmd.exe'
+ else:
+ pypy_c.write("#!/bin/sh")
+ pypy_c.chmod(0755)
fake_pypy_c = True
else:
fake_pypy_c = False
@@ -108,7 +115,7 @@
check(pypy, 0755)
def test_generate_license():
- from os.path import dirname, abspath
+ from os.path import dirname, abspath, join
class Options(object):
pass
options = Options()
@@ -116,7 +123,7 @@
options.no_tk = False
if sys.platform == 'win32':
# as on buildbot YMMV
- options.license_base = os.path.join(basedir, r'..\..\..\local')
+ options.license_base = join(basedir, r'..\..\..\local')
else:
options.license_base = '/usr/share/doc'
license = package.generate_license(py.path.local(basedir), options)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit