summaryrefslogtreecommitdiffstats
path: root/test/Repository
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 (GMT)
committerGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 (GMT)
commit22d352500f1cd6bd0c53d788a5dc44a1fefa676e (patch)
tree0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /test/Repository
parent75ac32ac8e32076e25b72a19eb56340cc585fa4e (diff)
downloadSCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.zip
SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.gz
SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.bz2
Move 2.0 changes collected in branches/pending back to trunk for further
development. Note that this set of changes is NOT backward-compatible; the trunk no longer works with Python 1.5.2, 2.0, or 2.1.
Diffstat (limited to 'test/Repository')
-rw-r--r--test/Repository/LIBPATH.py12
-rw-r--r--test/Repository/M4.py3
-rw-r--r--test/Repository/RMIC.py6
-rw-r--r--test/Repository/SConscript.py6
-rw-r--r--test/Repository/SharedLibrary.py3
-rw-r--r--test/Repository/VariantDir.py2
-rw-r--r--test/Repository/option-f.py3
-rw-r--r--test/Repository/targets.py2
8 files changed, 14 insertions, 23 deletions
diff --git a/test/Repository/LIBPATH.py b/test/Repository/LIBPATH.py
index 0eb2da2..c95d29a 100644
--- a/test/Repository/LIBPATH.py
+++ b/test/Repository/LIBPATH.py
@@ -24,7 +24,6 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import string
import TestSCons
test = TestSCons.TestSCons()
@@ -40,7 +39,6 @@ workpath_bar_zzz = test.workpath('bar', 'zzz')
workpath_work = test.workpath('work')
test.write(['work', 'SConstruct'], r"""
-import string
env_zzz = Environment(LIBPATH = ['.', 'zzz'])
env_yyy = Environment(LIBPATH = ['yyy', '.'])
aaa_exe = env_zzz.Program('aaa', 'aaa.c')
@@ -49,7 +47,7 @@ def write_LIBDIRFLAGS(env, target, source):
pre = env.subst('$LIBDIRPREFIX')
suf = env.subst('$LIBDIRSUFFIX')
f = open(str(target[0]), 'wb')
- for arg in string.split(env.subst('$_LIBDIRFLAGS', target=target)):
+ for arg in env.subst('$_LIBDIRFLAGS', target=target).split():
if arg[:len(pre)] == pre:
arg = arg[len(pre):]
if arg[-len(suf):] == suf:
@@ -100,13 +98,13 @@ test.run(chdir = 'work', options = opts, arguments = ".")
dirs = ['.', workpath_foo, workpath_bar,
'zzz', workpath_foo_zzz, workpath_bar_zzz]
test.fail_test(test.read(['work', 'zzz.out']) !=
- string.join(dirs, '\n') + '\n')
+ '\n'.join(dirs) + '\n')
#dirs = [workpath_bar_yyy, '.', workpath_foo, workpath_bar]
dirs = ['yyy', workpath_foo_yyy, workpath_bar_yyy,
'.', workpath_foo, workpath_bar]
test.fail_test(test.read(['work', 'yyy.out']) !=
- string.join(dirs, '\n') + '\n')
+ '\n'.join(dirs) + '\n')
#
test.run(chdir = 'work', options = '-c', arguments = ".")
@@ -120,13 +118,13 @@ test.run(chdir = 'work', options = opts, arguments = ".")
dirs = ['.', workpath_foo, workpath_bar,
'zzz', workpath_foo_zzz, workpath_bar_zzz]
test.fail_test(test.read(['work', 'zzz.out']) !=
- string.join(dirs, '\n') + '\n')
+ '\n'.join(dirs) + '\n')
#dirs = ['yyy', workpath_bar_yyy, '.', workpath_foo, workpath_bar]
dirs = ['yyy', workpath_foo_yyy, workpath_bar_yyy,
'.', workpath_foo, workpath_bar]
test.fail_test(test.read(['work', 'yyy.out']) !=
- string.join(dirs, '\n') + '\n')
+ '\n'.join(dirs) + '\n')
#
test.pass_test()
diff --git a/test/Repository/M4.py b/test/Repository/M4.py
index b3ed755..fe1eb7b 100644
--- a/test/Repository/M4.py
+++ b/test/Repository/M4.py
@@ -39,10 +39,9 @@ test = TestSCons.TestSCons()
test.subdir('work', 'repository', ['repository', 'src'])
test.write('mym4.py', """
-import string
import sys
contents = sys.stdin.read()
-sys.stdout.write(string.replace(contents, 'M4', 'mym4.py'))
+sys.stdout.write(contents.replace('M4', 'mym4.py'))
sys.exit(0)
""")
diff --git a/test/Repository/RMIC.py b/test/Repository/RMIC.py
index e00bb43..b214b4b 100644
--- a/test/Repository/RMIC.py
+++ b/test/Repository/RMIC.py
@@ -60,13 +60,12 @@ opts = '-Y ' + test.workpath('rep1')
#
test.write(['rep1', 'SConstruct'], """
-import string
env = Environment(tools = ['javac', 'rmic'],
JAVAC = r'%s',
RMIC = r'%s')
classes = env.Java(target = 'classes', source = 'src')
# Brute-force removal of the "Hello" class.
-classes = filter(lambda c: string.find(str(c), 'Hello') == -1, classes)
+classes = [c for c in classes if str(c).find('Hello') == -1]
env.RMIC(target = 'outdir', source = classes)
""" % (javac, rmic))
@@ -329,13 +328,12 @@ test.up_to_date(chdir = 'work2', options = opts, arguments = ".")
#
test.write(['work3', 'SConstruct'], """
-import string
env = Environment(tools = ['javac', 'rmic'],
JAVAC = r'%s',
RMIC = r'%s')
classes = env.Java(target = 'classes', source = 'src')
# Brute-force removal of the "Hello" class.
-classes = filter(lambda c: string.find(str(c), 'Hello') == -1, classes)
+classes = [c for c in classes if str(c).find('Hello') == -1]
rmi_classes = env.RMIC(target = 'outdir', source = classes)
Local(rmi_classes)
""" % (javac, rmic))
diff --git a/test/Repository/SConscript.py b/test/Repository/SConscript.py
index fb4ef08..22956ac 100644
--- a/test/Repository/SConscript.py
+++ b/test/Repository/SConscript.py
@@ -61,10 +61,9 @@ SConscript('src/SConscript')
test.write(['rep1', 'src', 'SConscript'], """\
def cat(env, source, target):
target = str(target[0])
- source = map(str, source)
f = open(target, "wb")
for src in source:
- f.write(open(src, "rb").read())
+ f.write(open(str(src), "rb").read())
f.close()
env = Environment(BUILDERS={'Cat':Builder(action=cat)})
env.Cat(target = 'foo', source = ['aaa.in', 'bbb.in', 'ccc.in'])
@@ -98,10 +97,9 @@ SConscript('src/SConscript')
test.write(['rep2', 'src', 'SConscript'], """\
def cat(env, source, target):
target = str(target[0])
- source = map(str, source)
f = open(target, "wb")
for src in source:
- f.write(open(src, "rb").read())
+ f.write(open(str(src), "rb").read())
f.close()
env = Environment(BUILDERS={'Cat':Builder(action=cat)})
env.Cat(target = 'foo', source = ['aaa.in', 'bbb.in', 'ccc.in'])
diff --git a/test/Repository/SharedLibrary.py b/test/Repository/SharedLibrary.py
index fbd135e..51142aa 100644
--- a/test/Repository/SharedLibrary.py
+++ b/test/Repository/SharedLibrary.py
@@ -30,7 +30,6 @@ object files built in a repository.
"""
import os
-import string
import sys
import TestSCons
@@ -115,7 +114,7 @@ if os.name == 'posix':
os.environ['DYLD_LIBRARY_PATH'] = test.workpath('work')
else:
os.environ['LD_LIBRARY_PATH'] = test.workpath('work')
-if string.find(sys.platform, 'irix') != -1:
+if sys.platform.find('irix') != -1:
os.environ['LD_LIBRARYN32_PATH'] = test.workpath('work')
test.run(program = test.workpath('work', 'prog'),
diff --git a/test/Repository/VariantDir.py b/test/Repository/VariantDir.py
index 0abda0b..ec723c8 100644
--- a/test/Repository/VariantDir.py
+++ b/test/Repository/VariantDir.py
@@ -47,7 +47,7 @@ SConscript('build1/SConscript')
test.write(['repository', 'src', 'SConscript'], r"""
def cat(env, source, target):
target = str(target[0])
- source = map(str, source)
+ source = list(map(str, source))
print 'cat(%s) > %s' % (source, target)
f = open(target, "wb")
for src in source:
diff --git a/test/Repository/option-f.py b/test/Repository/option-f.py
index aec9418..8511f6a 100644
--- a/test/Repository/option-f.py
+++ b/test/Repository/option-f.py
@@ -43,10 +43,9 @@ test.write(['repository', 'SConstruct'], """\
Repository(r'%s')
def cat(env, source, target):
target = str(target[0])
- source = map(str, source)
f = open(target, "wb")
for src in source:
- f.write(open(src, "rb").read())
+ f.write(open(str(src), "rb").read())
f.close()
env = Environment(BUILDERS={'Build':Builder(action=cat)})
diff --git a/test/Repository/targets.py b/test/Repository/targets.py
index d395047..62f4785 100644
--- a/test/Repository/targets.py
+++ b/test/Repository/targets.py
@@ -42,7 +42,7 @@ opts = "-Y " + test.workpath('repository')
test.write(['repository', 'SConstruct'], """
def cat(env, source, target):
target = str(target[0])
- source = map(str, source)
+ source = list(map(str, source))
print 'cat(%s) > %s' % (source, target)
f = open(target, "wb")
for src in source: