tests: Return EXIT_FAILURE/EXIT_SUCCESS instead of -1/0

When using VIR_TEST_MAIN() or VIR_TEST_MAIN_PRELOAD() macros, the
retval of mymain() will become retval of main(). Hence, mymain()
should use EXIT_FAILURE and EXIT_SUCCESS return values for
greater portability. Another reason is that otherwise our summary
printing of failed tests doesn't work (see following commit for
more info).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik
2021-05-17 09:25:32 +02:00
parent 351742e859
commit 5d99b157bc
13 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -229,7 +229,7 @@ mymain(void)
if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL)
virFileDeleteTree(tmpdir);
VIR_FREE(virscsi_prefix);
return ret;
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
VIR_TEST_MAIN(mymain)