|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75879 - in trunk/tools/build/v2/test: . unused
From: steven_at_[hidden]
Date: 2011-12-09 13:19:51
Author: steven_watanabe
Date: 2011-12-09 13:19:50 EST (Fri, 09 Dec 2011)
New Revision: 75879
URL: http://svn.boost.org/trac/boost/changeset/75879
Log:
Update unused.py and add it to test_all.py.
Text files modified:
trunk/tools/build/v2/test/test_all.py | 1 +
trunk/tools/build/v2/test/unused.py | 6 ++----
trunk/tools/build/v2/test/unused/jamroot.jam | 15 +++++++++------
3 files changed, 12 insertions(+), 10 deletions(-)
Modified: trunk/tools/build/v2/test/test_all.py
==============================================================================
--- trunk/tools/build/v2/test/test_all.py (original)
+++ trunk/tools/build/v2/test/test_all.py 2011-12-09 13:19:50 EST (Fri, 09 Dec 2011)
@@ -213,6 +213,7 @@
"testing_support",
"timedata",
"unit_test",
+ "unused",
"use_requirements",
"using",
"wrapper",
Modified: trunk/tools/build/v2/test/unused.py
==============================================================================
--- trunk/tools/build/v2/test/unused.py (original)
+++ trunk/tools/build/v2/test/unused.py 2011-12-09 13:19:50 EST (Fri, 09 Dec 2011)
@@ -17,11 +17,9 @@
# The second invocation should do nothing, and produce no warning. The previous
# invocation might have printed executed actions and other things, so it is not
# easy to check if warning was issued or not.
-t.run_build_system()
-t.fail_test(find(t.stdout(), "warning: Unused source { b.X } in main target ./a") == -1)
+t.run_build_system(stdout="")
-t.run_build_system("-sGENERATE_ONLY_UNUSABLE=1")
-t.fail_test(find(t.stdout(), "warning: Unused source { b.X } in main target ./a") == -1)
+t.run_build_system("-sGENERATE_ONLY_UNUSABLE=1", stdout="")
# Now check that even if main target generates nothing, its usage requirements
# are still propagated to dependants.
Modified: trunk/tools/build/v2/test/unused/jamroot.jam
==============================================================================
--- trunk/tools/build/v2/test/unused/jamroot.jam (original)
+++ trunk/tools/build/v2/test/unused/jamroot.jam 2011-12-09 13:19:50 EST (Fri, 09 Dec 2011)
@@ -10,6 +10,7 @@
import "class" : new ;
import modules ;
import targets ;
+import project ;
type.register X : x ;
@@ -21,21 +22,23 @@
basic-target.__init__ $(name) : $(project) ;
}
- rule construct ( source-targets * : property-set )
+ rule construct ( name : source-targets * : property-set )
{
if [ modules.peek : GENERATE_NOTHING ]
{
- return ;
+ return [ property-set.empty ] ;
}
else if [ modules.peek : GENERATE_ONLY_UNUSABLE ]
{
- return [ virtual-target.from-file b.x : $(self.project) ]
+ return [ property-set.empty ]
+ [ virtual-target.from-file b.x : . : $(self.project) ]
;
}
else
{
- return [ virtual-target.from-file b.x : $(self.project) ]
- [ virtual-target.from-file b.cpp : $(self.project) ]
+ return [ property-set.empty ]
+ [ virtual-target.from-file b.x : . : $(self.project) ]
+ [ virtual-target.from-file b.cpp : . : $(self.project) ]
;
}
}
@@ -48,7 +51,7 @@
rule make-b-main-target
{
- local project = [ CALLER_MODULE ] ;
+ local project = [ project.current ] ;
targets.main-target-alternative
[ new test-target-class b : $(project) ] ;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk