|
Boost-Commit : |
From: grafikrobot_at_[hidden]
Date: 2007-11-16 23:11:49
Author: grafik
Date: 2007-11-16 23:11:49 EST (Fri, 16 Nov 2007)
New Revision: 41167
URL: http://svn.boost.org/trac/boost/changeset/41167
Log:
Add "--out-xml=xyz.xml" option that dumps the output of all actions, and the test.jam information, to the given file. Changes are mostly from Dave.
Text files modified:
trunk/tools/build/v2/build-system.jam | 55 +++++++++++++++++++++++++++++++++++++++
trunk/tools/build/v2/tools/testing.jam | 30 ++++++++++++++++-----
2 files changed, 77 insertions(+), 8 deletions(-)
Modified: trunk/tools/build/v2/build-system.jam
==============================================================================
--- trunk/tools/build/v2/build-system.jam (original)
+++ trunk/tools/build/v2/build-system.jam 2007-11-16 23:11:49 EST (Fri, 16 Nov 2007)
@@ -487,8 +487,61 @@
{
actual-targets += [ $(t).actualize ] ;
}
+
+# Was an XML dump requested?
+.out-xml = [ MATCH --out-xml=(.*) : [ modules.peek : ARGV ] ] ;
+if $(.out-xml)
+{
+ modules.poke : .out-xml : $(.out-xml) ;
+ module
+ {
+ rule out-xml ( target : sources * )
+ {
+ INCLUDES $(target) : $(sources) ;
+ local nl = "
+" ;
+ on $(target) .header =
+ "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+ "$(nl)<build version=\"1.0\">" ;
+ on $(target) .footer =
+ $(nl)</build>$(nl) ;
+ }
+
+ actions out-xml
+ {
+ }
+
+ rule out-xml-action-rule ( target sources * : status : user : system : command : output ? )
+ {
+ local contents = [ on $(target) return $(.header) $(.contents) $(.footer) ] ;
+ local f = @($(target):E=$(contents)) ;
+ }
+
+ __ACTION_RULE__ on $(.out-xml) = out-xml-action-rule ;
+
+ rule __ACTION_RULE__ ( target sources * : status : user : system : command : output ? )
+ {
+ local nl = "
+" ;
+ local locate = [ on $(target) return $(LOCATE) ] ;
+ .contents on $(.out-xml) +=
+ $(nl)" <action status=\""$(status)"\" user=\""$(user)"\" system=\""$(system)"\">"
+ $(nl)" "<target>$(target:G=:R=$(locate))</target>
+ $(nl)" "<source>$(sources)</source>
+ $(nl)" "<command>$(nl)<![CDATA[$(command)]]></command>
+ $(nl)" "<output><![CDATA[$(output)]]></output>
+ $(nl)" "</action>$(nl) ;
+ }
+
+ __ACTION_RULE__ = __ACTION_RULE__ ;
+ }
+
+ ALWAYS $(.out-xml) ;
+ out-xml $(.out-xml) : $(actual-targets) ;
+}
+
NOTFILE all ;
-DEPENDS all : $(actual-targets) ;
+DEPENDS all : $(actual-targets) $(.out-xml) ;
if $(bjam-targets)
{
Modified: trunk/tools/build/v2/tools/testing.jam
==============================================================================
--- trunk/tools/build/v2/tools/testing.jam (original)
+++ trunk/tools/build/v2/tools/testing.jam 2007-11-16 23:11:49 EST (Fri, 16 Nov 2007)
@@ -193,6 +193,8 @@
}
}
+# Was an XML dump requested?
+.out-xml = [ MATCH --out-xml=(.*) : [ modules.peek : ARGV ] ] ;
# Take a target (instance of 'basic-target') and prints
# - its type
@@ -235,13 +237,27 @@
# Extract values of the <test-info> feature
local test-info = [ $(r).get <test-info> ] ;
- # Format them into a single string of quoted strings
- test-info = \"$(test-info:J=\"\ \")\" ;
-
- ECHO boost-test($(type)) \"$(name)\"
- [$(test-info)]
- ":" \"$(source-files)\"
- ;
+ if $(.out-xml)
+ {
+ local nl = "
+" ;
+ .contents on $(.out-xml) +=
+ $(nl)" <test type=\""$(type)"\" name=\""$(name)"\">"
+ $(nl)" "<info><![CDATA[$(test-info)]]></info>
+ $(nl)" "<source><![CDATA[$(source-files)]]></source>
+ $(nl)" </test>"
+ ;
+ }
+ else
+ {
+ # Format them into a single string of quoted strings
+ test-info = \"$(test-info:J=\"\ \")\" ;
+
+ ECHO boost-test($(type)) \"$(name)\"
+ [$(test-info)]
+ ":" \"$(source-files)\"
+ ;
+ }
}
# Register generators. Depending on target type, either
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