2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00

Make sure b2 exits immediately on syntax errors (#540)

Add test verifying Jam syntax error results in non-zero exit status.

Refines #538
Fixes #539
This commit is contained in:
Mateusz Łoskot
2020-03-02 21:03:38 +01:00
committed by GitHub
parent 71b8d4b823
commit bdccf53eec
3 changed files with 47 additions and 19 deletions

View File

@@ -649,28 +649,32 @@ int main( int argc, char * * argv, char * * arg_environ )
parse_file( constant_plus, frame );
}
/* FIXME: What shall we do if builtin_update_now,
* the sole place setting last_update_now_status,
* failed earlier?
*/
status = yyanyerrors();
if ( status && !last_update_now_status )
last_update_now_status = status;
/* Manually touch -t targets. */
for ( n = 0; ( s = getoptval( optv, 't', n ) ); ++n )
if ( !status )
{
OBJECT * const target = object_new( s );
touch_target( target );
object_free( target );
}
/* Manually touch -t targets. */
for ( n = 0; ( s = getoptval( optv, 't', n ) ); ++n )
{
OBJECT * const target = object_new( s );
touch_target( target );
object_free( target );
}
/* Now make target. */
{
PROFILE_ENTER( MAIN_MAKE );
LIST * const targets = targets_to_update();
if ( !list_empty( targets ) )
status |= make( targets, anyhow );
else
status = last_update_now_status;
PROFILE_EXIT( MAIN_MAKE );
/* Now make target. */
{
PROFILE_ENTER( MAIN_MAKE );
LIST * const targets = targets_to_update();
if ( !list_empty( targets ) )
status |= make( targets, anyhow );
else
status = last_update_now_status;
PROFILE_EXIT( MAIN_MAKE );
}
}
PROFILE_EXIT( MAIN );