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

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

 



On 07/08/2011 05:28 PM, Matthias Bolte wrote:
> 
> From a1508239af921289cd6e357e8521ff42faf535bd Mon Sep 17 00:00:00 2001
> From: Matthias Bolte <matthias.bolte@xxxxxxxxxxxxxx>
> 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@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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