From 8d2fcb82a1c7e538f9b95aab59e554c671a9f7f3 Mon Sep 17 00:00:00 2001 From: naufraghi Date: Wed, 19 Nov 2008 09:19:17 +0000 Subject: [PATCH] Propagate and check '-O' option git-svn-id: http://svn.pyinstaller.org/trunk@551 8dd32b29-ccff-0310-8a9a-9233e24343b1 --- buildtests/runtests.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/buildtests/runtests.py b/buildtests/runtests.py index 415aed7..ed12c1b 100755 --- a/buildtests/runtests.py +++ b/buildtests/runtests.py @@ -35,6 +35,10 @@ PYTHON = sys.executable if sys.platform[:3] == 'win': if string.find(PYTHON, ' ') > -1: PYTHON='"%s"' % PYTHON +if __debug__: + PYOPTS = "" +else: + PYOPTS = "-O" # files/globs to clean up CLEANUP = """python_exe.build @@ -84,6 +88,7 @@ def runtests(alltests, filters=None, configfile=None, run_executable=1): build_python = open("python_exe.build", "w") build_python.write(sys.executable) + build_python.write("debug=%s" % __debug__) build_python.close() if not filters: tests = alltests @@ -97,7 +102,7 @@ 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, os.path.join(HOME, 'Build.py'), + res = os.system(string.join([PYTHON, PYOPTS, os.path.join(HOME, 'Build.py'), OPTS, test+".spec"], ' ')) if run_executable: