summaryrefslogtreecommitdiff
path: root/tests/Makefile.am
blob: d87bc3d61ebbaff86e524c27066738f6a4dc3312 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
########################################################################
# Housekeeping
########################################################################

EXTRA_PROGRAMS =
check_PROGRAMS =
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 \
	CAMLIBS="$(top_builddir)/camlibs"

# After installation, this will be CAMLIBS = $(DESTDIR)$(camlibdir)
INSTALL_TESTS_ENVIRONMENT = env \
	CAMLIBS="$(DESTDIR)$(camlibdir)" \
	LD_LIBRARY_PATH="$(DESTDIR)$(libdir)$${LD_LIBRARY_PATH+:$${LD_LIBRARY_PATH}}"


########################################################################
# Define test programs
########################################################################


# Default CPPFLAGS to use
AM_CPPFLAGS += -I$(top_srcdir) -I$(top_builddir)  -I$(top_srcdir)/libgphoto2_port


# Test i18n
check_PROGRAMS     += test-i18n
test_i18n_SOURCES   = test-i18n.c
test_i18n_CPPFLAGS  = $(AM_CPPFLAGS)
test_i18n_CFLAGS    = $(AM_CFLAGS)
test_i18n_LDADD     = $(INTLLIBS)


# 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) \
	$(LIBEXIF_LIBS) \
	$(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)


# 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)


# 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) \
	$(LIBEXIF_LIBS) \
	$(INTLLIBS)


# 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) \
	$(LIBEXIF_LIBS) \
	$(INTLLIBS)


TESTS          += test-init-localedir
check_PROGRAMS += test-init-localedir
test_init_localedir_LDADD =
test_init_localedir_LDADD += $(top_builddir)/libgphoto2/libgphoto2.la
test_init_localedir_LDADD += $(top_builddir)/libgphoto2_port/libgphoto2_port/libgphoto2_port.la
test_init_localedir_LDADD += $(LIBLTDL)
test_init_localedir_LDADD += $(LIBEXIF_LIBS)
test_init_localedir_LDADD += $(INTLLIBS)


########################################################################
# Test pedantic compilation for multiple language standard
########################################################################

generic_pedantic_cppflags   =
generic_pedantic_cppflags  += -I$(top_srcdir)/libgphoto2_port
generic_pedantic_cppflags  += -I$(top_srcdir)

generic_pedantic_cflags     =

generic_pedantic_cxxflags   =

if GP_HAVE_PEDANTIC_FLAGS_C90
TESTS                      += test-pedantic-c90
check_PROGRAMS             += test-pedantic-c90
endif
EXTRA_PROGRAMS             += test-pedantic-c90
test_pedantic_c90_SOURCES   = test-pedantic-compilation.c
test_pedantic_c90_CPPFLAGS  = $(generic_pedantic_cppflags)
test_pedantic_c90_CFLAGS    = $(GP_PEDANTIC_CFLAGS_C90)
test_pedantic_c90_CFLAGS   += $(generic_pedantic_cflags)
test_pedantic_c90_LDADD     =
test_pedantic_c90_LDFLAGS   =

if GP_HAVE_PEDANTIC_FLAGS_C99
TESTS                      += test-pedantic-c99
check_PROGRAMS             += test-pedantic-c99
endif
EXTRA_PROGRAMS             += test-pedantic-c99
test_pedantic_c99_SOURCES   = test-pedantic-compilation.c
test_pedantic_c99_CPPFLAGS  = $(generic_pedantic_cppflags)
test_pedantic_c99_CFLAGS    = $(GP_PEDANTIC_CFLAGS_C99)
test_pedantic_c99_CFLAGS   += $(generic_pedantic_cflags)
test_pedantic_c99_LDADD     =
test_pedantic_c99_LDFLAGS   =

if GP_HAVE_PEDANTIC_FLAGS_C11
TESTS                      += test-pedantic-c11
check_PROGRAMS             += test-pedantic-c11
endif
EXTRA_PROGRAMS             += test-pedantic-c11
test_pedantic_c11_SOURCES   = test-pedantic-compilation.c
test_pedantic_c11_CPPFLAGS  = $(generic_pedantic_cppflags)
test_pedantic_c11_CFLAGS    = $(GP_PEDANTIC_CFLAGS_C11)
test_pedantic_c11_CFLAGS   += $(generic_pedantic_cflags)
test_pedantic_c11_LDADD     =
test_pedantic_c11_LDFLAGS   =

