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@xxxxxxxxx> --- tests/Makefile.am | 8 ++++---- tests/conftest.c | 48 ------------------------------------------------ tests/test_conf.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/test_conf.sh | 2 +- 4 files changed, 53 insertions(+), 53 deletions(-) delete mode 100644 tests/conftest.c create mode 100644 tests/test_conf.c diff --git a/tests/Makefile.am b/tests/Makefile.am index d3a7868..837ae93 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 \ @@ -506,9 +506,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 index d5467e8..0000000 --- a/tests/conftest.c +++ /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 index 0000000..d5467e8 --- /dev/null +++ b/tests/test_conf.c @@ -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; +} diff --git a/tests/test_conf.sh b/tests/test_conf.sh index aa7abf6..2920e28 100755 --- a/tests/test_conf.sh +++ b/tests/test_conf.sh @@ -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 -- 1.8.1.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list