2011/4/29 Eric Blake <eblake@xxxxxxxxxx>: > 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 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list