Move C API tests out of root build dir into 'capitests' subdir.

This commit is contained in:
Richard W.M. Jones
2009-05-28 13:15:34 +01:00
parent a1e8cdf2a2
commit e2206733d1
10 changed files with 62 additions and 46 deletions

8
.gitignore vendored
View File

@@ -25,6 +25,10 @@ appliance/make-initramfs.sh.in.old
appliance/update-initramfs.sh
appliance/vmlinuz.*
autom4te.cache
capitests/test-command
capitests/test*.img
capitests/test*.tmp
capitests/tests
compile
config.h
config.h.in
@@ -91,7 +95,3 @@ ruby/Rakefile
ruby/ext/guestfs/extconf.h
ruby/ext/guestfs/mkmf.log
stamp-h1
test-command
test*.img
test*.tmp
tests

View File

@@ -34,6 +34,9 @@ Directories
appliance/
The qemu appliance, build scripts and so on.
capitests/
Automated tests of the C API.
contrib/
Outside contributions, experimental parts.

View File

@@ -17,7 +17,7 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src daemon appliance fish po examples images
SUBDIRS = src daemon appliance fish po examples images capitests
if HAVE_OCAML
SUBDIRS += ocaml
@@ -47,7 +47,6 @@ EXTRA_DIST = \
guestfish.pod guestfish-actions.pod \
html/pod.css \
HACKING TODO \
tests.c \
libguestfs.pc libguestfs.pc.in \
gitlog-to-changelog \
recipes/LICENSE \
@@ -57,40 +56,10 @@ EXTRA_DIST = \
recipes/*.example \
html/recipes.css \
make-recipes.sh \
test-cleanup.sh \
contrib/README \
contrib/febootstrap/install.title \
contrib/febootstrap/install.html \
contrib/febootstrap/install.sh \
test-bootbootboot.sh
# Tests. These are auto-generated from the test descriptions
# in the generator.
check_PROGRAMS = tests test-command
tests_SOURCES = tests.c
tests_CFLAGS = \
-I$(top_builddir)/src -Wall
tests_LDADD = $(top_builddir)/src/libguestfs.la
TESTS = tests test-bootbootboot.sh
TESTS_ENVIRONMENT = \
SKIP_TEST_COMMAND=$(shell ldd test-command | grep -sq 'not a dynamic executable' || echo 1) \
SKIP_TEST_COMMAND_LINES=$(shell ldd test-command | grep -sq 'not a dynamic executable' || echo 1) \
SKIP_TEST_ZEROFREE=$(shell test -x initramfs/usr/sbin/zerofree || echo 1) \
$(VG)
# Run the tests under valgrind.
valgrind:
$(MAKE) check VG="valgrind --quiet --leak-check=full"
# This binary must be statically linked. It is used for testing
# the "guestfs_command" and "guestfs_command_lines" functions.
test_command_SOURCES = test-command.c
test_command_LDFLAGS = -all-static
contrib/febootstrap/install.sh
# Manual pages.
# guestfs-actions.pod and guestfs-structs are autogenerated. There is

49
capitests/Makefile.am Normal file
View File

@@ -0,0 +1,49 @@
# libguestfs
# Copyright (C) 2009 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
EXTRA_DIST = \
tests.c \
test-cleanup.sh \
test-bootbootboot.sh
# Tests. These are auto-generated from the test descriptions
# in the generator.
check_PROGRAMS = tests test-command
tests_SOURCES = tests.c
tests_CFLAGS = \
-I$(top_builddir)/src -Wall
tests_LDADD = $(top_builddir)/src/libguestfs.la
TESTS = tests test-bootbootboot.sh
TESTS_ENVIRONMENT = \
SKIP_TEST_COMMAND=$(shell ldd test-command | grep -sq 'not a dynamic executable' || echo 1) \
SKIP_TEST_COMMAND_LINES=$(shell ldd test-command | grep -sq 'not a dynamic executable' || echo 1) \
SKIP_TEST_ZEROFREE=$(shell test -x ../initramfs/usr/sbin/zerofree || echo 1) \
$(VG)
# Run the tests under valgrind.
valgrind:
$(MAKE) check VG="valgrind --quiet --leak-check=full"
# This binary must be statically linked. It is used for testing
# the "guestfs_command" and "guestfs_command_lines" functions.
test_command_SOURCES = test-command.c
test_command_LDFLAGS = -all-static

View File

@@ -15699,10 +15699,7 @@ int main (int argc, char *argv[])
guestfs_set_error_handler (g, print_error, NULL);
srcdir = getenv ("srcdir");
if (!srcdir) srcdir = ".";
chdir (srcdir);
guestfs_set_path (g, "appliance");
guestfs_set_path (g, "../appliance");
filename = "test1.img";
fd = open (filename, O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK|O_TRUNC, 0666);

View File

@@ -449,6 +449,7 @@ AC_CONFIG_FILES([Makefile
appliance/Makefile
appliance/make-initramfs.sh appliance/update-initramfs.sh
images/Makefile
capitests/Makefile
ocaml/Makefile ocaml/examples/Makefile
perl/Makefile
python/Makefile

View File

@@ -3717,10 +3717,7 @@ int main (int argc, char *argv[])
guestfs_set_error_handler (g, print_error, NULL);
srcdir = getenv (\"srcdir\");
if (!srcdir) srcdir = \".\";
chdir (srcdir);
guestfs_set_path (g, \"appliance\");
guestfs_set_path (g, \"../appliance\");
filename = \"test1.img\";
fd = open (filename, O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK|O_TRUNC, 0666);
@@ -7182,7 +7179,7 @@ Run it from the top source directory using the command
generate_daemon_actions ();
close ();
let close = output_to "tests.c" in
let close = output_to "capitests/tests.c" in
generate_tests ();
close ();