summaryrefslogtreecommitdiffstats
path: root/test/Variables
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/Variables
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/Variables')
-rw-r--r--test/Variables/BoolVariable.py3
-rw-r--r--test/Variables/EnumVariable.py3
-rw-r--r--test/Variables/ListVariable.py3
-rw-r--r--test/Variables/PackageVariable.py3
-rw-r--r--test/Variables/PathVariable.py3
-rw-r--r--test/Variables/Variables.py32
6 files changed, 19 insertions, 28 deletions
diff --git a/test/Variables/BoolVariable.py b/test/Variables/BoolVariable.py
index 3630fc8..37130c0 100644
--- a/test/Variables/BoolVariable.py
+++ b/test/Variables/BoolVariable.py
@@ -29,7 +29,6 @@ Test the BoolVariable canned Variable type.
"""
import os.path
-import string
try:
True, False
@@ -44,7 +43,7 @@ test = TestSCons.TestSCons()
SConstruct_path = test.workpath('SConstruct')
def check(expect):
- result = string.split(test.stdout(), '\n')
+ result = test.stdout().split('\n')
assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect)
diff --git a/test/Variables/EnumVariable.py b/test/Variables/EnumVariable.py
index 241a9b9..bb85f4c 100644
--- a/test/Variables/EnumVariable.py
+++ b/test/Variables/EnumVariable.py
@@ -29,7 +29,6 @@ Test the EnumVariable canned Variable type.
"""
import os.path
-import string
import TestSCons
@@ -38,7 +37,7 @@ test = TestSCons.TestSCons()
SConstruct_path = test.workpath('SConstruct')
def check(expect):
- result = string.split(test.stdout(), '\n')
+ result = test.stdout().split('\n')
assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect)
diff --git a/test/Variables/ListVariable.py b/test/Variables/ListVariable.py
index 2dc7d4b..e5be625 100644
--- a/test/Variables/ListVariable.py
+++ b/test/Variables/ListVariable.py
@@ -29,7 +29,6 @@ Test the ListVariable canned Variable type.
"""
import os
-import string
import TestSCons
@@ -38,7 +37,7 @@ test = TestSCons.TestSCons()
SConstruct_path = test.workpath('SConstruct')
def check(expect):
- result = string.split(test.stdout(), '\n')
+ result = test.stdout().split('\n')
r = result[1:len(expect)+1]
assert r == expect, (r, expect)
diff --git a/test/Variables/PackageVariable.py b/test/Variables/PackageVariable.py
index d626055..6ad7fc1 100644
--- a/test/Variables/PackageVariable.py
+++ b/test/Variables/PackageVariable.py
@@ -29,7 +29,6 @@ Test the PackageVariable canned Variable type.
"""
import os.path
-import string
try:
True, False
@@ -44,7 +43,7 @@ test = TestSCons.TestSCons()
SConstruct_path = test.workpath('SConstruct')
def check(expect):
- result = string.split(test.stdout(), '\n')
+ result = test.stdout().split('\n')
assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect)
diff --git a/test/Variables/PathVariable.py b/test/Variables/PathVariable.py
index 447d369..bfe82ba 100644
--- a/test/Variables/PathVariable.py
+++ b/test/Variables/PathVariable.py
@@ -30,7 +30,6 @@ various canned validators.
"""
import os.path
-import string
import TestSCons
@@ -39,7 +38,7 @@ test = TestSCons.TestSCons()
SConstruct_path = test.workpath('SConstruct')
def check(expect):
- result = string.split(test.stdout(), '\n')
+ result = test.stdout().split('\n')
assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect)
#### test PathVariable ####
diff --git a/test/Variables/Variables.py b/test/Variables/Variables.py
index a6ed74f..454e32e 100644
--- a/test/Variables/Variables.py
+++ b/test/Variables/Variables.py
@@ -25,23 +25,19 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
-import string
test = TestSCons.TestSCons()
test.write('SConstruct', """
-import string
env = Environment()
print env['CC']
-print string.join(env['CCFLAGS'])
+print " ".join(env['CCFLAGS'])
Default(env.Alias('dummy', None))
""")
test.run()
-cc, ccflags = string.split(test.stdout(), '\n')[1:3]
+cc, ccflags = test.stdout().split('\n')[1:3]
test.write('SConstruct', """
-import string
-
# test validator. Change a key and add a new one to the environment
def validator(key, value, environ):
environ[key] = "v"
@@ -106,15 +102,15 @@ Help('Variables settable in custom.py or on the command line:\\n' + opts.Generat
print env['RELEASE_BUILD']
print env['DEBUG_BUILD']
print env['CC']
-print string.join(env['CCFLAGS'])
+print " ".join(env['CCFLAGS'])
print env['VALIDATE']
print env['valid_key']
# unspecified variables should not be set:
-assert not env.has_key('UNSPECIFIED')
+assert 'UNSPECIFIED' not in env
# undeclared variables should be ignored:
-assert not env.has_key('UNDECLARED')
+assert 'UNDECLARED' not in env
# calling Update() should not effect variables that
# are not declared on the variables object:
@@ -128,26 +124,26 @@ Default(env.Alias('dummy', None))
""")
def check(expect):
- result = string.split(test.stdout(), '\n')
+ result = test.stdout().split('\n')
assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect)
test.run()
-check(['0', '1', cc, string.strip(ccflags + ' -g'), 'v', 'v'])
+check(['0', '1', cc, (ccflags + ' -g').strip(), 'v', 'v'])
test.run(arguments='RELEASE_BUILD=1')
-check(['1', '1', cc, string.strip(ccflags + ' -O -g'), 'v', 'v'])
+check(['1', '1', cc, (ccflags + ' -O -g').strip(), 'v', 'v'])
test.run(arguments='RELEASE_BUILD=1 DEBUG_BUILD=0')
-check(['1', '0', cc, string.strip(ccflags + ' -O'), 'v', 'v'])
+check(['1', '0', cc, (ccflags + ' -O').strip(), 'v', 'v'])
test.run(arguments='CC=not_a_c_compiler')
-check(['0', '1', 'not_a_c_compiler', string.strip(ccflags + ' -g'), 'v', 'v'])
+check(['0', '1', 'not_a_c_compiler', (ccflags + ' -g').strip(), 'v', 'v'])
test.run(arguments='UNDECLARED=foo')
-check(['0', '1', cc, string.strip(ccflags + ' -g'), 'v', 'v'])
+check(['0', '1', cc, (ccflags + ' -g').strip(), 'v', 'v'])
test.run(arguments='CCFLAGS=--taco')
-check(['0', '1', cc, string.strip(ccflags + ' -g'), 'v', 'v'])
+check(['0', '1', cc, (ccflags + ' -g').strip(), 'v', 'v'])
test.write('custom.py', """
DEBUG_BUILD=0
@@ -155,10 +151,10 @@ RELEASE_BUILD=1
""")
test.run()
-check(['1', '0', cc, string.strip(ccflags + ' -O'), 'v', 'v'])
+check(['1', '0', cc, (ccflags + ' -O').strip(), 'v', 'v'])
test.run(arguments='DEBUG_BUILD=1')
-check(['1', '1', cc, string.strip(ccflags + ' -O -g'), 'v', 'v'])
+check(['1', '1', cc, (ccflags + ' -O -g').strip(), 'v', 'v'])
test.run(arguments='-h',
stdout = """\