diff options
author | Mats Wichmann <mats@linux.com> | 2021-06-18 17:22:16 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2021-06-18 17:22:16 (GMT) |
commit | a87c9c461ab1b0e05321ba2649d1e853821be5c2 (patch) | |
tree | 76246ef2a9b3a6c0ef3da57a541e2e52baa1163a /test/option | |
parent | 62e45b7012767a6d3d7ff033c8b4910e275a7501 (diff) | |
download | SCons-a87c9c461ab1b0e05321ba2649d1e853821be5c2.zip SCons-a87c9c461ab1b0e05321ba2649d1e853821be5c2.tar.gz SCons-a87c9c461ab1b0e05321ba2649d1e853821be5c2.tar.bz2 |
Change warnings behavior of missing SConscript
If SConscript() is called with must_exist=False, accept the user's
will without issuing a warning about the file being missing.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/option')
-rw-r--r-- | test/option/option-f.py | 130 | ||||
-rw-r--r-- | test/option/warn-missing-sconscript.py | 9 |
2 files changed, 87 insertions, 52 deletions
diff --git a/test/option/option-f.py b/test/option/option-f.py index 94e7e46..e1343a6 100644 --- a/test/option/option-f.py +++ b/test/option/option-f.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os @@ -54,56 +53,93 @@ print("Build2 "+ os.getcwd()) wpath = test.workpath() -test.run(arguments = '-f SConscript .', - stdout = test.wrap_stdout(read_str = 'SConscript %s\n' % wpath, - build_str = "scons: `.' is up to date.\n")) - -test.run(arguments = '-f %s .' % subdir_BuildThis, - stdout = test.wrap_stdout(read_str = 'subdir/BuildThis %s\n' % wpath, - build_str = "scons: `.' is up to date.\n")) - -test.run(arguments = '--file=SConscript .', - stdout = test.wrap_stdout(read_str = 'SConscript %s\n' % wpath, - build_str = "scons: `.' is up to date.\n")) - -test.run(arguments = '--file=%s .' % subdir_BuildThis, - stdout = test.wrap_stdout(read_str = 'subdir/BuildThis %s\n' % wpath, - build_str = "scons: `.' is up to date.\n")) - -test.run(arguments = '--makefile=SConscript .', - stdout = test.wrap_stdout(read_str = 'SConscript %s\n' % wpath, - build_str = "scons: `.' is up to date.\n")) - -test.run(arguments = '--makefile=%s .' % subdir_BuildThis, - stdout = test.wrap_stdout(read_str = 'subdir/BuildThis %s\n' % wpath, - build_str = "scons: `.' is up to date.\n")) - -test.run(arguments = '--sconstruct=SConscript .', - stdout = test.wrap_stdout(read_str = 'SConscript %s\n' % wpath, - build_str = "scons: `.' is up to date.\n")) - -test.run(arguments = '--sconstruct=%s .' % subdir_BuildThis, - stdout = test.wrap_stdout(read_str = 'subdir/BuildThis %s\n' % wpath, - build_str = "scons: `.' is up to date.\n")) - -test.run(arguments = '-f - .', stdin = """ +test.run( + arguments='-f SConscript .', + stdout=test.wrap_stdout( + read_str='SConscript %s\n' % wpath, build_str="scons: `.' is up to date.\n" + ), +) + +test.run( + arguments='-f %s .' % subdir_BuildThis, + stdout=test.wrap_stdout( + read_str='subdir/BuildThis %s\n' % wpath, + build_str="scons: `.' is up to date.\n", + ), +) + +test.run( + arguments='--file=SConscript .', + stdout=test.wrap_stdout( + read_str='SConscript %s\n' % wpath, build_str="scons: `.' is up to date.\n" + ), +) + +test.run( + arguments='--file=%s .' % subdir_BuildThis, + stdout=test.wrap_stdout( + read_str='subdir/BuildThis %s\n' % wpath, + build_str="scons: `.' is up to date.\n", + ), +) + +test.run( + arguments='--makefile=SConscript .', + stdout=test.wrap_stdout( + read_str='SConscript %s\n' % wpath, build_str="scons: `.' is up to date.\n" + ), +) + +test.run( + arguments='--makefile=%s .' % subdir_BuildThis, + stdout=test.wrap_stdout( + read_str='subdir/BuildThis %s\n' % wpath, + build_str="scons: `.' is up to date.\n", + ), +) + +test.run( + arguments='--sconstruct=SConscript .', + stdout=test.wrap_stdout( + read_str='SConscript %s\n' % wpath, build_str="scons: `.' is up to date.\n" + ), +) + +test.run( + arguments='--sconstruct=%s .' % subdir_BuildThis, + stdout=test.wrap_stdout( + read_str='subdir/BuildThis %s\n' % wpath, + build_str="scons: `.' is up to date.\n", + ), +) + +test.run( + arguments='-f - .', + stdin=""" DefaultEnvironment(tools=[]) import os print("STDIN " + os.getcwd()) """, - stdout = test.wrap_stdout(read_str = 'STDIN %s\n' % wpath, - build_str = "scons: `.' is up to date.\n")) - -expect = test.wrap_stdout(read_str = 'Build2 %s\nSConscript %s\n' % (wpath, wpath), - build_str = "scons: `.' is up to date.\n") -test.run(arguments = '-f Build2 -f SConscript .', stdout=expect) + stdout=test.wrap_stdout( + read_str='STDIN %s\n' % wpath, build_str="scons: `.' is up to date.\n" + ), +) + +expect = test.wrap_stdout( + read_str='Build2 %s\nSConscript %s\n' % (wpath, wpath), + build_str="scons: `.' is up to date.\n", +) +test.run(arguments='-f Build2 -f SConscript .', stdout=expect) + +test.run( + arguments='-f no_such_file .', + stdout=test.wrap_stdout("scons: `.' is up to date.\n"), + stderr=None, +) -test.run(arguments = '-f no_such_file .', - stdout = test.wrap_stdout("scons: `.' is up to date.\n"), - stderr = None) expect = """ scons: warning: Calling missing SConscript without error is deprecated. -Transition by adding must_exist=0 to SConscript calls. +Transition by adding must_exist=False to SConscript calls. Missing SConscript 'no_such_file'""" stderr = test.stderr() test.must_contain_all(test.stderr(), expect) diff --git a/test/option/warn-missing-sconscript.py b/test/option/warn-missing-sconscript.py index f5e697b..5413229 100644 --- a/test/option/warn-missing-sconscript.py +++ b/test/option/warn-missing-sconscript.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify use of the --warn=missing-sconscript option. @@ -53,7 +52,7 @@ test.write("foo.c",""" expect = r""" scons: warning: Calling missing SConscript without error is deprecated. -Transition by adding must_exist=0 to SConscript calls. +Transition by adding must_exist=False to SConscript calls. Missing SConscript 'no_such_file' """ + TestSCons.file_expr |