Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83778 - in trunk/tools/build/v2: engine test
From: steven_at_[hidden]
Date: 2013-04-06 13:18:20


Author: steven_watanabe
Date: 2013-04-06 13:18:20 EDT (Sat, 06 Apr 2013)
New Revision: 83778
URL: http://svn.boost.org/trac/boost/changeset/83778

Log:
Fix the return status when updating targets that have failed in a prior call to UPDATE_NOW.
Text files modified:
   trunk/tools/build/v2/engine/make1.c | 22 ++++++++++++++++++++
   trunk/tools/build/v2/test/core_update_now.py | 42 ++++++++++++++++++++++++++++++++++++++++
   2 files changed, 63 insertions(+), 1 deletions(-)

Modified: trunk/tools/build/v2/engine/make1.c
==============================================================================
--- trunk/tools/build/v2/engine/make1.c (original)
+++ trunk/tools/build/v2/engine/make1.c 2013-04-06 13:18:20 EDT (Sat, 06 Apr 2013)
@@ -195,6 +195,7 @@
 int make1( LIST * targets )
 {
     state * pState;
+ int status = 0;
 
     memset( (char *)counts, 0, sizeof( *counts ) );
     
@@ -252,7 +253,26 @@
     if ( intr )
         exit( 1 );
 
- return counts->total != counts->made;
+ {
+ LISTITER iter, end;
+ for ( iter = list_begin( targets ), end = list_end( targets );
+ iter != end; iter = list_next( iter ) )
+ {
+ /* Check that the target was updated and that the
+ update succeeded. */
+ TARGET * t = bindtarget( list_item( iter ) );
+ if (t->progress == T_MAKE_DONE)
+ {
+ if (t->status != EXEC_CMD_OK)
+ status = 1;
+ }
+ else if ( ! ( t->progress == T_MAKE_NOEXEC_DONE && globs.noexec ) )
+ {
+ status = 1;
+ }
+ }
+ }
+ return status;
 }
 
 

Modified: trunk/tools/build/v2/test/core_update_now.py
==============================================================================
--- trunk/tools/build/v2/test/core_update_now.py (original)
+++ trunk/tools/build/v2/test/core_update_now.py 2013-04-06 13:18:20 EDT (Sat, 06 Apr 2013)
@@ -193,6 +193,47 @@
 
     t.cleanup()
 
+
+def return_status():
+ """
+ Make sure that UPDATE_NOW returns a failure status if
+ the target failed in a previous call to UPDATE_NOW
+ """
+ t = BoostBuild.Tester(pass_toolset=0, pass_d0=False)
+
+ t.write("file.jam", """\
+actions fail
+{
+ exit 1
+}
+
+NOTFILE target1 ;
+ALWAYS target1 ;
+fail target1 ;
+
+ECHO update1: [ UPDATE_NOW target1 ] ;
+ECHO update2: [ UPDATE_NOW target1 ] ;
+
+DEPENDS all : target1 ;
+""")
+
+ t.run_build_system(["-ffile.jam"], status=1, stdout="""\
+...found 1 target...
+...updating 1 target...
+fail target1
+
+ exit 1
+
+...failed fail target1...
+...failed updating 1 target...
+update1:
+update2:
+...found 1 target...
+""")
+
+ t.cleanup()
+
+
 def save_restore():
     """Tests that ignore-minus-n and ignore-minus-q are
     local to the call to UPDATE_NOW"""
@@ -332,4 +373,5 @@
 failed_target()
 missing_target()
 build_once()
+return_status()
 save_restore()


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