summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2020-02-18 20:32:19 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2020-02-19 05:08:08 +0100
commit2b294a074c9212a347ef0cd914c8286f1e578469 (patch)
tree2b62ed34073d5a907453aa2282e08574e22f0479 /tests
parentfb75d3632dec4419594fb0d2db5d7ccebadf1841 (diff)
downloadlibgphoto2-2b294a074c9212a347ef0cd914c8286f1e578469.tar.gz
tests/Makefile.am: Consistent comments and definitions
Consistently define test programs, and use comments to structurize the tests/Makefile.am file.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am87
1 files changed, 56 insertions, 31 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8e2ef92fe..c20c0e9f8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,14 +1,20 @@
+########################################################################
+# Housekeeping
+########################################################################
+
SUBDIRS = ddb
-EXTRA_DIST =
EXTRA_PROGRAMS =
check_PROGRAMS =
-check_SCRIPTS =
TESTS =
INSTALL_TESTS =
noinst_PROGRAMS =
+########################################################################
+# Set up test environment
+########################################################################
+
# Now that we build all the camlibs in one directory, we can run our checks
# with CAMLIBS set to the camlib build directory.
TESTS_ENVIRONMENT = env \
@@ -19,15 +25,21 @@ INSTALL_TESTS_ENVIRONMENT = env \
CAMLIBS="$(DESTDIR)$(camlibdir)" \
LD_LIBRARY_PATH="$(DESTDIR)$(libdir)$${LD_LIBRARY_PATH+:$${LD_LIBRARY_PATH}}"
-AM_CPPFLAGS += -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/libgphoto2_port -I$(top_srcdir)/libgphoto2 -I$(top_builddir)/libgphoto2
-CLEANFILES = $(check_SCRIPTS)
+########################################################################
+# Define test programs
+########################################################################
+
+
+# Default CPPFLAGS to use
+AM_CPPFLAGS += -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/libgphoto2_port -I$(top_srcdir)/libgphoto2 -I$(top_builddir)/libgphoto2
-TESTS += test-endian
-check_PROGRAMS += test-endian
-test_endian_SOURCE = test-endian.c
-test_endian_LDADD = \
+# Test endianness conversions
+TESTS += test-endian
+check_PROGRAMS += test-endian
+test_endian_SOURCES = test-endian.c
+test_endian_LDADD = \
$(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
$(LIBLTDL) \
@@ -35,28 +47,32 @@ test_endian_LDADD = \
$(INTLLIBS)
-noinst_PROGRAMS += print-libgphoto2-version
-print_libgphoto2_version_SOURCE = print-libgphoto2-version.c
-print_libgphoto2_version_LDADD =
-print_libgphoto2_version_LDADD += $(top_builddir)/libgphoto2/libgphoto2.la
-print_libgphoto2_version_LDADD += $(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la
-print_libgphoto2_version_LDADD += $(LIBLTDL)
-print_libgphoto2_version_LDADD += $(LIBEXIF_LIBS)
-print_libgphoto2_version_LDADD += $(INTLLIBS)
+# Print the libgphoto2 version information for this libgphoto2 build
+noinst_PROGRAMS += print-libgphoto2-version
+print_libgphoto2_version_SOURCES = print-libgphoto2-version.c
+print_libgphoto2_version_LDADD =
+print_libgphoto2_version_LDADD += $(top_builddir)/libgphoto2/libgphoto2.la
+print_libgphoto2_version_LDADD += $(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la
+print_libgphoto2_version_LDADD += $(LIBLTDL)
+print_libgphoto2_version_LDADD += $(LIBEXIF_LIBS)
+print_libgphoto2_version_LDADD += $(INTLLIBS)
-noinst_PROGRAMS += test-gphoto2
-test_gphoto2_SOURCE = test-gphoto2.c
-test_gphoto2_LDADD = \
+# Test basic libgphoto2 functionality
+noinst_PROGRAMS += test-gphoto2
+test_gphoto2_SOURCES = test-gphoto2.c
+test_gphoto2_LDADD = \
$(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
$(LIBLTDL) \
$(LIBEXIF_LIBS) \
$(INTLLIBS)
-noinst_PROGRAMS += test-filesys
-test_filesys_SOURCE = test-filesys.c
-test_filesys_LDADD = \
+
+# Test gp_filesystem_* functions
+noinst_PROGRAMS += test-filesys
+test_filesys_SOURCES = test-filesys.c
+test_filesys_LDADD = \
$(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
$(LIBLTDL) \
@@ -64,12 +80,12 @@ test_filesys_LDADD = \
$(INTLLIBS)
-
-TESTS += test-camera-list
-INSTALL_TESTS += test-camera-list
-check_PROGRAMS += test-camera-list
-test_camera_list_SOURCE = test-camera-list.c
-test_camera_list_LDADD = \
+# Print a list of all cameras supported by this build of libgphoto2
+TESTS += test-camera-list
+INSTALL_TESTS += test-camera-list
+check_PROGRAMS += test-camera-list
+test_camera_list_SOURCES = test-camera-list.c
+test_camera_list_LDADD = \
$(top_builddir)/libgphoto2/libgphoto2.la \
$(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la \
$(LIBLTDL) \
@@ -77,12 +93,16 @@ test_camera_list_LDADD = \
$(INTLLIBS)
+########################################################################
+# Old pedantic compilation test
+########################################################################
+
if HAVE_GCC
-PEDANTIC_CFLAGS = -std=c99 -pedantic-errors -W -Wall -Wextra -Werror
+PEDANTIC_CFLAGS = -std=c99 -pedantic-errors -W -Wall -Wextra -Werror
PEDANTIC_CXXFLAGS = -std=c++98 -pedantic-errors -W -Wall -Wextra -Werror
else
-PEDANTIC_CFLAGS =
-PEDANTIC_CXXFLAGS =
+PEDANTIC_CFLAGS =
+PEDANTIC_CXXFLAGS =
endif
TESTS += test-pedantic-c
@@ -122,4 +142,9 @@ test_pedantic_cxx_LDADD = \
$(LIBEXIF_LIBS) \
$(INTLLIBS)
+
+########################################################################
+# Implement the checks for the installed library
+########################################################################
+
include $(top_srcdir)/installcheck.mk