mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: uniformly report test failures
testutils.c likes to print summaries after a test completes, including if it failed. But if the test outright exit()s, this summary is skipped. Enforce that we return instead of exit. * cfg.mk (sc_prohibit_exit_in_tests): New syntax check. * tests/commandhelper.c (main): Fix offenders. * tests/qemumonitorjsontest.c (mymain): Likewise. * tests/seclabeltest.c (main): Likewise. * tests/securityselinuxlabeltest.c (mymain): Likewise. * tests/securityselinuxtest.c (mymain): Likewise. * tests/testutils.h (VIRT_TEST_MAIN_PRELOAD): Likewise. * tests/testutils.c (virtTestMain): Likewise. (virtTestCaptureProgramOutput): Use symbolic name.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* commandhelper.c: Auxiliary program for commandtest
|
||||
*
|
||||
* Copyright (C) 2010-2012 Red Hat, Inc.
|
||||
* Copyright (C) 2010-2013 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -71,9 +71,8 @@ int main(int argc, char **argv) {
|
||||
origenv++;
|
||||
}
|
||||
|
||||
if (VIR_ALLOC_N(newenv, n) < 0) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (VIR_ALLOC_N(newenv, n) < 0)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
origenv = environ;
|
||||
n = i = 0;
|
||||
|
||||
Reference in New Issue
Block a user