[libvirt] [PATCH] tests: Centralize VIR_TEST_DEBUG lookup, and document it

Cole Robinson crobinso at redhat.com
Mon Oct 19 14:38:30 UTC 2009


On 10/17/2009 08:03 AM, Matthias Bolte wrote:
> 2009/10/16 Cole Robinson <crobinso at redhat.com>:
>> Provide a simple interface for other tests to lookup the testDebug variable.
>> Also remove a redundant error message in interface tests.
>>
>> If anyone feels inclined to change this env variable to match the existing
>> LIBVIRT_* format, it should now be easier to do so.
>>
>> Signed-off-by: Cole Robinson <crobinso at redhat.com>
>> ---
>> Â HACKING Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â | Â  10 ++++++++++
>> Â tests/interfacexml2xmltest.c | Â  Â 2 --
>>  tests/statstest.c            |    4 ++--
>>  tests/testutils.c            |   38 ++++++++++++++++++++++++++------------
>>  tests/testutils.h            |    4 ++--
>>  tests/testutilsqemu.c        |    2 +-
>> Â 6 files changed, 41 insertions(+), 19 deletions(-)
>>
>> diff --git a/HACKING b/HACKING
>> index bcff8c6..fba7778 100644
>> --- a/HACKING
>> +++ b/HACKING
>> @@ -37,6 +37,16 @@ and run the tests:
>>
>> Â The latter test checks for memory leaks.
>>
>> +If you encounter any failing tests, the VIR_TEST_DEBUG environment variable
>> +may help:
>> +
>> +  VIR_TEST_DEBUG=1 make check    (or)
>> + Â VIR_TEST_DEBUG=2 make check
> 
> Maybe explain what VIR_TEST_DEBUG actually does and what's the
> difference between 1 and 2.
> 

Yes, this wording can be improved, I will fix it and repost.

>> +
>> +Also, individual tests can be run from inside the 'tests/' directory, like:
>> +
>> + Â ./qemuxml2xmltest
>> +
>> Â (6) Update tests and/or documentation, particularly if you are adding
>> Â a new feature or changing the output of a program.
> 
>> --- a/tests/testutils.c
>> +++ b/tests/testutils.c
>> @@ -45,7 +45,7 @@
>> Â  Â  ((((int) ((T)->tv_sec - (U)->tv_sec)) * 1000000.0 + Â  Â  Â  Â \
>> Â  Â  Â  ((int) ((T)->tv_usec - (U)->tv_usec))) / 1000.0)
>>
>> -unsigned int testDebug = 0;
>> +unsigned int testDebug = -1;
> 
> testDebug isn't referenced via extern anymore, declare it static like
> testOOM and testCounter.
>

Will do.

>> Â static unsigned int testOOM = 0;
>> Â static unsigned int testCounter = 0;
> 
> ACK.
>

Thanks for the review!

- Cole




More information about the libvir-list mailing list