summaryrefslogtreecommitdiff
path: root/test/Deprecated
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-03-12 18:58:48 -0400
committerWilliam Deegan <bill@baddogconsulting.com>2017-03-12 18:58:48 -0400
commit586d8aee8276b588bd6dff89b7766d08b76a5b0a (patch)
treeb81d8bd98b52e803adc58af03288a1c07cfa4e99 /test/Deprecated
parent721d89d7df5b915cb036aa5adfcf979158baf82e (diff)
downloadscons-586d8aee8276b588bd6dff89b7766d08b76a5b0a.tar.gz
no more cmp in py3, define a compare function and use it. Also specify DefaultEnvironment(tools=[]) to speed up the test slightly
Diffstat (limited to 'test/Deprecated')
-rw-r--r--test/Deprecated/Options/Options.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/Deprecated/Options/Options.py b/test/Deprecated/Options/Options.py
index e435b9ef..2a2d26c6 100644
--- a/test/Deprecated/Options/Options.py
+++ b/test/Deprecated/Options/Options.py
@@ -29,6 +29,7 @@ import TestSCons
test = TestSCons.TestSCons(match = TestSCons.match_re_dotall)
test.write('SConstruct', """
+DefaultEnvironment(tools=[])
env = Environment()
print(env['CC'])
print(" ".join(env['CCFLAGS']))
@@ -38,6 +39,7 @@ test.run()
cc, ccflags = test.stdout().split('\n')[1:3]
test.write('SConstruct', """
+DefaultEnvironment(tools=[])
# test validator. Change a key and add a new one to the environment
def validator(key, value, environ):
environ[key] = "v"
@@ -208,6 +210,8 @@ Use scons -H for help about command-line options.
# Test saving of options and multi loading
#
test.write('SConstruct', """
+DefaultEnvironment(tools=[])
+
opts = Options(['custom.py', 'options.saved'])
opts.Add('RELEASE_BUILD',
'Set to 1 to build a release build',
@@ -259,6 +263,8 @@ checkSave('options.saved', {'DEBUG_BUILD':3, 'RELEASE_BUILD':1})
# Load no options from file(s)
# Used to test for correct output in save option file
test.write('SConstruct', """
+DefaultEnvironment(tools=[])
+
opts = Options()
opts.Add('RELEASE_BUILD',
'Set to 1 to build a release build',
@@ -305,6 +311,8 @@ check(['0','0'])
checkSave('options.saved',{'DEBUG_BUILD':0, 'LISTOPTION_TEST':'a,b'})
test.write('SConstruct', """
+DefaultEnvironment(tools=[])
+
opts = Options('custom.py')
opts.Add('RELEASE_BUILD',
'Set to 1 to build a release build',
@@ -326,7 +334,10 @@ opts.Add('UNSPECIFIED',
env = Environment(options=opts)
-Help('Variables settable in custom.py or on the command line:\\n' + opts.GenerateHelpText(env,sort=cmp))
+def compare(a,b):
+ return a < b
+
+Help('Variables settable in custom.py or on the command line:\\n' + opts.GenerateHelpText(env,sort=compare))
""")
@@ -357,6 +368,8 @@ Use scons -H for help about command-line options.
stderr=warnings)
test.write('SConstruct', """
+DefaultEnvironment(tools=[])
+
import SCons.Options
env1 = Environment(options = Options())
env2 = Environment(options = SCons.Options.Options())