Fix Bug #2486 - Allow SetOption('silent',True) - Previously this option could not...
authorWilliam Deegan <bill@baddogconsulting.com>
Sun, 20 Aug 2017 04:44:47 +0000 (21:44 -0700)
committerWilliam Deegan <bill@baddogconsulting.com>
Sun, 20 Aug 2017 04:44:47 +0000 (21:44 -0700)
src/CHANGES.txt
src/engine/SCons/Script/SConsOptions.py
test/option-s.py

index 1c99acf0bd1047cf19d2f58d57abba9c654401e9..47f74313b6973a9ebf7bec7a117a6413a8e13ed1 100644 (file)
@@ -37,6 +37,7 @@ may cause rebuilds.  In no case should rebuilds not happen.
       for many builds when upgrading to SCons 3.0
     - Fixed Bug #3027 - "Cross Compiling issue: cannot override ranlib"
     - Fixed Bug #3020 - "Download link in user guide wrong. python setup.py install --version-lib broken"
+    - Fixed Bug #2486 - Added SetOption('silent',True) - Previously this value was not allowed to be set.
 
   From Ibrahim Esmat:
     - Added the capability to build Windows Store Compatible libraries that can be used
index 288a7a5a671774f848b65cfa40e2f07b406950be..60d456e3e0eedd658357a205a5a194b465769eba 100644 (file)
@@ -139,6 +139,7 @@ class SConsValues(optparse.Values):
         'random',
         'stack_size',
         'warn',
+        'silent'
     ]
 
     def set_option(self, name, value):
index bbde2d140a16341db128bdf10cd93192a0a80a00..df7cd506a481c7005f9c83276230749b6732468a 100644 (file)
@@ -41,6 +41,11 @@ file.close()
 
 test.write('SConstruct', """
 MyBuild = Builder(action = r'%(_python_)s build.py $TARGET')
+
+silent = ARGUMENTS.get('QUIET',0)
+if silent:
+    SetOption('silent',True)
+
 env = Environment(BUILDERS = { 'MyBuild' : MyBuild })
 env.MyBuild(target = 'f1.out', source = 'f1.in')
 env.MyBuild(target = 'f2.out', source = 'f2.in')
@@ -72,6 +77,15 @@ test.subdir( 'sub' )
 test.write(['sub','SConstruct'],"")
 test.run(arguments = '-s -C sub', stdout = "" )
 
+test.unlink('f1.out')
+test.unlink('f2.out')
+
+test.run(arguments = 'QUIET=1 f1.out f2.out', stdout = "scons: Reading SConscript files ...\nscons: done reading SConscript files.\n")
+test.fail_test(not os.path.exists(test.workpath('f1.out')))
+test.fail_test(not os.path.exists(test.workpath('f2.out')))
+
+
+
 test.pass_test()