From 3e7d32dad09cdda25db35de66bdf62c1f2eba716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sun, 27 May 2012 06:48:02 +0000 Subject: [PATCH] Fix for Boost Build's time targets failing to be built when run with a msvc exe source. Now the TIME target generator marked as composing so it can correctly handle being given multiple sources as happens in this case where the EXE generator constructs a PDB file as well. This fixes Boost Build ticket #218 and makes the Boost Build timedata unit test pass when run using the msvc toolset. [SVN r78672] --- v2/tools/testing-aux.jam | 8 ++++---- v2/tools/testing.jam | 13 ++++++++----- v2/tools/testing.py | 5 ++++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/v2/tools/testing-aux.jam b/v2/tools/testing-aux.jam index 790a12d5d..64ba00387 100644 --- a/v2/tools/testing-aux.jam +++ b/v2/tools/testing-aux.jam @@ -199,14 +199,14 @@ rule record-time ( target : source : start end user system ) # the 'source' target and display the results both on the standard output and in # the 'target' file. # -rule time ( target : source : properties * ) +rule time ( target : sources + : properties * ) { # Set up rule for recording timing information. - __TIMING_RULE__ on $(source) = testing.record-time $(target) ; + __TIMING_RULE__ on $(sources) = testing.record-time $(target) ; - # Make sure that the source is rebuilt any time we need to retrieve that + # Make sure the sources get rebuilt any time we need to retrieve that # information. - REBUILDS $(target) : $(source) ; + REBUILDS $(target) : $(sources) ; } diff --git a/v2/tools/testing.jam b/v2/tools/testing.jam index f1b5a7780..21e1bd159 100644 --- a/v2/tools/testing.jam +++ b/v2/tools/testing.jam @@ -541,8 +541,11 @@ IMPORT $(__name__) : compile compile-fail run run-fail link link-fail : : compile compile-fail run run-fail link link-fail ; +# This is a composing generator to support cases where a generator for the +# specified target constructs other targets as well. One such example is msvc's +# exe generator that constructs both EXE and PDB targets. type.register TIME : time ; -generators.register-standard testing.time : : TIME ; +generators.register-composing testing.time : : TIME ; # Note that this rule may be called multiple times for a single target in case @@ -570,14 +573,14 @@ IMPORT testing : record-time : : testing.record-time ; # the 'source' target and display the results both on the standard output and in # the 'target' file. # -rule time ( target : source : properties * ) +rule time ( target : sources + : properties * ) { # Set up rule for recording timing information. - __TIMING_RULE__ on $(source) = testing.record-time $(target) ; + __TIMING_RULE__ on $(sources) = testing.record-time $(target) ; - # Make sure that the source is rebuilt any time we need to retrieve that + # Make sure the sources get rebuilt any time we need to retrieve that # information. - REBUILDS $(target) : $(source) ; + REBUILDS $(target) : $(sources) ; } diff --git a/v2/tools/testing.py b/v2/tools/testing.py index 3b53500cc..360f07aed 100644 --- a/v2/tools/testing.py +++ b/v2/tools/testing.py @@ -286,8 +286,11 @@ toolset.flags("testing.capture-output", "LAUNCHER", [], [""]) toolset.flags("testing.unit-test", "LAUNCHER", [], [""]) toolset.flags("testing.unit-test", "ARGS", [], [""]) +# This is a composing generator to support cases where a generator for the +# specified target constructs other targets as well. One such example is msvc's +# exe generator that constructs both EXE and PDB targets. type.register("TIME", ["time"]) -generators.register_standard("testing.time", [], ["TIME"]) +generators.register_composing("testing.time", [], ["TIME"]) # The following code sets up actions for this module. It's pretty convoluted,