if GP_HAVE_PEDANTIC_FLAGS_C2X
TESTS                      += test-pedantic-c2x
check_PROGRAMS             += test-pedantic-c2x
endif
EXTRA_PROGRAMS             += test-pedantic-c2x
test_pedantic_c2x_SOURCES   = test-pedantic-compilation.c
test_pedantic_c2x_CPPFLAGS  = $(generic_pedantic_cppflags)
test_pedantic_c2x_CFLAGS    = $(GP_PEDANTIC_CFLAGS_C2X)
test_pedantic_c2x_CFLAGS   += $(generic_pedantic_cflags)
test_pedantic_c2x_LDADD     =
test_pedantic_c2x_LDFLAGS   =

if HAVE_CXX
if GP_HAVE_PEDANTIC_FLAGS_CXX98
TESTS                        += test-pedantic-cxx98
check_PROGRAMS               += test-pedantic-cxx98
endif
endif
EXTRA_PROGRAMS               += test-pedantic-cxx98
test_pedantic_cxx98_SOURCES   = test-pedantic-compilation.cxx
test_pedantic_cxx98_CPPFLAGS  = $(generic_pedantic_cppflags)
test_pedantic_cxx98_CXXFLAGS  = $(GP_PEDANTIC_CXXFLAGS_CXX98)
test_pedantic_cxx98_CXXFLAGS += $(generic_pedantic_cxxflags)
test_pedantic_cxx98_LDADD     =
test_pedantic_cxx98_LDFLAGS   =

if HAVE_CXX
if GP_HAVE_PEDANTIC_FLAGS_CXX11
TESTS                        += test-pedantic-cxx11
check_PROGRAMS               += test-pedantic-cxx11
endif
endif
EXTRA_PROGRAMS               += test-pedantic-cxx11
test_pedantic_cxx11_SOURCES   = test-pedantic-compilation.cxx
test_pedantic_cxx11_CPPFLAGS  = $(generic_pedantic_cppflags)
test_pedantic_cxx11_CXXFLAGS  = $(GP_PEDANTIC_CXXFLAGS_CXX11)
test_pedantic_cxx11_CXXFLAGS += $(generic_pedantic_cxxflags)
test_pedantic_cxx11_LDADD     =
test_pedantic_cxx11_LDFLAGS   =

if HAVE_CXX
if GP_HAVE_PEDANTIC_FLAGS_CXX14
TESTS                        += test-pedantic-cxx14
check_PROGRAMS               += test-pedantic-cxx14
endif
endif
EXTRA_PROGRAMS               += test-pedantic-cxx14
test_pedantic_cxx14_SOURCES   = test-pedantic-compilation.cxx
test_pedantic_cxx14_CPPFLAGS  = $(generic_pedantic_cppflags)
test_pedantic_cxx14_CXXFLAGS  = $(GP_PEDANTIC_CXXFLAGS_CXX14)
test_pedantic_cxx14_CXXFLAGS += $(generic_pedantic_cxxflags)
test_pedantic_cxx14_LDADD     =
test_pedantic_cxx14_LDFLAGS   =

if HAVE_CXX
if GP_HAVE_PEDANTIC_FLAGS_CXX17
TESTS                        += test-pedantic-cxx17
check_PROGRAMS               += test-pedantic-cxx17
endif
endif
EXTRA_PROGRAMS               += test-pedantic-cxx17
test_pedantic_cxx17_SOURCES   = test-pedantic-compilation.cxx
test_pedantic_cxx17_CPPFLAGS  = $(generic_pedantic_cppflags)
test_pedantic_cxx17_CXXFLAGS  = $(GP_PEDANTIC_CXXFLAGS_CXX17)
test_pedantic_cxx17_CXXFLAGS += $(generic_pedantic_cxxflags)
test_pedantic_cxx17_LDADD     =
test_pedantic_cxx17_LDFLAGS   =

if HAVE_CXX
if GP_HAVE_PEDANTIC_FLAGS_CXX20
TESTS                        += test-pedantic-cxx20
check_PROGRAMS               += test-pedantic-cxx20
endif
endif
EXTRA_PROGRAMS               += test-pedantic-cxx20
test_pedantic_cxx20_SOURCES   = test-pedantic-compilation.cxx
test_pedantic_cxx20_CPPFLAGS  = $(generic_pedantic_cppflags)
test_pedantic_cxx20_CXXFLAGS  = $(GP_PEDANTIC_CXXFLAGS_CXX20)
test_pedantic_cxx20_CXXFLAGS += $(generic_pedantic_cxxflags)
test_pedantic_cxx20_LDADD     =
test_pedantic_cxx20_LDFLAGS   =


########################################################################
# Implement the checks for the installed library
########################################################################

include $(top_srcdir)/installcheck.mk