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

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

 



2009/10/16 Cole Robinson <crobinso@xxxxxxxxxx>:
> 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@xxxxxxxxxx>
> ---
>  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.

> +
> +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.

>  static unsigned int testOOM = 0;
>  static unsigned int testCounter = 0;

ACK.

Matthias

--
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]