Changeset 504
- Timestamp:
- Mon Jul 28 13:40:45 2008
- Files:
-
- trunk/Makespec.py (modified) (diff)
- trunk/.hgignore (modified) (diff)
- trunk/buildtests/runtests.py (modified) (diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
trunk/Makespec.py
r503 r504 141 141 config = eval(open(os.path.join(HOME, 'config.dat'), 'r').read()) 142 142 except IOError: 143 raise SystemExit("Configfile is missing or unreadable. Please run Configure.py before building!") 143 print "You must run Configure.py before building!" 144 sys.exit(1) 144 145 145 146 if config['pythonVersion'] != sys.version: … … 227 228 g.add_option("-o", "--out", type="string", default=None, 228 229 dest="workdir", metavar="DIR", 229 help="generate the spec file in the specified directory " 230 "(default: current directory") 230 help="generate the spec file in the specified directory") 231 231 232 232 g = p.add_option_group('What to bundle, where to seach') … … 281 281 282 282 if not args: 283 p.error('Requires at least one scriptname file') 283 p.print_help() 284 sys.exit(1) 284 285 285 name = apply(main, (args,), opts.__dict__) 286 print "wrote %s" % name 286 nm = apply(main, (args,), opts.__dict__) 287 print "wrote %s" % nm 287 288 print "now run Build.py to build the executable" -
trunk/.hgignore
r503 r504 14 14 ^support/loader/run_d 15 15 ^source/linux/Makefile 16 ^buildtests/test[0-9]+.exe 16 17 ^patches -
trunk/buildtests/runtests.py
r503 r504 25 25 import shutil 26 26 27 HOME = '..'28 29 27 try: 30 28 here=os.path.dirname(os.path.abspath(__file__)) … … 70 68 71 69 72 def runtests(alltests, filters=None, configfile=None,run_executable=1):70 def runtests(alltests, filters=None, run_executable=1): 72 70 info = "Executing PyInstaller tests in: %s" % os.getcwd() 73 print "*" * min(80, len(info))71 print "*"*len(info) 73 71 print info 74 print "*" * min(80, len(info)) 75 76 OPTS = '' 77 if configfile: 78 # todo: quote correctly 79 OTPS = ' -c "%s"' % configfile 72 print "*"*len(info) 80 73 81 74 build_python = open("python_exe.build", "w") … … 96 89 _msg("BUILDING TEST", src) 97 90 test = os.path.splitext(os.path.basename(src))[0] 98 res = os.system(string.join([PYTHON, os.path.join(HOME, 'Build.py'), 99 OPTS, test+".spec"], 100 ' ')) 91 res = os.system('%s ../Build.py %s' % (PYTHON, test+".spec")) 92 # Run the test in a clean environment to make sure they're really self-contained 93 101 94 if run_executable: 102 95 _msg("EXECUTING TEST", src) 103 # Run the test in a clean environment to make sure they're104 # really self-contained105 96 del os.environ["PATH"] 106 97 res = os.system('dist%s%s%s.exe' % (test, os.sep, test)) … … 119 110 normal_tests = glob.glob('test*[0-9].py') 120 111 interactive_tests = glob.glob('test*[0-9]i.py') 112 args = sys.argv[1:] 121 113 122 from optparse import OptionParser 123 parser = OptionParser(usage="%prog [options]") 124 parser.add_option('-c', '--clean', action='store_true', 125 help='Clean up generated files') 126 parser.add_option('-i', '--interactive-tests', action='store_true', 127 help='Run interactive tests (default: run normal tests)') 128 parser.add_option('-n', '--no-run', action='store_true', 129 help='Do not run the built executables. ' 130 'Useful for cross builds.') 131 parser.add_option('-C', '--configfile', 132 default=os.path.join(HOME, 'config.dat'), 133 help='Name of generated configfile (default: %default)') 134 135 opts, args = parser.parse_args() 136 if args: 137 parser.error('Does not expect any arguments') 138 139 if opts.clean: 114 run_executable = 1 115 if "-n" in args: 116 # Do not run the built executables. Useful for cross builds. 117 run_executable = 0 118 if "-c" in args: 140 119 # only clean up 141 clean() 142 raise SystemExit() 143 144 if opts.interactive_tests: 120 tests = [] 121 elif "-i" in args: 145 122 print "Running interactive tests" 146 123 tests = interactive_tests 147 124 else: 148 tests = normal_tests149 125 print "Running normal tests (-i for interactive tests)" 126 tests = normal_tests 150 127 151 128 clean() 152 runtests(tests, configfile=opts.configfile, run_executable=not opts.no_run) 129 if tests: 130 runtests(tests, run_executable=run_executable)
