Boost logo

Boost Testing :

From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2007-09-20 00:56:35


K. Noel Belcourt wrote:
> 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?

"start_time" seems like a bad name for what is essentially a timeout
flag. Regardless, it wont work on Windows since execnt doesn't keep
track of whether the action was killed or not (and it also doesn't keep
track of the starting time, it relies on the OS for that info while the
process is running). But I could easily add a timeout flag that I can
set on the command when it's killed, to later pass to the out_action().
So, I guess what you have could work :-) But since I'm for making it
generic, I'd say leave room for growth, by making output.h like:

===
#define EXIT_TIMEOUT 2

void out_action(
     const char * action,
     const char * target,
     const char * command,
     const char * out_data,
     const char * err_data,
     int exit_reason
     );
===

And then doing a switch in the out_action based on the exit_reason.

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

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