[libvirt] 2/3 testsuite formatting bugs [was: [PATCH] Skip some xen tests if xend is not running]

Eric Blake eblake at redhat.com
Sat Jul 9 01:45:57 UTC 2011


On 07/08/2011 05:28 PM, Matthias Bolte wrote:
> 
> From a1508239af921289cd6e357e8521ff42faf535bd Mon Sep 17 00:00:00 2001
> From: Matthias Bolte <matthias.bolte at googlemail.com>
> Date: Sat, 9 Jul 2011 01:24:16 +0200
> Subject: [PATCH] tests: Add the logic to skip the statstest to the right place
> 
> ---
>  tests/statstest.c |   31 ++++++++++++++++++++-----------
>  1 files changed, 20 insertions(+), 11 deletions(-)
> 
>  
> -VIRT_TEST_MAIN(mymain)
> +/* Skipping the test in mymain is too late, it results in broken output.
> + * Therefore, expand VIRT_TEST_MAIN here manually to be able to skip at
> + * the right place. */
> +int main(int argc, char **argv)

This seems fishy.  Why did tests/reconnect.c not need the same
treatment?  Oh, because it didn't use VIRT_TEST_MAIN.

Wouldn't it be better to teach VIRT_TEST_MAIN to behave better on a skip?

diff --git i/tests/testutils.c w/tests/testutils.c
index b433204..f732fdd 100644
--- i/tests/testutils.c
+++ w/tests/testutils.c
@@ -688,7 +688,7 @@ cleanup:
     if (abs_srcdir_cleanup)
         VIR_FREE(abs_srcdir);
     virResetLastError();
-    if (!virTestGetVerbose()) {
+    if (!virTestGetVerbose() && ret != EXIT_AM_SKIP) {
         int i;
         for (i = (testCounter % 40) ; i > 0 && i < 40 ; i++)
             fprintf(stderr, " ");


-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110708/400e79a6/attachment-0001.sig>


More information about the libvir-list mailing list