Boost logo

Boost-Commit :

From: grafikrobot_at_[hidden]
Date: 2007-11-19 12:44:32


Author: grafik
Date: 2007-11-19 12:44:31 EST (Mon, 19 Nov 2007)
New Revision: 41236
URL: http://svn.boost.org/trac/boost/changeset/41236

Log:
Make quietly actions really quiet by not printing the command output. The output for the quietly actions is still available through "__ACTION_RULE__".
Added:
   trunk/tools/jam/test/actions_quietly.jam (contents, props changed)
Text files modified:
   trunk/tools/jam/src/output.c | 28 ++++++++++++++++++----------
   trunk/tools/jam/test/test.jam | 1 +
   2 files changed, 19 insertions(+), 10 deletions(-)

Modified: trunk/tools/jam/src/output.c
==============================================================================
--- trunk/tools/jam/src/output.c (original)
+++ trunk/tools/jam/src/output.c 2007-11-19 12:44:31 EST (Mon, 19 Nov 2007)
@@ -63,7 +63,11 @@
         case EXIT_TIMEOUT:
         {
             /* process expired, make user aware with explicit message */
- fprintf(bjam_out, "%d second time limit exceeded\n", globs.timeout);
+ if ( action )
+ {
+ /* but only output for non-quietly actions */
+ fprintf(bjam_out, "%d second time limit exceeded\n", globs.timeout);
+ }
             break;
         }
         default:
@@ -71,16 +75,20 @@
     }
     
     /* print out the command output, if requested */
- if (0 != out_data &&
- ( globs.pipe_action & 1 /* STDOUT_FILENO */ ||
- globs.pipe_action == 0))
+ if ( action )
     {
- out_(out_data,bjam_out);
- }
- if (0 != err_data &&
- globs.pipe_action & 2 /* STDERR_FILENO */)
- {
- out_(err_data,bjam_err);
+ /* but only output for non-quietly actions */
+ if (0 != out_data &&
+ ( globs.pipe_action & 1 /* STDOUT_FILENO */ ||
+ globs.pipe_action == 0))
+ {
+ out_(out_data,bjam_out);
+ }
+ if (0 != err_data &&
+ globs.pipe_action & 2 /* STDERR_FILENO */)
+ {
+ out_(err_data,bjam_err);
+ }
     }
     
     fflush(bjam_out);

Added: trunk/tools/jam/test/actions_quietly.jam
==============================================================================
--- (empty file)
+++ trunk/tools/jam/test/actions_quietly.jam 2007-11-19 12:44:31 EST (Mon, 19 Nov 2007)
@@ -0,0 +1,55 @@
+#~ Copyright 2007 Rene Rivera.
+#~ Distributed under the Boost Software License, Version 1.0.
+#~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+
+if ! $(BJAM_SUBTEST)
+{
+ ECHO --- Testing \"actions quietly\"... ;
+
+ assert "...found 4 targets...
+...updating 2 targets...
+.a. subtest_a
+
+echo [subtest_a] 0
+echo [subtest_a] 1
+echo [subtest_a] 2
+
+[subtest_a] 0
+[subtest_a] 1
+[subtest_a] 2
+.a. subtest_b
+
+echo [subtest_b] 0
+echo [subtest_b] 1
+echo [subtest_b] 2
+
+[subtest_b] 0
+[subtest_b] 1
+[subtest_b] 2
+...updated 2 targets...
+" : (==) : [ SHELL "$(ARGV[1]) -f actions_quietly.jam -sBJAM_SUBTEST=1 -d2" ] ;
+
+ assert "...found 4 targets...
+...updating 2 targets...
+...updated 2 targets...
+" : (==) : [ SHELL "$(ARGV[1]) -f actions_quietly.jam -sBJAM_SUBTEST=1" ] ;
+}
+else
+{
+ actions quietly .a.
+ {
+echo [$(<:B)] 0
+echo [$(<:B)] 1
+echo [$(<:B)] 2
+ }
+
+ rule .a.
+ {
+ DEPENDS $(<) : $(>) ;
+ }
+
+ NOTFILE subtest ;
+ .a. subtest_a : subtest ;
+ .a. subtest_b : subtest ;
+ DEPENDS all : subtest_a subtest_b ;
+}

Modified: trunk/tools/jam/test/test.jam
==============================================================================
--- trunk/tools/jam/test/test.jam (original)
+++ trunk/tools/jam/test/test.jam 2007-11-19 12:44:31 EST (Mon, 19 Nov 2007)
@@ -41,6 +41,7 @@
     }
 }
 
+include actions_quietly.jam ;
 include builtin_shell.jam ;
 include builtin_w32_getregnames.jam ;
 include option_d2.jam ;


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