Skip to content

Commit

Permalink
tests: Rename capitests -> tests/c-api.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwmjones committed Dec 22, 2011
1 parent 72f5487 commit 5d93d70
Show file tree
Hide file tree
Showing 23 changed files with 46 additions and 54 deletions.
30 changes: 15 additions & 15 deletions .gitignore
Expand Up @@ -13,21 +13,6 @@ appliance/supermin.d
autom4te.cache autom4te.cache
*.bak *.bak
bindtests.tmp 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/stamp-virt-*.pod
cat/virt-cat cat/virt-cat
cat/virt-cat.1 cat/virt-cat.1
Expand Down Expand Up @@ -359,6 +344,21 @@ test1.img
test-tool/libguestfs-test-tool test-tool/libguestfs-test-tool
test-tool/libguestfs-test-tool.1 test-tool/libguestfs-test-tool.1
test-tool/libguestfs-test-tool-helper 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/test.img
tools/virt-*.1 tools/virt-*.1
tools/virt-*.pl tools/virt-*.pl
Expand Down
4 changes: 2 additions & 2 deletions Makefile.am
Expand Up @@ -30,7 +30,7 @@ SUBDIRS += appliance
endif endif


# Tests and the test-tool. # 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. # Guestfish.
SUBDIRS += fish SUBDIRS += fish
Expand Down Expand Up @@ -218,7 +218,7 @@ all-local:
find $(DIST_SUBDIRS) \ find $(DIST_SUBDIRS) \
-name '*.c' -o -name '*.pl' -o -name '*.pm' | \ -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
grep -v '^perl/blib/' | \ grep -v '^perl/blib/' | \
grep -v '^capitests/' | \ grep -v '^tests/' | \
grep -v '^daemon/lib/' | \ grep -v '^daemon/lib/' | \
grep -v '^daemon/tests/' | \ grep -v '^daemon/tests/' | \
grep -v '^examples/' | \ grep -v '^examples/' | \
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -1006,7 +1006,6 @@ AC_CONFIG_FILES([run],
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
align/Makefile align/Makefile
appliance/Makefile appliance/Makefile
capitests/Makefile
cat/Makefile cat/Makefile
clone/Makefile clone/Makefile
csharp/Makefile csharp/Makefile
Expand Down Expand Up @@ -1051,6 +1050,7 @@ AC_CONFIG_FILES([Makefile
sparsify/Makefile sparsify/Makefile
src/Makefile src/Makefile
test-tool/Makefile test-tool/Makefile
tests/c-api/Makefile
tests/qemu/Makefile tests/qemu/Makefile
tools/Makefile]) tools/Makefile])
AC_OUTPUT AC_OUTPUT
Expand Down
8 changes: 4 additions & 4 deletions extratests/Makefile.am
Expand Up @@ -70,7 +70,7 @@ GUESTS = $(shell virsh -c $(LIBVIRT_DEFAULT_URI) list --all | \


extra-tests: \ extra-tests: \
test-prerequisites \ test-prerequisites \
test-capitests \ test-c-api \
test-tools-null \ test-tools-null \
test-tools-internal \ test-tools-internal \
test-df-real \ test-df-real \
Expand Down Expand Up @@ -150,9 +150,9 @@ test-resize:
test-sparsify: test-sparsify:
$(MAKE) -C ../sparsify VG="$(VG)" check $(MAKE) -C ../sparsify VG="$(VG)" check


# Run capitests under valgrind. # Run c-api tests under valgrind.
test-capitests: test-c-api:
$(MAKE) -C ../capitests VG="$(RUN_VG)" check $(MAKE) -C ../tests/c-api VG="$(RUN_VG)" check


# Test OCaml bindings under valgrind. # Test OCaml bindings under valgrind.
test-ocaml: test-ocaml:
Expand Down
24 changes: 12 additions & 12 deletions generator/.depend
Expand Up @@ -54,10 +54,10 @@ generator_daemon.cmo: generator_utils.cmi generator_types.cmo \
generator_daemon.cmx: generator_utils.cmx generator_types.cmx \ generator_daemon.cmx: generator_utils.cmx generator_types.cmx \
generator_structs.cmx generator_pr.cmx generator_optgroups.cmx \ generator_structs.cmx generator_pr.cmx generator_optgroups.cmx \
generator_docstrings.cmx generator_c.cmx generator_actions.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_structs.cmi generator_pr.cmi generator_optgroups.cmo \
generator_docstrings.cmo generator_actions.cmi 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_structs.cmx generator_pr.cmx generator_optgroups.cmx \
generator_docstrings.cmx generator_actions.cmx generator_docstrings.cmx generator_actions.cmx
generator_fish.cmo: generator_utils.cmi generator_types.cmo \ generator_fish.cmo: generator_utils.cmi generator_types.cmo \
Expand Down Expand Up @@ -142,17 +142,17 @@ generator_errnostring.cmo: generator_utils.cmi generator_types.cmo \
generator_pr.cmi generator_docstrings.cmo generator_pr.cmi generator_docstrings.cmo
generator_errnostring.cmx: generator_utils.cmx generator_types.cmx \ generator_errnostring.cmx: generator_utils.cmx generator_types.cmx \
generator_pr.cmx generator_docstrings.cmx generator_pr.cmx generator_docstrings.cmx
generator_main.cmo: generator_xdr.cmo generator_structs.cmi \ generator_main.cmo: generator_xdr.cmo generator_tests_c_api.cmo \
generator_ruby.cmo generator_python.cmo generator_pr.cmi \ generator_structs.cmi generator_ruby.cmo generator_python.cmo \
generator_php.cmo generator_perl.cmo generator_ocaml.cmo \ generator_pr.cmi generator_php.cmo generator_perl.cmo generator_ocaml.cmo \
generator_java.cmo generator_haskell.cmo generator_fish.cmo \ generator_java.cmo generator_haskell.cmo generator_fish.cmo \
generator_errnostring.cmo generator_erlang.cmo generator_daemon.cmo \ generator_errnostring.cmo generator_erlang.cmo generator_daemon.cmo \
generator_csharp.cmo generator_capitests.cmo generator_c.cmo \ generator_csharp.cmo generator_c.cmo generator_bindtests.cmo \
generator_bindtests.cmo generator_api_versions.cmi generator_api_versions.cmi
generator_main.cmx: generator_xdr.cmx generator_structs.cmx \ generator_main.cmx: generator_xdr.cmx generator_tests_c_api.cmx \
generator_ruby.cmx generator_python.cmx generator_pr.cmx \ generator_structs.cmx generator_ruby.cmx generator_python.cmx \
generator_php.cmx generator_perl.cmx generator_ocaml.cmx \ generator_pr.cmx generator_php.cmx generator_perl.cmx generator_ocaml.cmx \
generator_java.cmx generator_haskell.cmx generator_fish.cmx \ generator_java.cmx generator_haskell.cmx generator_fish.cmx \
generator_errnostring.cmx generator_erlang.cmx generator_daemon.cmx \ generator_errnostring.cmx generator_erlang.cmx generator_daemon.cmx \
generator_csharp.cmx generator_capitests.cmx generator_c.cmx \ generator_csharp.cmx generator_c.cmx generator_bindtests.cmx \
generator_bindtests.cmx generator_api_versions.cmx generator_api_versions.cmx
2 changes: 1 addition & 1 deletion generator/Makefile.am
Expand Up @@ -36,7 +36,7 @@ SOURCES = \
generator_c.ml \ generator_c.ml \
generator_xdr.ml \ generator_xdr.ml \
generator_daemon.ml \ generator_daemon.ml \
generator_capitests.ml \ generator_tests_c_api.ml \
generator_fish.ml \ generator_fish.ml \
generator_ocaml.ml \ generator_ocaml.ml \
generator_perl.ml \ generator_perl.ml \
Expand Down
8 changes: 4 additions & 4 deletions generator/generator_actions.ml
Expand Up @@ -2718,7 +2718,7 @@ This uses the L<blockdev(8)> command.");
[InitScratchFS, Always, TestOutput ( [InitScratchFS, Always, TestOutput (
(* Pick a file from cwd which isn't likely to change. *) (* Pick a file from cwd which isn't likely to change. *)
[["mkdir"; "/upload"]; [["mkdir"; "/upload"];
["upload"; "../COPYING.LIB"; "/upload/COPYING.LIB"]; ["upload"; "../../COPYING.LIB"; "/upload/COPYING.LIB"];
["checksum"; "md5"; "/upload/COPYING.LIB"]], ["checksum"; "md5"; "/upload/COPYING.LIB"]],
Digest.to_hex (Digest.file "COPYING.LIB"))], Digest.to_hex (Digest.file "COPYING.LIB"))],
"upload a file from the local machine", "upload a file from the local machine",
Expand All @@ -2734,7 +2734,7 @@ See also C<guestfs_download>.");
[InitScratchFS, Always, TestOutput ( [InitScratchFS, Always, TestOutput (
(* Pick a file from cwd which isn't likely to change. *) (* Pick a file from cwd which isn't likely to change. *)
[["mkdir"; "/download"]; [["mkdir"; "/download"];
["upload"; "../COPYING.LIB"; "/download/COPYING.LIB"]; ["upload"; "../../COPYING.LIB"; "/download/COPYING.LIB"];
["download"; "/download/COPYING.LIB"; "testdownload.tmp"]; ["download"; "/download/COPYING.LIB"; "testdownload.tmp"];
["upload"; "testdownload.tmp"; "/download/upload"]; ["upload"; "testdownload.tmp"; "/download/upload"];
["checksum"; "md5"; "/download/upload"]], ["checksum"; "md5"; "/download/upload"]],
Expand Down Expand Up @@ -5936,7 +5936,7 @@ See also C<guestfs_part_to_partnum>.");
("upload_offset", (RErr, [FileIn "filename"; Dev_or_Path "remotefilename"; Int64 "offset"], []), 273, [Progress], ("upload_offset", (RErr, [FileIn "filename"; Dev_or_Path "remotefilename"; Int64 "offset"], []), 273, [Progress],
(let md5 = Digest.to_hex (Digest.file "COPYING.LIB") in (let md5 = Digest.to_hex (Digest.file "COPYING.LIB") in
[InitScratchFS, Always, TestOutput ( [InitScratchFS, Always, TestOutput (
[["upload_offset"; "../COPYING.LIB"; "/upload_offset"; "0"]; [["upload_offset"; "../../COPYING.LIB"; "/upload_offset"; "0"];
["checksum"; "md5"; "/upload_offset"]], md5)]), ["checksum"; "md5"; "/upload_offset"]], md5)]),
"upload a file from the local machine with offset", "upload a file from the local machine with offset",
"\ "\
Expand Down Expand Up @@ -5964,7 +5964,7 @@ See also C<guestfs_upload>, C<guestfs_pwrite>.");
[InitScratchFS, Always, TestOutput ( [InitScratchFS, Always, TestOutput (
(* Pick a file from cwd which isn't likely to change. *) (* Pick a file from cwd which isn't likely to change. *)
[["mkdir"; "/download_offset"]; [["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]; ["download_offset"; "/download_offset/COPYING.LIB"; "testdownload.tmp"; offset; size];
["upload_offset"; "testdownload.tmp"; "/download_offset/COPYING.LIB"; offset]; ["upload_offset"; "testdownload.tmp"; "/download_offset/COPYING.LIB"; offset];
["checksum"; "md5"; "/download_offset/COPYING.LIB"]], md5)]), ["checksum"; "md5"; "/download_offset/COPYING.LIB"]], md5)]),
Expand Down
4 changes: 2 additions & 2 deletions generator/generator_main.ml
Expand Up @@ -28,7 +28,7 @@ open Generator_api_versions
open Generator_c open Generator_c
open Generator_xdr open Generator_xdr
open Generator_daemon open Generator_daemon
open Generator_capitests open Generator_tests_c_api
open Generator_fish open Generator_fish
open Generator_ocaml open Generator_ocaml
open Generator_perl open Generator_perl
Expand Down Expand Up @@ -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/names.c" generate_daemon_names;
output_to "daemon/optgroups.c" generate_daemon_optgroups_c; output_to "daemon/optgroups.c" generate_daemon_optgroups_c;
output_to "daemon/optgroups.h" generate_daemon_optgroups_h; 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_gperf.gperf" generate_fish_cmds_gperf;
output_to "fish/cmds.c" generate_fish_cmds; output_to "fish/cmds.c" generate_fish_cmds;
output_to "fish/completion.c" generate_fish_completion; output_to "fish/completion.c" generate_fish_completion;
Expand Down
Expand Up @@ -257,8 +257,8 @@ int main (int argc, char *argv[])
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
if (guestfs_add_drive_ro (g, \"../images/test.iso\") == -1) { if (guestfs_add_drive_ro (g, \"../../images/test.iso\") == -1) {
printf (\"guestfs_add_drive_ro ../images/test.iso FAILED\\n\"); printf (\"guestfs_add_drive_ro ../../images/test.iso FAILED\\n\");
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
Expand Down
2 changes: 0 additions & 2 deletions regressions/Makefile.am
Expand Up @@ -18,8 +18,6 @@
# Regression tests and other important tests which are not # Regression tests and other important tests which are not
# specific to the C API. We can write these more easily in # specific to the C API. We can write these more easily in
# higher level languages than C. # higher level languages than C.
#
# See also capitests/


include $(top_srcdir)/subdir-rules.mk include $(top_srcdir)/subdir-rules.mk


Expand Down
6 changes: 1 addition & 5 deletions src/guestfs.pod
Expand Up @@ -2799,7 +2799,7 @@ Packagers can run only certain tests by setting for example:


TEST_ONLY="vfs_type zerofree" 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. variables work.


=head2 DEBUGGING NEW API ACTIONS =head2 DEBUGGING NEW API ACTIONS
Expand Down Expand Up @@ -2917,10 +2917,6 @@ L<virt-alignment-scan(1)> command and documentation.


The libguestfs appliance, build scripts and so on. The libguestfs appliance, build scripts and so on.


=item C<capitests>

Automated tests of the C API.

=item C<cat> =item C<cat>


The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands
Expand Down
4 changes: 2 additions & 2 deletions capitests/Makefile.am → tests/c-api/Makefile.am
Expand Up @@ -133,7 +133,7 @@ test_debug_to_file_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS) $(WARN_CFLAGS) $(WERROR_CFLAGS)
test_debug_to_file_LDADD = \ test_debug_to_file_LDADD = \
$(top_builddir)/src/libguestfs.la \ $(top_builddir)/src/libguestfs.la \
../gnulib/lib/libgnu.la $(top_builddir)/gnulib/lib/libgnu.la


#if HAVE_LIBVIRT #if HAVE_LIBVIRT
#test_add_libvirt_dom_SOURCES = test-add-libvirt-dom.c #test_add_libvirt_dom_SOURCES = test-add-libvirt-dom.c
Expand All @@ -143,7 +143,7 @@ test_debug_to_file_LDADD = \
# $(WARN_CFLAGS) $(WERROR_CFLAGS) # $(WARN_CFLAGS) $(WERROR_CFLAGS)
#test_add_libvirt_dom_LDADD = \ #test_add_libvirt_dom_LDADD = \
# $(top_builddir)/src/libguestfs.la $(LIBVIRT_LIBS) \ # $(top_builddir)/src/libguestfs.la $(LIBVIRT_LIBS) \
# $(LTLIBTHREAD) ../gnulib/lib/libgnu.la # $(LTLIBTHREAD) $(top_builddir)/gnulib/lib/libgnu.la
#endif #endif


# Run the tests under valgrind. # Run the tests under valgrind.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions tests/qemu/Makefile.am
Expand Up @@ -17,8 +17,6 @@


# Safety and liveness tests of components that libguestfs depends upon # Safety and liveness tests of components that libguestfs depends upon
# (not of libguestfs itself). Mainly this is for qemu and the kernel. # (not of libguestfs itself). Mainly this is for qemu and the kernel.
#
# See also capitests and regressions directories.


include $(top_srcdir)/subdir-rules.mk include $(top_srcdir)/subdir-rules.mk


Expand Down

0 comments on commit 5d93d70

Please sign in to comment.