From 0bc1e3d2bb2e413b7e30b72a1fed0354972d3fac Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 12 Oct 2019 16:39:21 -0700 Subject: added test and updated docs to indicate that some initial progress output will still be output if you set SetOption('no_progress') --- src/CHANGES.txt | 2 +- src/engine/SCons/Script/Main.xml | 4 ++++ src/engine/SCons/Script/SConsOptions.py | 3 +++ test/option--Q.py | 24 ++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 59b5dec..063cfa2 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -7,7 +7,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Daniel Moody: - - Add no_progress option as a set-able option + - Add no_progress (-Q) option as a set-able option From Mathew Robinson: diff --git a/src/engine/SCons/Script/Main.xml b/src/engine/SCons/Script/Main.xml index f04d565..bd72949 100644 --- a/src/engine/SCons/Script/Main.xml +++ b/src/engine/SCons/Script/Main.xml @@ -794,6 +794,10 @@ which corresponds to --silent. which corresponds to -Q. + + Note: The initial progress output will still be output as this is done before the SConstruct/SConscript which contains the SetOption is processed + scons: Reading SConscript files ... + diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index 7bb6bf6..4c00066 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/engine/SCons/Script/SConsOptions.py @@ -198,6 +198,9 @@ class SConsValues(optparse.Values): value = [value] value = self.__SConscript_settings__.get(name, []) + value SCons.Warnings.process_warn_strings(value) + elif name == 'no_progress': + SCons.Script.Main.progress_display.set_mode(False) + self.__SConscript_settings__[name] = value diff --git a/test/option--Q.py b/test/option--Q.py index da6d2e1..22087d0 100644 --- a/test/option--Q.py +++ b/test/option--Q.py @@ -31,6 +31,8 @@ import TestSCons _python_ = TestSCons._python_ test = TestSCons.TestSCons() +test.verbose_set(1) + test.write('build.py', r""" import sys @@ -40,6 +42,15 @@ file.close() """) test.write('SConstruct', """ + +AddOption('--use_SetOption', action='store_true', dest='setoption', default=False) + +use_setoption=GetOption('setoption') + +if use_setoption: + # SetOption('no_progress', False) + pass + MyBuild = Builder(action = r'%(_python_)s build.py $TARGET') env = Environment(BUILDERS = { 'MyBuild' : MyBuild }) env.MyBuild(target = 'f1.out', source = 'f1.in') @@ -64,6 +75,19 @@ Removed f2.out test.fail_test(os.path.exists(test.workpath('f1.out'))) test.fail_test(os.path.exists(test.workpath('f2.out'))) + +# When set via a SetOption, it will happen after the initial output of +# scons: Reading SConscript files ... +# but remaining status/progress output will not be output +test.run(arguments = '--use_SetOption f1.out f2.out', stdout = """\ +scons: Reading SConscript files ... +%(_python_)s build.py f1.out +%(_python_)s build.py f2.out +""" % locals()) +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() # Local Variables: -- cgit v0.12