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:
naufraghi
2008-12-11 15:46:23 +00:00
parent 9060db5bf6
commit 0694f5f237
3 changed files with 14 additions and 10 deletions
+10 -6
View File
@@ -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__':
+1 -1
View File
@@ -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()
+3 -3
View File
@@ -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"