summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore30
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac2
-rw-r--r--extratests/Makefile.am8
-rw-r--r--generator/.depend24
-rw-r--r--generator/Makefile.am2
-rw-r--r--generator/generator_actions.ml8
-rw-r--r--generator/generator_main.ml4
-rw-r--r--generator/generator_tests_c_api.ml (renamed from generator/generator_capitests.ml)4
-rw-r--r--regressions/Makefile.am2
-rw-r--r--src/guestfs.pod6
-rw-r--r--tests/c-api/Makefile.am (renamed from capitests/Makefile.am)4
-rw-r--r--tests/c-api/test-add-drive-opts.c (renamed from capitests/test-add-drive-opts.c)0
-rw-r--r--tests/c-api/test-add-libvirt-dom.c (renamed from capitests/test-add-libvirt-dom.c)0
-rw-r--r--tests/c-api/test-command.c (renamed from capitests/test-command.c)0
-rw-r--r--tests/c-api/test-config.c (renamed from capitests/test-config.c)0
-rw-r--r--tests/c-api/test-create-handle.c (renamed from capitests/test-create-handle.c)0
-rw-r--r--tests/c-api/test-debug-to-file.c (renamed from capitests/test-debug-to-file.c)0
-rw-r--r--tests/c-api/test-just-header.c (renamed from capitests/test-just-header.c)0
-rw-r--r--tests/c-api/test-last-errno.c (renamed from capitests/test-last-errno.c)0
-rw-r--r--tests/c-api/test-private-data.c (renamed from capitests/test-private-data.c)0
-rw-r--r--tests/c-api/test-user-cancel.c (renamed from capitests/test-user-cancel.c)0
-rw-r--r--tests/qemu/Makefile.am2
23 files changed, 46 insertions, 54 deletions
diff --git a/.gitignore b/.gitignore
index aab6cd0a..c322a279 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,21 +13,6 @@ appliance/supermin.d
autom4te.cache
*.bak
bindtests.tmp
-capitests/test.log
-capitests/test-add-drive-opts
-capitests/test-add-libvirt-dom
-capitests/test-command
-capitests/test-config
-capitests/test-create-handle
-capitests/test-debug-to-file
-capitests/test-just-header
-capitests/test-last-errno
-capitests/test-private-data
-capitests/test-user-cancel
-capitests/test*.img
-capitests/tests
-capitests/tests.c
-capitests/test*.tmp
cat/stamp-virt-*.pod
cat/virt-cat
cat/virt-cat.1
@@ -359,6 +344,21 @@ test1.img
test-tool/libguestfs-test-tool
test-tool/libguestfs-test-tool.1
test-tool/libguestfs-test-tool-helper
+tests/c-api/test.log
+tests/c-api/test-add-drive-opts
+tests/c-api/test-add-libvirt-dom
+tests/c-api/test-command
+tests/c-api/test-config
+tests/c-api/test-create-handle
+tests/c-api/test-debug-to-file
+tests/c-api/test-just-header
+tests/c-api/test-last-errno
+tests/c-api/test-private-data
+tests/c-api/test-user-cancel
+tests/c-api/test*.img
+tests/c-api/tests
+tests/c-api/tests.c
+tests/c-api/test*.tmp
tools/test.img
tools/virt-*.1
tools/virt-*.pl
diff --git a/Makefile.am b/Makefile.am
index eddf4f9d..5c8ff677 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,7 +30,7 @@ SUBDIRS += appliance
endif
# Tests and the test-tool.
-SUBDIRS += gnulib/tests capitests tests/qemu regressions extratests test-tool
+SUBDIRS += gnulib/tests tests/c-api tests/qemu regressions extratests test-tool
# Guestfish.
SUBDIRS += fish
@@ -218,7 +218,7 @@ all-local:
find $(DIST_SUBDIRS) \
-name '*.c' -o -name '*.pl' -o -name '*.pm' | \
grep -v '^perl/blib/' | \
- grep -v '^capitests/' | \
+ grep -v '^tests/' | \
grep -v '^daemon/lib/' | \
grep -v '^daemon/tests/' | \
grep -v '^examples/' | \
diff --git a/configure.ac b/configure.ac
index ce38b41e..ac09844e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1006,7 +1006,6 @@ AC_CONFIG_FILES([run],
AC_CONFIG_FILES([Makefile
align/Makefile
appliance/Makefile
- capitests/Makefile
cat/Makefile
clone/Makefile
csharp/Makefile
@@ -1051,6 +1050,7 @@ AC_CONFIG_FILES([Makefile
sparsify/Makefile
src/Makefile
test-tool/Makefile
+ tests/c-api/Makefile
tests/qemu/Makefile
tools/Makefile])
AC_OUTPUT
diff --git a/extratests/Makefile.am b/extratests/Makefile.am
index 32dcbf2b..0b4e20ea 100644
--- a/extratests/Makefile.am
+++ b/extratests/Makefile.am
@@ -70,7 +70,7 @@ GUESTS = $(shell virsh -c $(LIBVIRT_DEFAULT_URI) list --all | \
extra-tests: \
test-prerequisites \
- test-capitests \
+ test-c-api \
test-tools-null \
test-tools-internal \
test-df-real \
@@ -150,9 +150,9 @@ test-resize:
test-sparsify:
$(MAKE) -C ../sparsify VG="$(VG)" check
-# Run capitests under valgrind.
-test-capitests:
- $(MAKE) -C ../capitests VG="$(RUN_VG)" check
+# Run c-api tests under valgrind.
+test-c-api:
+ $(MAKE) -C ../tests/c-api VG="$(RUN_VG)" check
# Test OCaml bindings under valgrind.
test-ocaml:
diff --git a/generator/.depend b/generator/.depend
index ca7eb6a6..acbce64a 100644
--- a/generator/.depend
+++ b/generator/.depend
@@ -54,10 +54,10 @@ generator_daemon.cmo: generator_utils.cmi generator_types.cmo \
generator_daemon.cmx: generator_utils.cmx generator_types.cmx \
generator_structs.cmx generator_pr.cmx generator_optgroups.cmx \
generator_docstrings.cmx generator_c.cmx generator_actions.cmx
-generator_capitests.cmo: generator_utils.cmi generator_types.cmo \
+generator_tests_c_api.cmo: generator_utils.cmi generator_types.cmo \
generator_structs.cmi generator_pr.cmi generator_optgroups.cmo \
generator_docstrings.cmo generator_actions.cmi
-generator_capitests.cmx: generator_utils.cmx generator_types.cmx \
+generator_tests_c_api.cmx: generator_utils.cmx generator_types.cmx \
generator_structs.cmx generator_pr.cmx generator_optgroups.cmx \
generator_docstrings.cmx generator_actions.cmx
generator_fish.cmo: generator_utils.cmi generator_types.cmo \
@@ -142,17 +142,17 @@ generator_errnostring.cmo: generator_utils.cmi generator_types.cmo \
generator_pr.cmi generator_docstrings.cmo
generator_errnostring.cmx: generator_utils.cmx generator_types.cmx \
generator_pr.cmx generator_docstrings.cmx
-generator_main.cmo: generator_xdr.cmo generator_structs.cmi \
- generator_ruby.cmo generator_python.cmo generator_pr.cmi \
- generator_php.cmo generator_perl.cmo generator_ocaml.cmo \
+generator_main.cmo: generator_xdr.cmo generator_tests_c_api.cmo \
+ generator_structs.cmi generator_ruby.cmo generator_python.cmo \
+ generator_pr.cmi generator_php.cmo generator_perl.cmo generator_ocaml.cmo \
generator_java.cmo generator_haskell.cmo generator_fish.cmo \
generator_errnostring.cmo generator_erlang.cmo generator_daemon.cmo \
- generator_csharp.cmo generator_capitests.cmo generator_c.cmo \
- generator_bindtests.cmo generator_api_versions.cmi
-generator_main.cmx: generator_xdr.cmx generator_structs.cmx \
- generator_ruby.cmx generator_python.cmx generator_pr.cmx \
- generator_php.cmx generator_perl.cmx generator_ocaml.cmx \
+ generator_csharp.cmo generator_c.cmo generator_bindtests.cmo \
+ generator_api_versions.cmi
+generator_main.cmx: generator_xdr.cmx generator_tests_c_api.cmx \
+ generator_structs.cmx generator_ruby.cmx generator_python.cmx \
+ generator_pr.cmx generator_php.cmx generator_perl.cmx generator_ocaml.cmx \
generator_java.cmx generator_haskell.cmx generator_fish.cmx \
generator_errnostring.cmx generator_erlang.cmx generator_daemon.cmx \
- generator_csharp.cmx generator_capitests.cmx generator_c.cmx \
- generator_bindtests.cmx generator_api_versions.cmx
+ generator_csharp.cmx generator_c.cmx generator_bindtests.cmx \
+ generator_api_versions.cmx
diff --git a/generator/Makefile.am b/generator/Makefile.am
index d6120e35..dfa58934 100644
--- a/generator/Makefile.am
+++ b/generator/Makefile.am
@@ -36,7 +36,7 @@ SOURCES = \
generator_c.ml \
generator_xdr.ml \
generator_daemon.ml \
- generator_capitests.ml \
+ generator_tests_c_api.ml \
generator_fish.ml \
generator_ocaml.ml \
generator_perl.ml \
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index d506d2fb..f7a6a6cf 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -2718,7 +2718,7 @@ This uses the L<blockdev(8)> command.");
[InitScratchFS, Always, TestOutput (
(* Pick a file from cwd which isn't likely to change. *)
[["mkdir"; "/upload"];
- ["upload"; "../COPYING.LIB"; "/upload/COPYING.LIB"];
+ ["upload"; "../../COPYING.LIB"; "/upload/COPYING.LIB"];
["checksum"; "md5"; "/upload/COPYING.LIB"]],
Digest.to_hex (Digest.file "COPYING.LIB"))],
"upload a file from the local machine",
@@ -2734,7 +2734,7 @@ See also C<guestfs_download>.");
[InitScratchFS, Always, TestOutput (
(* Pick a file from cwd which isn't likely to change. *)
[["mkdir"; "/download"];
- ["upload"; "../COPYING.LIB"; "/download/COPYING.LIB"];
+ ["upload"; "../../COPYING.LIB"; "/download/COPYING.LIB"];
["download"; "/download/COPYING.LIB"; "testdownload.tmp"];
["upload"; "testdownload.tmp"; "/download/upload"];
["checksum"; "md5"; "/download/upload"]],
@@ -5936,7 +5936,7 @@ See also C<guestfs_part_to_partnum>.");
("upload_offset", (RErr, [FileIn "filename"; Dev_or_Path "remotefilename"; Int64 "offset"], []), 273, [Progress],
(let md5 = Digest.to_hex (Digest.file "COPYING.LIB") in
[InitScratchFS, Always, TestOutput (
- [["upload_offset"; "../COPYING.LIB"; "/upload_offset"; "0"];
+ [["upload_offset"; "../../COPYING.LIB"; "/upload_offset"; "0"];
["checksum"; "md5"; "/upload_offset"]], md5)]),
"upload a file from the local machine with offset",
"\
@@ -5964,7 +5964,7 @@ See also C<guestfs_upload>, C<guestfs_pwrite>.");
[InitScratchFS, Always, TestOutput (
(* Pick a file from cwd which isn't likely to change. *)
[["mkdir"; "/download_offset"];
- ["upload"; "../COPYING.LIB"; "/download_offset/COPYING.LIB"];
+ ["upload"; "../../COPYING.LIB"; "/download_offset/COPYING.LIB"];
["download_offset"; "/download_offset/COPYING.LIB"; "testdownload.tmp"; offset; size];
["upload_offset"; "testdownload.tmp"; "/download_offset/COPYING.LIB"; offset];
["checksum"; "md5"; "/download_offset/COPYING.LIB"]], md5)]),
diff --git a/generator/generator_main.ml b/generator/generator_main.ml
index 951474ac..7e4e4ed4 100644
--- a/generator/generator_main.ml
+++ b/generator/generator_main.ml
@@ -28,7 +28,7 @@ open Generator_api_versions
open Generator_c
open Generator_xdr
open Generator_daemon
-open Generator_capitests
+open Generator_tests_c_api
open Generator_fish
open Generator_ocaml
open Generator_perl
@@ -95,7 +95,7 @@ Run it from the top source directory using the command
output_to "daemon/names.c" generate_daemon_names;
output_to "daemon/optgroups.c" generate_daemon_optgroups_c;
output_to "daemon/optgroups.h" generate_daemon_optgroups_h;
- output_to "capitests/tests.c" generate_tests;
+ output_to "tests/c-api/tests.c" generate_tests;
output_to "fish/cmds_gperf.gperf" generate_fish_cmds_gperf;
output_to "fish/cmds.c" generate_fish_cmds;
output_to "fish/completion.c" generate_fish_completion;
diff --git a/generator/generator_capitests.ml b/generator/generator_tests_c_api.ml
index f9cacf24..5b4f7a80 100644
--- a/generator/generator_capitests.ml
+++ b/generator/generator_tests_c_api.ml
@@ -257,8 +257,8 @@ int main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
- if (guestfs_add_drive_ro (g, \"../images/test.iso\") == -1) {
- printf (\"guestfs_add_drive_ro ../images/test.iso FAILED\\n\");
+ if (guestfs_add_drive_ro (g, \"../../images/test.iso\") == -1) {
+ printf (\"guestfs_add_drive_ro ../../images/test.iso FAILED\\n\");
exit (EXIT_FAILURE);
}
diff --git a/regressions/Makefile.am b/regressions/Makefile.am
index 928905cc..00c25f1e 100644
--- a/regressions/Makefile.am
+++ b/regressions/Makefile.am
@@ -18,8 +18,6 @@
# Regression tests and other important tests which are not
# specific to the C API. We can write these more easily in
# higher level languages than C.
-#
-# See also capitests/
include $(top_srcdir)/subdir-rules.mk
diff --git a/src/guestfs.pod b/src/guestfs.pod
index 2e18fd6d..45f63297 100644
--- a/src/guestfs.pod
+++ b/src/guestfs.pod
@@ -2799,7 +2799,7 @@ Packagers can run only certain tests by setting for example:
TEST_ONLY="vfs_type zerofree"
-See C<capitests/tests.c> for more details of how these environment
+See C<tests/c-api/tests.c> for more details of how these environment
variables work.
=head2 DEBUGGING NEW API ACTIONS
@@ -2917,10 +2917,6 @@ L<virt-alignment-scan(1)> command and documentation.
The libguestfs appliance, build scripts and so on.
-=item C<capitests>
-
-Automated tests of the C API.
-
=item C<cat>
The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands
diff --git a/capitests/Makefile.am b/tests/c-api/Makefile.am
index d32b7fc3..0b6c6838 100644
--- a/capitests/Makefile.am
+++ b/tests/c-api/Makefile.am
@@ -133,7 +133,7 @@ test_debug_to_file_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
test_debug_to_file_LDADD = \
$(top_builddir)/src/libguestfs.la \
- ../gnulib/lib/libgnu.la
+ $(top_builddir)/gnulib/lib/libgnu.la
#if HAVE_LIBVIRT
#test_add_libvirt_dom_SOURCES = test-add-libvirt-dom.c
@@ -143,7 +143,7 @@ test_debug_to_file_LDADD = \
# $(WARN_CFLAGS) $(WERROR_CFLAGS)
#test_add_libvirt_dom_LDADD = \
# $(top_builddir)/src/libguestfs.la $(LIBVIRT_LIBS) \
-# $(LTLIBTHREAD) ../gnulib/lib/libgnu.la
+# $(LTLIBTHREAD) $(top_builddir)/gnulib/lib/libgnu.la
#endif
# Run the tests under valgrind.
diff --git a/capitests/test-add-drive-opts.c b/tests/c-api/test-add-drive-opts.c
index 897c6fac..897c6fac 100644
--- a/capitests/test-add-drive-opts.c
+++ b/tests/c-api/test-add-drive-opts.c
diff --git a/capitests/test-add-libvirt-dom.c b/tests/c-api/test-add-libvirt-dom.c
index 6f994056..6f994056 100644
--- a/capitests/test-add-libvirt-dom.c
+++ b/tests/c-api/test-add-libvirt-dom.c
diff --git a/capitests/test-command.c b/tests/c-api/test-command.c
index c23b7d17..c23b7d17 100644
--- a/capitests/test-command.c
+++ b/tests/c-api/test-command.c
diff --git a/capitests/test-config.c b/tests/c-api/test-config.c
index c5411232..c5411232 100644
--- a/capitests/test-config.c
+++ b/tests/c-api/test-config.c
diff --git a/capitests/test-create-handle.c b/tests/c-api/test-create-handle.c
index edea19f6..edea19f6 100644
--- a/capitests/test-create-handle.c
+++ b/tests/c-api/test-create-handle.c
diff --git a/capitests/test-debug-to-file.c b/tests/c-api/test-debug-to-file.c
index 5eb56104..5eb56104 100644
--- a/capitests/test-debug-to-file.c
+++ b/tests/c-api/test-debug-to-file.c
diff --git a/capitests/test-just-header.c b/tests/c-api/test-just-header.c
index 57551f53..57551f53 100644
--- a/capitests/test-just-header.c
+++ b/tests/c-api/test-just-header.c
diff --git a/capitests/test-last-errno.c b/tests/c-api/test-last-errno.c
index 31a5c4de..31a5c4de 100644
--- a/capitests/test-last-errno.c
+++ b/tests/c-api/test-last-errno.c
diff --git a/capitests/test-private-data.c b/tests/c-api/test-private-data.c
index f2ff647b..f2ff647b 100644
--- a/capitests/test-private-data.c
+++ b/tests/c-api/test-private-data.c
diff --git a/capitests/test-user-cancel.c b/tests/c-api/test-user-cancel.c
index 0cc049a0..0cc049a0 100644
--- a/capitests/test-user-cancel.c
+++ b/tests/c-api/test-user-cancel.c
diff --git a/tests/qemu/Makefile.am b/tests/qemu/Makefile.am
index fb95a747..ad735101 100644
--- a/tests/qemu/Makefile.am
+++ b/tests/qemu/Makefile.am
@@ -17,8 +17,6 @@
# Safety and liveness tests of components that libguestfs depends upon
# (not of libguestfs itself). Mainly this is for qemu and the kernel.
-#
-# See also capitests and regressions directories.
include $(top_srcdir)/subdir-rules.mk