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

Daniel P. Berrange berrange at redhat.com
Tue Oct 13 13:23:57 UTC 2009


On Mon, Oct 12, 2009 at 10:45:07AM -0400, Cole Robinson wrote:
> 
> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> ---
>  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
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list