Re: [libvirt] [PATCH 02/10] tests: Document VIR_TEST_DEBUG environment variable.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel P. Berrange wrote:
> On Mon, Oct 12, 2009 at 10:45:07AM -0400, Cole Robinson wrote:
>> Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
>> ---
>>  HACKING                      |   10 ++++++++++
>>  tests/interfacexml2xmltest.c |    2 --
>>  tests/statstest.c            |    2 +-
>>  3 files changed, 11 insertions(+), 3 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
>> +
>> +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.
>>  
>> diff --git a/tests/interfacexml2xmltest.c b/tests/interfacexml2xmltest.c
>> index 5ffebad..ed3093c 100644
>> --- a/tests/interfacexml2xmltest.c
>> +++ b/tests/interfacexml2xmltest.c
>> @@ -43,8 +43,6 @@ static int testCompareXMLToXMLFiles(const char *xml) {
>>      ret = 0;
>>  
>>   fail:
>> -    if (ret != 0)
>> -        fprintf(stderr, "expected: -------\n%s", actual);
>>      free(actual);
>>      virInterfaceDefFree(dev);
>>      return ret;
>> diff --git a/tests/statstest.c b/tests/statstest.c
>> index 82c0daa..819d395 100644
>> --- a/tests/statstest.c
>> +++ b/tests/statstest.c
>> @@ -25,7 +25,7 @@ static int testDevice(const char *path, int expect)
>>      if (actual == expect) {
>>          return 0;
>>      } else {
>> -        if (getenv("DEBUG_TESTS"))
>> +        if (getenv("VIR_TEST_DEBUG"))
>>              fprintf(stderr, "Expect %-6d Actual %-6d\n", expect, actual);
>>          return -1;
>>      }
> 
> ACK
> 
> though I wonder if we should change the VIR_* env names to LIBVIRT_*,
> to match the env naming we semi-standardized on in the main library
> code
> 
> Daniel

I've sent an updated patch that centralizes the debug level lookup. If we want
to change the env variable it should be a simple additive change.

Thanks,
Cole

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]