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') --- test/option--Q.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/option--Q.py') diff --git a/test/option--Q.py b/test/option--Q.py index da6d2e120..22087d0e0 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 v1.2.1