mirror of
https://github.com/kennethreitz-archive/pyinstaller.git
synced 2026-06-05 23:50:17 +00:00
Fix python_exe.build generation and fix tests using buildtime python
+ be more verbose git-svn-id: http://svn.pyinstaller.org/trunk@563 8dd32b29-ccff-0310-8a9a-9233e24343b1
This commit is contained in:
+10
-6
@@ -22,6 +22,7 @@
|
||||
# particual test.
|
||||
|
||||
import os, sys, glob, string
|
||||
import pprint
|
||||
import shutil
|
||||
|
||||
HOME = '..'
|
||||
@@ -87,8 +88,8 @@ def runtests(alltests, filters=None, configfile=None, run_executable=1):
|
||||
OTPS = ' -c "%s"' % configfile
|
||||
|
||||
build_python = open("python_exe.build", "w")
|
||||
build_python.write(sys.executable)
|
||||
build_python.write("debug=%s" % __debug__)
|
||||
build_python.write(sys.executable+"\n")
|
||||
build_python.write("debug=%s" % __debug__+"\n")
|
||||
build_python.close()
|
||||
if not filters:
|
||||
tests = alltests
|
||||
@@ -102,9 +103,11 @@ def runtests(alltests, filters=None, configfile=None, run_executable=1):
|
||||
for test in tests:
|
||||
test = os.path.splitext(os.path.basename(test))[0]
|
||||
_msg("BUILDING TEST", test)
|
||||
res = os.system(string.join([PYTHON, PYOPTS, os.path.join(HOME, 'Build.py'),
|
||||
OPTS, test+".spec"],
|
||||
' '))
|
||||
prog = string.join([PYTHON, PYOPTS, os.path.join(HOME, 'Build.py'),
|
||||
OPTS, test+".spec"],
|
||||
' ')
|
||||
print "BUILDING:", prog
|
||||
res = os.system(prog)
|
||||
if run_executable:
|
||||
_msg("EXECUTING TEST", test)
|
||||
# Run the test in a clean environment to make sure they're
|
||||
@@ -113,6 +116,7 @@ def runtests(alltests, filters=None, configfile=None, run_executable=1):
|
||||
prog = os.path.join('dist', test + '.exe')
|
||||
if not os.path.exists(prog):
|
||||
prog = os.path.join('dist', test, test + '.exe')
|
||||
print "RUNNING:", prog
|
||||
res = os.system(prog)
|
||||
os.environ["PATH"] = path
|
||||
|
||||
@@ -122,7 +126,7 @@ def runtests(alltests, filters=None, configfile=None, run_executable=1):
|
||||
else:
|
||||
_msg("TEST", test, "FAILED", short=1)
|
||||
counter["failed"].append(test)
|
||||
print counter
|
||||
pprint.pprint(counter)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -26,7 +26,7 @@ if sys.version_info[:2] >= (2, 5):
|
||||
print "#"*50
|
||||
import xml.etree.cElementTree as cET
|
||||
|
||||
pyexe = open("python_exe.build").read()
|
||||
pyexe = open("python_exe.build").readline().strip()
|
||||
|
||||
out = subprocess.Popen(pyexe + ' -c "import xml.etree.cElementTree as cET; print dir(cET)"',
|
||||
stdout=subprocess.PIPE, shell=True).stdout.read().strip()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
print "test_getfilesystemencoding sys.getfilesystemencoding()"
|
||||
print "test_getfilesystemencoding"
|
||||
|
||||
import sys
|
||||
if sys.version_info[:2] >= (2, 5):
|
||||
@@ -24,11 +24,11 @@ if sys.version_info[:2] >= (2, 5):
|
||||
|
||||
assert type(email.Header) == email.LazyImporter
|
||||
|
||||
pyexe = open("python_exe.build").read()
|
||||
pyexe = open("python_exe.build").readline().strip()
|
||||
out = subprocess.Popen(pyexe + ' -c "import sys; print sys.getfilesystemencoding()"',
|
||||
stdout=subprocess.PIPE, shell=True).stdout.read().strip()
|
||||
assert str(sys.getfilesystemencoding()) == out, (str(sys.getfilesystemencoding()), out)
|
||||
|
||||
print "test_getfilesystemencoding DONE"
|
||||
else:
|
||||
print "Python 2.5 test14 skipped"
|
||||
print "Python < 2.5 test14 skipped"
|
||||
|
||||
Reference in New Issue
Block a user