Makefile.am revision 285612
1NULL =
2BUILT_SOURCES =
3CLEANFILES = kod-output-blank kod-output-single kod-output-multiple debug-output-lfp-dec debug-output-lfp-bin debug-output-pkt
4DISTCLEANFILES = kod-output-blank kod-output-single kod-output-multiple
5EXTRA_PROGRAMS =
6
7run_unity =	cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
8
9# Use EXTRA_PROGRAMS for test files that are under development but
10# not production-ready
11#EXTRA_PROGRAMS +=		test-packetHandling test-packetProcessing
12
13check_PROGRAMS =			\
14	test-crypto			\
15	test-keyFile			\
16	test-kodDatabase		\
17	test-kodFile			\
18	test-networking			\
19	test-packetHandling		\
20	test-packetProcessing		\
21	test-utilities			\
22	$(NULL)
23
24if GTEST_AVAILABLE
25check_PROGRAMS += tests
26else
27EXTRA_PROGRAMS += tests
28endif
29
30#if BUILD_SNTP
31#check_PROGRAMS += tests
32#endif
33
34base_SOURCES =			\
35	../tests_main.cpp	\
36	$(NULL)
37
38tests_SOURCES =			\
39	$(base_SOURCES)		\
40	g_networking.cpp	\
41	g_packetHandling.cpp	\
42	g_packetProcessing.cpp	\
43	$(NULL)
44
45# HMS: this test was for the 4.2.6 sntp code.
46#	g_nameresolution.cpp	
47
48# HMS: Somebody needs to audit the following files to
49# make sure all of these tests are now handled by Unity
50#
51#	g_utilities.cpp		
52#	g_kodDatabase.cpp	
53#	g_keyFile.cpp		
54#	g_crypto.cpp		
55#	g_kodFile.cpp		
56
57noinst_HEADERS =		\
58	fileHandlingTest.h	\
59	sntptest.h		\
60	g_fileHandlingTest.h	\
61	g_sntptest.h		\
62	$(NULL)
63
64dist_check_SCRIPTS =	tests-runner
65
66EXTRA_DIST =				\
67	data/debug-input-lfp-bin	\
68	data/debug-input-lfp-dec	\
69	data/debug-input-pkt		\
70	data/key-test-ascii		\
71	data/key-test-comments		\
72	data/key-test-empty		\
73	data/key-test-hex		\
74	data/key-test-invalid-hex	\
75	data/kod-expected-multiple	\
76	data/kod-expected-single	\
77	data/kod-test-blanks		\
78	data/kod-test-correct		\
79	data/kod-test-empty		\
80	$(NULL)
81
82CLEANFILES +=				\
83	data/kod-output-multiple	\
84	data/kod-output-single		\
85	data/debug-output-pkt		\
86	data/debug-output-lfp-dec	\
87	data/kod-output-blank		\
88	data/debug-output-lfp-bin	\
89	$(NULL)
90
91#split into LDADD and tests_LDADD?
92LDADD =						\
93	../libsntp.a				\
94	$(LIBOPTS_LDADD)			\
95	$(LDADD_LIBEVENT)			\
96	$(top_builddir)/../libntp/libntp.a	\
97	$(LDADD_LIBNTP)				\
98	$(LDADD_NTP)				\
99	$(GTEST_LDFLAGS)			\
100	$(GTEST_LIBS)				\
101	$(NULL)
102
103unity_tests_LDADD =				\
104	$(LDADD)				\
105	$(top_builddir)/unity/libunity.a	\
106	$(LIBM)					\
107	$(NULL)
108
109AM_CFLAGS   = $(CFLAGS_NTP)
110AM_CXXFLAGS = $(GTEST_CXXFLAGS)
111
112AM_CPPFLAGS  = $(SNTP_INCS)
113AM_CPPFLAGS += -I$(srcdir)/..
114AM_CPPFLAGS += -I$(top_srcdir)/../tests
115AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
116AM_CPPFLAGS += $(CPPFLAGS_LIBEVENT)
117AM_CPPFLAGS += $(GTEST_CPPFLAGS)
118AM_CPPFLAGS += $(CPPFLAGS_NTP)
119
120AM_LDFLAGS = $(LDFLAGS_NTP)
121
122BUILT_SOURCES +=				\
123	$(srcdir)/run-crypto.c			\
124	$(srcdir)/run-keyFile.c			\
125	$(srcdir)/run-kodDatabase.c		\
126	$(srcdir)/run-kodFile.c			\
127	$(srcdir)/run-networking.c		\
128	$(srcdir)/run-packetProcessing.c	\
129	$(srcdir)/run-utilities.c		\
130	$(srcdir)/run-packetHandling.c		\
131	$(NULL)
132
133test_keyFile_CFLAGS =			\
134	-I$(top_srcdir)/unity		\
135	$(NULL)
136
137test_keyFile_LDADD =			\
138	$(unity_tests_LDADD)		\
139	$(NULL)
140
141test_kodDatabase_CFLAGS =		\
142	-I$(top_srcdir)/unity		\
143	$(NULL)
144
145test_kodDatabase_LDADD =		\
146	$(unity_tests_LDADD)		\
147	$(NULL)
148
149test_kodFile_CFLAGS =			\
150	-I$(top_srcdir)/unity		\
151	$(NULL)
152
153test_kodFile_LDADD =			\
154	$(unity_tests_LDADD)		\
155	$(NULL)
156
157test_networking_CFLAGS =		\
158	-I$(top_srcdir)/unity		\
159	$(NULL)
160
161test_networking_LDADD =			\
162	$(unity_tests_LDADD)		\
163	$(NULL)
164
165test_utilities_CFLAGS =			\
166	-I$(top_srcdir)/unity		\
167	$(NULL)
168
169test_utilities_LDADD =			\
170	$(unity_tests_LDADD)		\
171	$(NULL)
172
173test_crypto_CFLAGS =			\
174	-I$(top_srcdir)/unity		\
175	$(NULL)
176
177test_crypto_LDADD =			\
178	$(unity_tests_LDADD)		\
179	$(NULL)
180
181test_packetProcessing_CFLAGS =		\
182	-I$(top_srcdir)/unity		\
183	$(NULL)
184
185test_packetProcessing_LDADD =		\
186	$(unity_tests_LDADD)		\
187	$(NULL)
188
189test_packetHandling_CFLAGS =		\
190	-I$(top_srcdir)/unity		\
191	$(NULL)
192
193test_packetHandling_LDADD =		\
194	$(unity_tests_LDADD)		\
195	$(NULL)
196
197test_networking_SOURCES =		\
198	networking.c			\
199	run-networking.c		\
200	$(top_builddir)/version.c	\
201	$(NULL)
202
203test_packetHandling_SOURCES =		\
204	packetHandling.c		\
205	run-packetHandling.c		\
206	$(top_builddir)/version.c	\
207	$(NULL)
208
209test_kodDatabase_SOURCES =		\
210	kodDatabase.c			\
211	run-kodDatabase.c		\
212	$(top_builddir)/version.c	\
213	$(NULL)
214
215test_keyFile_SOURCES =			\
216	keyFile.c			\
217	run-keyFile.c			\
218	$(top_builddir)/version.c	\
219	$(NULL)
220
221test_kodFile_SOURCES =			\
222	kodFile.c			\
223	run-kodFile.c			\
224	$(top_builddir)/version.c	\
225	$(NULL)
226#	../version.c
227
228test_packetProcessing_SOURCES =		\
229	packetProcessing.c		\
230	run-packetProcessing.c		\
231	$(NULL)
232
233test_utilities_SOURCES =		\
234	utilities.c			\
235	run-utilities.c			\
236	$(NULL)
237
238test_crypto_SOURCES =			\
239	crypto.c			\
240	run-crypto.c			\
241	$(top_builddir)/version.c	\
242	$(NULL)
243
244
245$(srcdir)/run-kodFile.c: $(srcdir)/kodFile.c $(std_unity_list)
246	$(run_unity) kodFile.c run-kodFile.c
247
248$(srcdir)/run-keyFile.c: $(srcdir)/keyFile.c $(std_unity_list)
249	$(run_unity) keyFile.c run-keyFile.c
250
251$(srcdir)/run-kodDatabase.c: $(srcdir)/kodDatabase.c $(std_unity_list)
252	$(run_unity) kodDatabase.c run-kodDatabase.c
253
254$(srcdir)/run-networking.c: $(srcdir)/networking.c $(std_unity_list)
255	$(run_unity) networking.c run-networking.c
256
257$(srcdir)/run-packetProcessing.c: $(srcdir)/packetProcessing.c $(std_unity_list)
258	$(run_unity) packetProcessing.c run-packetProcessing.c
259
260$(srcdir)/run-packetHandling.c: $(srcdir)/packetHandling.c $(std_unity_list)
261	$(run_unity) packetHandling.c run-packetHandling.c
262
263$(srcdir)/run-utilities.c: $(srcdir)/utilities.c $(std_unity_list)
264	$(run_unity) utilities.c run-utilities.c
265
266$(srcdir)/run-crypto.c: $(srcdir)/crypto.c $(std_unity_list)
267	$(run_unity) crypto.c run-crypto.c
268
269#$(srcdir)/../version.c: $(srcdir)/../version.c
270#	gcc -o version.o ../version.c
271
272TESTS = 
273
274if !NTP_CROSSCOMPILE
275TESTS += $(check_PROGRAMS)
276endif
277#if !NTP_CROSSCOMPILE
278#TESTS += tests-runner
279#endif
280
281## ensure ../libsntp.a is built
282
283BUILT_SOURCES	+= check-libsntp
284CLEANFILES	+= check-libsntp
285
286check-libsntp: ../libsntp.a
287	@echo stamp > $@
288
289../libsntp.a:
290	cd .. && $(MAKE) $(AM_MAKEFLAGS) libsntp.a
291
292## check-libntp.mf - automake fragment
293## slightly adapted for deeper directory
294
295BUILT_SOURCES	+= check-libntp check-libunity
296CLEANFILES	+= check-libntp	check-libunity
297
298check-libntp: ../../libntp/libntp.a
299	@echo stamp > $@
300
301../../libntp/libntp.a:
302	cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
303
304check-libunity: ../sntp/unity/libunity.a
305	@echo stamp > $@
306
307../sntp/unity/libunity.a:
308	cd ../unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a
309
310include $(top_srcdir)/depsver.mf
311include $(top_srcdir)/includes.mf
312