2011/4/29 Eric Blake <eblake(a)redhat.com>:
A few of the tests were missing basic sanity checks, while most
of them were doing copy-and-paste initialization (in fact, some
of them pasted the argc > 1 check more than once!). It's much
nicer to do things in one common place, and minimizes the size of
the next patch that fixes getcwd usage.
* tests/testutils.h (EXIT_AM_HARDFAIL): New define.
(progname, abs_srcdir): Define for all tests.
(VIRT_TEST_MAIN): Change callback signature.
* tests/testutils.c (virtTestMain): Do more common init.
* tests/commandtest.c (mymain): Simplify.
* tests/cputest.c (mymain): Likewise.
* tests/esxutilstest.c (mymain): Likewise.
* tests/eventtest.c (mymain): Likewise.
* tests/hashtest.c (mymain): Likewise.
* tests/networkxml2xmltest.c (mymain): Likewise.
* tests/nodedevxml2xmltest.c (myname): Likewise.
* tests/nodeinfotest.c (mymain): Likewise.
* tests/nwfilterxml2xmltest.c (mymain): Likewise.
* tests/qemuargv2xmltest.c (mymain): Likewise.
* tests/qemuhelptest.c (mymain): Likewise.
* tests/qemuxml2argvtest.c (mymain): Likewise.
* tests/qemuxml2xmltest.c (mymain): Likewise.
* tests/qparamtest.c (mymain): Likewise.
* tests/sexpr2xmltest.c (mymain): Likewise.
* tests/sockettest.c (mymain): Likewise.
* tests/statstest.c (mymain): Likewise.
* tests/storagepoolxml2xmltest.c (mymain): Likewise.
* tests/storagevolxml2xmltest.c (mymain): Likewise.
* tests/virbuftest.c (mymain): Likewise.
* tests/virshtest.c (mymain): Likewise.
* tests/vmx2xmltest.c (mymain): Likewise.
* tests/xencapstest.c (mymain): Likewise.
* tests/xmconfigtest.c (mymain): Likewise.
* tests/xml2sexprtest.c (mymain): Likewise.
* tests/xml2vmxtest.c (mymain): Likewise.
---
tests/commandtest.c | 18 +-----------------
tests/cputest.c | 18 ++----------------
tests/esxutilstest.c | 17 +----------------
tests/eventtest.c | 11 +----------
tests/hashtest.c | 3 +--
tests/interfacexml2xmltest.c | 17 +----------------
tests/networkxml2xmltest.c | 17 +----------------
tests/nodedevxml2xmltest.c | 17 +----------------
tests/nodeinfotest.c | 17 +----------------
tests/nwfilterxml2xmltest.c | 17 +----------------
tests/qemuargv2xmltest.c | 16 +---------------
tests/qemuhelptest.c | 17 +----------------
tests/qemuxml2argvtest.c | 16 +---------------
tests/qemuxml2xmltest.c | 16 +---------------
tests/qparamtest.c | 3 +--
tests/sexpr2xmltest.c | 21 +--------------------
tests/sockettest.c | 5 ++---
tests/statstest.c | 3 +--
tests/storagepoolxml2xmltest.c | 17 +----------------
tests/storagevolxml2xmltest.c | 17 +----------------
tests/testutils.c | 29 +++++++++++++++++++++++------
tests/testutils.h | 15 ++++++++++-----
tests/virbuftest.c | 3 +--
tests/virshtest.c | 18 +++---------------
tests/vmx2xmltest.c | 23 +----------------------
tests/xencapstest.c | 17 +----------------
tests/xmconfigtest.c | 18 ++----------------
tests/xml2sexprtest.c | 16 +---------------
tests/xml2vmxtest.c | 23 +----------------------
29 files changed, 65 insertions(+), 380 deletions(-)
Nice cleanup, ACK.
Matthias