]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
rename tests/conftest.c
authorGene Czarcinski <gene@czarc.net>
Tue, 19 Mar 2013 18:36:28 +0000 (14:36 -0400)
committerEric Blake <eblake@redhat.com>
Tue, 19 Mar 2013 19:13:28 +0000 (13:13 -0600)
To prevent confusion with configure's popular name
for a file, rename conftest.c to test_conf.c which
is consistent with the invoking test_conf.sh
Signed-off-by: Gene Czarcinski <gene@czarc.net>
.gitignore
tests/Makefile.am
tests/conftest.c [deleted file]
tests/test_conf.c [new file with mode: 0644]
tests/test_conf.sh

index 68030d504a45a169a68ede3889a225331b2e5598..4b448203c66c76ea3ddd00e4a752a8b9f871a464 100644 (file)
 /tests/statstest
 /tests/storagebackendsheepdogtest
 /tests/sysinfotest
+/tests/test_conf
 /tests/utiltest
 /tests/viratomictest
 /tests/virauthconfigtest
index 6bb946a16cde26849c108511934010a3982c72b8..3abd698108676a0c023b0e0919e93d582f9b1619 100644 (file)
@@ -88,7 +88,7 @@ EXTRA_DIST =          \
        xml2vmxdata \
        .valgrind.supp
 
-test_helpers = commandhelper ssh conftest
+test_helpers = commandhelper ssh test_conf
 test_programs = virshtest sockettest \
        nodeinfotest virbuftest \
        commandtest seclabeltest \
@@ -507,9 +507,9 @@ virshtest_SOURCES = \
        testutils.c testutils.h
 virshtest_LDADD = $(LDADDS)
 
-conftest_SOURCES = \
-       conftest.c
-conftest_LDADD = $(LDADDS)
+test_conf_SOURCES = \
+       test_conf.c
+test_conf_LDADD = $(LDADDS)
 
 nodeinfotest_SOURCES = \
        nodeinfotest.c testutils.h testutils.c
diff --git a/tests/conftest.c b/tests/conftest.c
deleted file mode 100644 (file)
index d5467e8..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <config.h>
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include "virconf.h"
-#include "viralloc.h"
-
-int main(int argc, char **argv)
-{
-    int ret, exit_code = EXIT_FAILURE;
-    virConfPtr conf;
-    int len = 10000;
-    char *buffer = NULL;
-
-    if (argc != 2) {
-        fprintf(stderr, "Usage: %s conf_file\n", argv[0]);
-        goto cleanup;
-    }
-
-    if (VIR_ALLOC_N(buffer, len) < 0) {
-        fprintf(stderr, "out of memory\n");
-        goto cleanup;
-    }
-    conf = virConfReadFile(argv[1], 0);
-    if (conf == NULL) {
-        fprintf(stderr, "Failed to process %s\n", argv[1]);
-        goto cleanup;
-    }
-    ret = virConfWriteMem(buffer, &len, conf);
-    if (ret < 0) {
-        fprintf(stderr, "Failed to serialize %s back\n", argv[1]);
-        goto cleanup;
-    }
-    virConfFree(conf);
-    if (fwrite(buffer, 1, len, stdout) != len) {
-        fprintf(stderr, "Write failed: %s\n", strerror(errno));
-        goto cleanup;
-    }
-
-    exit_code = EXIT_SUCCESS;
-
-cleanup:
-    VIR_FREE(buffer);
-    return exit_code;
-}
diff --git a/tests/test_conf.c b/tests/test_conf.c
new file mode 100644 (file)
index 0000000..d5467e8
--- /dev/null
@@ -0,0 +1,48 @@
+#include <config.h>
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include "virconf.h"
+#include "viralloc.h"
+
+int main(int argc, char **argv)
+{
+    int ret, exit_code = EXIT_FAILURE;
+    virConfPtr conf;
+    int len = 10000;
+    char *buffer = NULL;
+
+    if (argc != 2) {
+        fprintf(stderr, "Usage: %s conf_file\n", argv[0]);
+        goto cleanup;
+    }
+
+    if (VIR_ALLOC_N(buffer, len) < 0) {
+        fprintf(stderr, "out of memory\n");
+        goto cleanup;
+    }
+    conf = virConfReadFile(argv[1], 0);
+    if (conf == NULL) {
+        fprintf(stderr, "Failed to process %s\n", argv[1]);
+        goto cleanup;
+    }
+    ret = virConfWriteMem(buffer, &len, conf);
+    if (ret < 0) {
+        fprintf(stderr, "Failed to serialize %s back\n", argv[1]);
+        goto cleanup;
+    }
+    virConfFree(conf);
+    if (fwrite(buffer, 1, len, stdout) != len) {
+        fprintf(stderr, "Write failed: %s\n", strerror(errno));
+        goto cleanup;
+    }
+
+    exit_code = EXIT_SUCCESS;
+
+cleanup:
+    VIR_FREE(buffer);
+    return exit_code;
+}
index aa7abf6ca0eea5e4167c3c41cd0fa999a8474da2..2920e283165506673376adc44cea7f47f798f0f6 100755 (executable)
@@ -12,7 +12,7 @@ data_dir=$abs_srcdir/confdata
 for f in $(cd "$data_dir" && echo *.conf)
 do
     i=`expr $i + 1`
-    "$abs_builddir/conftest" "$data_dir/$f" > "$f-actual"
+    "$abs_builddir/test_conf" "$data_dir/$f" > "$f-actual"
     expected="$data_dir"/`echo "$f" | sed s+\.conf$+\.out+`
     if compare "$expected" "$f-actual"; then
         ret=0