Small docstring update for vars.Add
[scons.git] / test / Libs / SharedLibrary-update-deps.py
blobf8ab44dd20755645d88b291ebb608d7edde39bf8
1 #!/usr/bin/env python
3 # MIT License
5 # Copyright The SCons Foundation
7 # Permission is hereby granted, free of charge, to any person obtaining
8 # a copy of this software and associated documentation files (the
9 # "Software"), to deal in the Software without restriction, including
10 # without limitation the rights to use, copy, modify, merge, publish,
11 # distribute, sublicense, and/or sell copies of the Software, and to
12 # permit persons to whom the Software is furnished to do so, subject to
13 # the following conditions:
15 # The above copyright notice and this permission notice shall be included
16 # in all copies or substantial portions of the Software.
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 """
27 Test that SharedLibrary() updates when a different lib is linked,
28 even if it has the same md5.
29 This is https://github.com/SCons/scons/issues/2903
30 """
32 import sys
33 import sysconfig
35 import TestSCons
37 test = TestSCons.TestSCons()
39 test.dir_fixture( "bug2903" )
41 # Build the sub-libs (don't care about details of this)
42 test.run(arguments='-f SConstruct-libs')
44 # This should build the main lib, using libfoo.so
45 test.run(arguments='libname=foo')
46 # This should rebuild the main lib, using libbar.so;
47 # it should NOT say it's already up to date.
48 test.run(arguments='libname=bar')
49 test.must_not_contain_any_line(test.stdout(), ["is up to date"])
50 # Try it again, in reverse, to make sure:
51 test.run(arguments='libname=foo')
52 test.must_not_contain_any_line(test.stdout(), ["is up to date"])
54 # Now try changing the link command line (in an innocuous way); should rebuild.
55 if sys.platform == 'win32' and not sysconfig.get_platform() in ("mingw",):
56 extraflags='shlinkflags=/DEBUG'
57 else:
58 extraflags='shlinkflags=-g'
60 test.run(arguments=['libname=foo', extraflags])
61 test.must_not_contain_any_line(test.stdout(), ["is up to date"])
62 test.run(arguments=['libname=foo', extraflags, '--debug=explain'])
63 test.must_contain_all_lines(test.stdout(), ["is up to date"])
65 test.pass_test()
67 # Local Variables:
68 # tab-width:4
69 # indent-tabs-mode:nil
70 # End:
71 # vim: set expandtab tabstop=4 shiftwidth=4: