[RFC PATCH 03/43] qemuxml2(argv|xml)test: Don't exit early when testQemuInfoSetArgs fails

Peter Krempa posted 43 patches 4 years, 10 months ago
There is a newer version of this series
[RFC PATCH 03/43] qemuxml2(argv|xml)test: Don't exit early when testQemuInfoSetArgs fails
Posted by Peter Krempa 4 years, 10 months ago
Set the return code to failure and continue testing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 tests/qemuxml2argvtest.c | 2 +-
 tests/qemuxml2xmltest.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 07cd522699..15a14be1bb 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -904,7 +904,7 @@ mymain(void)
         info.qapiSchemaCache = qapiSchemaCache; \
         if (testQemuInfoSetArgs(&info, capscache, capslatest, \
                                 __VA_ARGS__, ARG_END) < 0) \
-            return EXIT_FAILURE; \
+            ret = -1; \
         testInfoSetPaths(&info, _suffix); \
         if (virTestRun("QEMU XML-2-ARGV " _name _suffix, \
                        testCompareXMLToArgv, &info) < 0) \
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 03cb405123..2b8fca8316 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -134,7 +134,7 @@ mymain(void)
                                 ARG_END) < 0 || \
             qemuTestCapsCacheInsert(driver.qemuCapsCache, info.qemuCaps) < 0) { \
             VIR_TEST_DEBUG("Failed to generate test data for '%s'", _name); \
-            return -1; \
+            ret = -1; \
         } \
  \
         if (when & WHEN_INACTIVE) { \
-- 
2.30.2

Re: [RFC PATCH 03/43] qemuxml2(argv|xml)test: Don't exit early when testQemuInfoSetArgs fails
Posted by Ján Tomko 4 years, 10 months ago
On a Friday in 2021, Peter Krempa wrote:
>Set the return code to failure and continue testing.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> tests/qemuxml2argvtest.c | 2 +-
> tests/qemuxml2xmltest.c  | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Push-before: 2021 May 7

Jano