diff --git a/v2/build-system.jam b/v2/build-system.jam
index c4e3df8f9..b9c7a8180 100755
--- a/v2/build-system.jam
+++ b/v2/build-system.jam
@@ -487,8 +487,61 @@ for t in $(virtual-targets)
{
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 =
+ ""
+ "$(nl)" ;
+ on $(target) .footer =
+ $(nl)$(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)" "
+ $(nl)" "$(target:G=:R=$(locate))
+ $(nl)" "$(sources)
+ $(nl)" "$(nl)
+ $(nl)" "
+ $(nl)" "$(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)
{
diff --git a/v2/tools/testing.jam b/v2/tools/testing.jam
index 4a5a24764..4819e00c5 100644
--- a/v2/tools/testing.jam
+++ b/v2/tools/testing.jam
@@ -193,6 +193,8 @@ local rule get-library-name ( path )
}
}
+# 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 @@ rule dump-test ( target )
# Extract values of the feature
local test-info = [ $(r).get ] ;
- # 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)" "
+ $(nl)" "
+ $(nl)" "
+ $(nl)" "
+ ;
+ }
+ 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