Boost logo

Boost Testing :

From: K. Noel Belcourt (kbelco_at_[hidden])
Date: 2007-09-20 00:33:52


On Sep 19, 2007, at 10:26 PM, Rene Rivera wrote:

> K. Noel Belcourt wrote:
>> On Sep 19, 2007, at 7:34 PM, Beman Dawes wrote:
>
>>> What does the reporting look like when a test times out? We need
>>> to make
>>> sure timeouts get reported as fails,
>
> They are reported as failures, but they are generic failures
> without any
> real explanation. Strangely, the lack of explanation is the
> indicator of
> a timeout failure since AFAIR all other types of failures have some
> indicator.
>
>> and the detail report gives the
>>> reason as "100 second time limit exceeded" or some similar message
>>> that
>>> makes it clear what happened.
>>
>> Good idea. I'm just sending a SIGKILL to any expired process. Let
>> me see if I can add some verbiage to the output text to make it clear
>> the action timed out.
>
> Hm, the only thing I can think of is to append to the buffered
> output of
> the action an error message. I didn't do that when I implemented the
> option originally as we didn't have a good way of associating the
> timeout with a particular action.

Hi Rene,

This is what I did to get the message "x second time limit exceeded"
to output after the command. I pass in a zero start_time to indicate
the process expired and combine it with the globs.timeout. Would
something like this work?

-- Noel

[kbelco_at_sahp7645 src]$ svn diff output.c
Index: output.c
===================================================================
--- output.c (revision 39399)
+++ output.c (working copy)
@@ -30,7 +30,8 @@
      const char * target,
      const char * command,
      const char * out_data,
- const char * err_data
+ const char * err_data,
+ int start_time
      )
{
      /* print out the action+target line, if the action is quite
@@ -52,6 +53,14 @@
      {
          fputs(command,globs.cmdout);
      }
+
+ /* if non-zero timeout and zero start time, process expired */
+ if (globs.timeout && !start_time)
+ {
+ fputc(globs.timeout, bjam_out);
+ fputs(" second time limit exceeded", bjam_out);
+ fputc('\n', bjam_out);
+ }

      /* print out the command output, if requested */
      if (0 != out_data &&


Boost-testing list run by mbergal at meta-comm.com