stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: testsuite process helpers [PATCH]
Date Thu, 03 Aug 2006 14:10:29 GMT
Farid Zaripov wrote:
>>-----Original Message-----
>>From: Martin Sebor [mailto:sebor@roguewave.com] 
>>Sent: Wednesday, August 02, 2006 8:30 PM
>>To: stdcxx-dev@incubator.apache.org
>>Subject: Re: testsuite process helpers [PATCH]
>>
>>
>>>    * rw_process.h (rw_pid_t): The type long changed to intptr_t
>>>    (on Windows) and pid_t (on other platforms).
>>
>>I would like to hide the actual type and avoid #including 
>>system (including the C library) headers in test suite 
>>headers whenever possible. In this case, will _RWSTD_SIZE_T 
>>do for rw_pid_t?
> 
> 
>   rw_pid_t should be signed, and should be 64 bit on 64-bit platforms.
> I see that _RWSTD_SSIZE_T can be used.

Right. Or _RWSTD_PTRDIFF_T. They are going to be the same.

> 
> 
>>Is this enough? Don't we want to suppress the output of rw_note() (and
> 
> others as well)? 
> 
>>If so, I think a more robust solution might be for driver.cpp to
> 
> provide and handle a 
> 
>>variable controlling whether to issue or suppress a 
>>diagnostic (and which). Something like int rw_diag_mask each 
>>of whose bits would disable the corresponding diagnostic.
> 
> 
>   I found that variable is already exist (_rw_diag_mask in opt_trace.h).

Oh yeah, I forgot about that one. It gets set in response to
the --severity=<...> command line option. I'll need to check
to make sure it does what we want.

> We can declare it
> in driver.h (with removing the leading underscore of course) but it is
> still not exactly what
> is needed. When any diagnostic are masked it still counted and is
> present in totals.

Ah, right. So it sounds like we need another mask. One that
prevents the diagnostic not just from being issued but also
from being counted.

> But
> in the case of 0.process.cpp test we need temporary disable the all
> diagnostic messages
> with disabling the counting ot that messages.

Right.

> 
>   Another point: if we want to disable some type of diagnostic using
> rw_diag_mask it is
> needed to move the enum diag_t from opt_diags.h to driver.h too.

Yes, I suppose you're right. Unless we do some magic with
rw_error() and other diagnostic functions:

     rw_error(0, 0, 0);   // disables counting errors
     rw_error(0, 1, 0);   // disables issuing
     rw_error(1, 0, 0);   // enables counting
     rw_error(1, 1, 0);   // enables counting and issuing

Each call returns the previous state of the diagnostic setting.
Or something like that.

> 
>   I propose add two functions enable_diag() / disable_diag(), or just
> enable_diag(bool enable)
> to the driver (and use any unused bit in _rw_diag_mask). We can publish
> the _rw_diag_mask
> along with enum diag_t later when it's will be required.

That would be another option. Which one of the two approaches
do you like better?

Martin

Mime
View raw message