]> xenbits.xensource.com Git - libvirt.git/commitdiff
seclabeltest: Update to use VIRT_TEST_MAIN
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 25 Feb 2016 16:13:00 +0000 (17:13 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 10 May 2016 15:16:11 +0000 (17:16 +0200)
Our tests should use either VIRT_TEST_MAIN() or
VIRT_TEST_MAIN_PRELOAD() macros which create main() function and
call the passed callback subsequently. This is important because
the wrapper which calls the callback eventually does important
stuff like setting logging based on env variables and such.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tests/Makefile.am
tests/seclabeltest.c

index cb72cdf13973df92943324be4ab1037bdfa8a387..75efb902dd1193afa81d41b8acdb28411a9b8e32 100644 (file)
@@ -1190,7 +1190,7 @@ virauthconfigtest_SOURCES = \
 virauthconfigtest_LDADD = $(LDADDS)
 
 seclabeltest_SOURCES = \
-       seclabeltest.c
+       seclabeltest.c testutils.h testutils.c
 seclabeltest_LDADD = $(LDADDS)
 
 if WITH_SECDRIVER_SELINUX
index 6b1e78955a7abfb2bff43e9121d5a46d7a832780..be6e79ff6af9d28c4a709a6e03c7066132293ca5 100644 (file)
@@ -7,9 +7,10 @@
 #include <errno.h>
 #include "security/security_driver.h"
 #include "virrandom.h"
+#include "testutils.h"
 
-int
-main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
+static int
+mymain(void)
 {
     virSecurityManagerPtr mgr;
     const char *doi, *model;
@@ -41,3 +42,5 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
 
     return 0;
 }
+
+VIRT_TEST_MAIN(mymain)