diff options
-rw-r--r-- | bin/scons-time.py (renamed from scripts/scons-time.py) | 0 | ||||
-rwxr-xr-x | runtest.py | 116 | ||||
-rw-r--r-- | testing/framework/TestSCons_time.py | 4 |
3 files changed, 39 insertions, 81 deletions
diff --git a/scripts/scons-time.py b/bin/scons-time.py index 6494349..6494349 100644 --- a/scripts/scons-time.py +++ b/bin/scons-time.py @@ -478,90 +478,49 @@ else: Test = SystemExecutor # --- start processing --- -if package: - - dirs = { - 'deb' : 'usr', - 'local-tar-gz' : None, - 'local-zip' : None, - 'rpm' : 'usr', - 'src-tar-gz' : '', - 'src-zip' : '', - 'tar-gz' : '', - 'zip' : '', - } - - # The hard-coded "python2.1" here is the library directory - # name on Debian systems, not an executable, so it's all right. - lib = { - 'deb' : os.path.join('python2.1', 'site-packages') - } - - if package not in dirs: - sys.stderr.write("Unknown package '%s'\n" % package) - sys.exit(2) - - test_dir = os.path.join(builddir, 'test-%s' % package) - - if dirs[package] is None: - scons_script_dir = test_dir - globs = glob.glob(os.path.join(test_dir, 'scons-local-*')) - if not globs: - sys.stderr.write("No `scons-local-*' dir in `%s'\n" % test_dir) - sys.exit(2) - scons_lib_dir = None - pythonpath_dir = globs[len(globs)-1] - elif sys.platform == 'win32': - scons_script_dir = os.path.join(test_dir, dirs[package], 'Scripts') - scons_lib_dir = os.path.join(test_dir, dirs[package]) - pythonpath_dir = scons_lib_dir - else: - scons_script_dir = os.path.join(test_dir, dirs[package], 'bin') - sconslib = lib.get(package, 'scons') - scons_lib_dir = os.path.join(test_dir, dirs[package], 'lib', sconslib) - pythonpath_dir = scons_lib_dir - scons_runtest_dir = builddir +sd = None +tools_dir = None +ld = None + +if not baseline or baseline == '.': + base = cwd +elif baseline == '-': + url = None + with os.popen("svn info 2>&1", "r") as p: + svn_info = p.read() + match = re.search(r'URL: (.*)', svn_info) + if match: + url = match.group(1) + if not url: + sys.stderr.write('runtest.py: could not find a URL:\n') + sys.stderr.write(svn_info) + sys.exit(1) + import tempfile + base = tempfile.mkdtemp(prefix='runtest-tmp-') + + command = 'cd %s && svn co -q %s' % (base, url) + base = os.path.join(base, os.path.split(url)[1]) + if printcommand: + print(command) + if execute_tests: + os.system(command) else: - sd = None - ld = None - - if not baseline or baseline == '.': - base = cwd - elif baseline == '-': - url = None - with os.popen("svn info 2>&1", "r") as p: - svn_info = p.read() - match = re.search(r'URL: (.*)', svn_info) - if match: - url = match.group(1) - if not url: - sys.stderr.write('runtest.py: could not find a URL:\n') - sys.stderr.write(svn_info) - sys.exit(1) - base = tempfile.mkdtemp(prefix='runtest-tmp-') - - command = 'cd %s && svn co -q %s' % (base, url) - - base = os.path.join(base, os.path.split(url)[1]) - if printcommand: - print(command) - if execute_tests: - os.system(command) - else: - base = baseline + base = baseline - scons_runtest_dir = base +scons_runtest_dir = base - if not external: - scons_script_dir = sd or os.path.join(base, 'scripts') - scons_lib_dir = ld or os.path.join(base, 'src', 'engine') - else: - scons_script_dir = sd or '' - scons_lib_dir = ld or '' +if not external: + scons_script_dir = sd or os.path.join(base, 'scripts') + scons_tools_dir = tools_dir or os.path.join(base, 'bin') + scons_lib_dir = ld or os.path.join(base, 'src', 'engine') +else: + scons_script_dir = sd or '' + scons_tools_dir = tools_dir or '' + scons_lib_dir = ld or '' - pythonpath_dir = scons_lib_dir +pythonpath_dir = scons_lib_dir if scons: # Let the version of SCons that the -x option pointed to find @@ -581,6 +540,7 @@ if external: os.environ['SCONS_RUNTEST_DIR'] = scons_runtest_dir os.environ['SCONS_SCRIPT_DIR'] = scons_script_dir +os.environ['SCONS_TOOLS_DIR'] = scons_tools_dir os.environ['SCONS_CWD'] = cwd os.environ['SCONS_VERSION'] = version diff --git a/testing/framework/TestSCons_time.py b/testing/framework/TestSCons_time.py index c6373eb..0573404 100644 --- a/testing/framework/TestSCons_time.py +++ b/testing/framework/TestSCons_time.py @@ -158,7 +158,7 @@ class TestSCons_time(TestCommon): self.orig_cwd = os.getcwd() try: - script_dir = os.environ['SCONS_SCRIPT_DIR'] + script_dir = os.environ['SCONS_TOOLS_DIR'] except KeyError: pass else: @@ -173,8 +173,6 @@ class TestSCons_time(TestCommon): if 'interpreter' not in kw: kw['interpreter'] = [python,] - if sys.version_info[0] < 3: - kw['interpreter'].append('-tt') if 'match' not in kw: kw['match'] = match_exact |