if re.compile("^" + res + "$", re.DOTALL).match(lines):
return 1
+if os.name == 'java':
+
+ python_executable = os.path.join(sys.prefix, 'jython')
+
+else:
+
+ python_executable = sys.executable
+
if sys.platform == 'win32':
def where_is(file, path=None, pathext=None):
import TestCmd
+python = TestCmd.python_executable
+
class TestFailed(Exception):
def __init__(self, args=None):
self.args = args
else:
kw['program'] = 'scons.py'
if not kw.has_key('interpreter') and not os.environ.get('SCONS_EXEC'):
- kw['interpreter'] = sys.executable
+ kw['interpreter'] = python
if not kw.has_key('match'):
kw['match'] = TestCmd.match_exact
if not kw.has_key('workdir'):
# is intended for use in the batch_test_command
# field in the Aegis project config file.
#
+# -P Python Use the specified Python interpreter.
+#
# -p package Test against the specified package.
#
# -q Quiet. By default, runtest.py prints the
scons_exec = None
output = None
+if os.name == 'java':
+ python = os.path.join(sys.prefix, 'jython')
+else:
+ python = sys.executable
+
cwd = os.getcwd()
-if sys.platform == 'win32':
- lib_dir = os.path.join(sys.exec_prefix, "lib")
+if sys.platform == 'win32' or os.name == 'java':
+ lib_dir = os.path.join(sys.exec_prefix, "Lib")
else:
# The hard-coded "python" here is the directory name,
# not an executable, so it's all right.
-d, --debug Run test scripts under the Python debugger.
-h, --help Print this message and exit.
-o FILE, --output FILE Print test results to FILE (Aegis format).
+ -P Python Use the specified Python interpreter.
-p PACKAGE, --package PACKAGE
Test against the specified PACKAGE:
deb Debian
-x SCRIPT, --exec SCRIPT Test SCRIPT.
"""
-opts, args = getopt.getopt(sys.argv[1:], "adho:p:qXx:",
+opts, args = getopt.getopt(sys.argv[1:], "adho:P:p:qXx:",
['all', 'debug', 'help', 'output=',
- 'package=', 'quiet', 'exec='])
+ 'package=', 'python=', 'quiet', 'exec='])
for o, a in opts:
if o == '-a' or o == '--all':
if not os.path.isabs(a):
a = os.path.join(cwd, a)
output = a
+ elif o == '-P' or o == '--python':
+ python = a
elif o == '-p' or o == '--package':
package = a
elif o == '-q' or o == '--quiet':
sys.stdout = Unbuffered(sys.stdout)
for t in tests:
- cmd = string.join([sys.executable, debug, t.abspath], " ")
+ cmd = string.join([python, debug, t.abspath], " ")
if printcmd:
sys.stdout.write(cmd + "\n")
s = os.system(cmd)
def items(self):
return self.d.items()
-python = sys.executable
+if os.name == 'java':
+ python = os.path.join(sys.prefix, 'jython')
+else:
+ python = sys.executable
class ActionTestCase(unittest.TestCase):
files. Since we're architecture independent, though, we don't
care about the machine architecture.
"""
- if os.name == 'posix':
+ osname = os.name
+ if osname == 'java':
+ osname = os._osType
+ if osname == 'posix':
if sys.platform == 'cygwin':
return 'cygwin'
return 'posix'
"""
full_name = 'SCons.Platform.' + name
if not sys.modules.has_key(full_name):
- try:
- file, path, desc = imp.find_module(name,
+ if os.name == 'java':
+ eval(full_name)
+ else:
+ try:
+ file, path, desc = imp.find_module(name,
sys.modules['SCons.Platform'].__path__)
- imp.load_module(full_name, file, path, desc)
- except ImportError:
- raise SCons.Errors.UserError, "No platform named '%s'" % name
- if file:
- file.close()
+ imp.load_module(full_name, file, path, desc)
+ except ImportError:
+ raise SCons.Errors.UserError, "No platform named '%s'" % name
+ if file:
+ file.close()
return sys.modules[full_name]
def DefaultToolList(platform, env):
def opt_debug(option, opt, value, parser):
if value == "pdb":
- args = [ sys.executable, "pdb.py" ] + \
+ if os.name == 'java':
+ python = os.path.join(sys.prefix, 'jython')
+ else:
+ python = sys.executable
+ args = [ python, "pdb.py" ] + \
filter(lambda x: x != "--debug=pdb", sys.argv)
if sys.platform == 'win32':
args[1] = os.path.join(sys.prefix, "lib", "pdb.py")
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import TestSCons
import TestCmd
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons(match=TestCmd.match_re)
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
test.write('SConstruct', """
def g(source, target, for_signature, env):
import sys
- python = sys.executable
+ python = r"%s"
return [[python, "build.py", "$TEMPFILE"] + source,
[python, "build.py"] + target + ["$TEMPFILE"]]
env.b(target = 'foo1.out', source = 'foo1.in')
env.b(target = 'foo2.out', source = 'foo2.in')
env.b(target = 'foo3.out', source = 'foo3.in')
-""")
+""" % python)
test.write('foo1.in', "foo1.in\n")
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import TestSCons
import sys
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
print env['LIBS']
print env['CCFLAGS']
print static_libs
-""" % (sys.executable, test_config))
+""" % (TestSCons.python, test_config))
test.write('SConstruct2', """
env = Environment(CPPPATH = [], LIBPATH = [], LIBS = [], CCFLAGS = '')
print env['LIBS']
print env['CCFLAGS']
print static_libs
-""" % (sys.executable, test_config))
+""" % (TestSCons.python, test_config))
good_stdout = test.wrap_stdout(read_str = """\
['/usr/include/fum', 'bar']
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_obj = '.obj'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_obj = '.obj'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
lib_ = ''
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
lib_ = ''
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
if sys.platform == 'win32':
_exe = '.exe'
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import string
import sys
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons(match = TestCmd.match_re_dotall)
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import TestSCons
import os
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
test = TestSCons.TestSCons()
-python = sys.executable
+python = TestSCons.python
test.subdir('sub1', 'sub2', 'sub3')
return float(re.match(match, line).group(1))
start_time = time.time()
-test.run(program=sys.executable, arguments='-c pass')
+test.run(program=TestSCons.python, arguments='-c pass')
overhead = time.time() - start_time
start_time = time.time()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
try:
import threading
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
test = TestSCons.TestSCons()
-python = sys.executable
+python = TestSCons.python
test.write('build.py', r"""
import sys
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()
test = TestSCons.TestSCons()
-python = sys.executable
+python = TestSCons.python
test.subdir('sub1', 'sub2', 'sub3')
test = TestSCons.TestSCons()
-python = sys.executable
+python = TestSCons.python
test.write('SConstruct', """
env = Environment(LIBS=['a'])
import TestCmd
import TestSCons
-#test = TestSCons.TestSCons(match = TestCmd.match_re)
test = TestSCons.TestSCons()
test.subdir('simple',
env=Environment(BUILDERS = {'Build' : Builder(action = '%s cat.py $TARGET $SOURCE')})
%s
-""" % (sys.executable, string.join(map(buildFileStr, file_names), '\n')))
+""" % (TestSCons.python, string.join(map(buildFileStr, file_names), '\n')))
test.run(arguments='.')
import sys
import TestSCons
-python = sys.executable
+python = TestSCons.python
test = TestSCons.TestSCons()