diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-03-12 22:58:48 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-03-12 22:58:48 (GMT) |
commit | 77640a33ca2963d88320208895a3de193712566b (patch) | |
tree | b81d8bd98b52e803adc58af03288a1c07cfa4e99 /test/Deprecated | |
parent | 60e00b62a9c494cc9c31e7cb95f65d0c22b9e777 (diff) | |
download | SCons-77640a33ca2963d88320208895a3de193712566b.zip SCons-77640a33ca2963d88320208895a3de193712566b.tar.gz SCons-77640a33ca2963d88320208895a3de193712566b.tar.bz2 |
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.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/Deprecated/Options/Options.py b/test/Deprecated/Options/Options.py index e435b9e..2a2d26c 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()) |