mirror of
https://github.com/boostorg/build.git
synced 2026-02-16 01:12:13 +00:00
Improve the way unused sources are detected/reported.
* new/targets.jam
(basic-target.generate-source): Separate virtual targets that come from
different sources.
(basic-target.check-for-unused-targets): Warn only if not virtual target
from a given source is comsumed.
[SVN r18403]
This commit is contained in:
@@ -6,25 +6,16 @@ from BoostBuild import Tester
|
||||
from string import find
|
||||
t = Tester()
|
||||
|
||||
t.write("a.h", """
|
||||
""")
|
||||
|
||||
t.write("a.cpp", """
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
""")
|
||||
|
||||
t.write("Jamfile", """
|
||||
exe a : a.cpp a.h ;
|
||||
""")
|
||||
|
||||
t.write("project-root.jam", """
|
||||
""")
|
||||
t.set_tree("unused")
|
||||
|
||||
t.run_build_system()
|
||||
t.fail_test(find(t.stdout(), "warning: Unused source target { a.H }") == -1)
|
||||
# The second invocation should do nothing, and produce
|
||||
# no warning.
|
||||
t.run_build_system()
|
||||
t.fail_test(t.stdout() != '')
|
||||
|
||||
t.run_build_system("-sGENERATE_ONLY_UNUSABLE=1")
|
||||
t.fail_test(find(t.stdout(), "warning: Unused source b in main target ./a") == -1)
|
||||
|
||||
t.cleanup()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user