Imported Upstream version 1.8.0
[platform/upstream/augeas.git] / tests / Makefile.am
1 GNULIB= ../gnulib/lib/libgnu.la
2 GNULIB_CFLAGS= -I $(top_srcdir)/gnulib/lib
3
4 AM_CFLAGS = $(AUGEAS_CFLAGS) $(WARN_CFLAGS) $(GNULIB_CFLAGS) \
5          $(LIBXML_CFLAGS) -I $(top_builddir)/src
6
7 VALGRIND=libtool --mode=execute valgrind --quiet --leak-check=full
8 valgrind:
9         make check \
10           VALGRIND="$(VALGRIND)" \
11           AUGPARSE=$(abs_top_builddir)/src/augparse \
12           AUGTOOL=$(abs_top_builddir)/src/augtool
13         $(VALGRIND) ./fatest
14
15 valgrind-leak: leak
16         $(TESTS_ENVIRONMENT) $(VALGRIND) ./leak
17
18 lens_tests =                    \
19   lens-sudoers.sh               \
20   lens-access.sh                \
21   lens-activemq_conf.sh         \
22   lens-activemq_xml.sh          \
23   lens-afs_cellalias.sh                 \
24   lens-aliases.sh               \
25   lens-anacron.sh               \
26   lens-approx.sh                \
27   lens-apt_update_manager.sh            \
28   lens-aptcacherngsecurity.sh           \
29   lens-aptpreferences.sh        \
30   lens-aptconf.sh       \
31   lens-aptsources.sh            \
32   lens-authorized_keys.sh       \
33   lens-automaster.sh    \
34   lens-automounter.sh   \
35   lens-avahi.sh \
36   lens-backuppchosts.sh         \
37   lens-bbhosts.sh               \
38   lens-bootconf.sh              \
39   lens-build.sh         \
40   lens-cachefilesd.sh           \
41   lens-carbon.sh        \
42   lens-cgconfig.sh              \
43   lens-cgrules.sh               \
44   lens-channels.sh              \
45   lens-chrony.sh                \
46   lens-clamav.sh        \
47   lens-cobblersettings.sh       \
48   lens-cobblermodules.sh        \
49   lens-collectd.sh      \
50   lens-cpanel.sh        \
51   lens-cron.sh                  \
52   lens-cron_user.sh                     \
53   lens-crypttab.sh              \
54   lens-csv.sh           \
55   lens-cyrus_imapd.sh           \
56   lens-cups.sh          \
57   lens-darkice.sh               \
58   lens-debctrl.sh               \
59   lens-desktop.sh       \
60   lens-device_map.sh    \
61   lens-dhclient.sh              \
62   lens-dhcpd.sh         \
63   lens-dns_zone.sh              \
64   lens-dnsmasq.sh               \
65   lens-dovecot.sh               \
66   lens-dpkg.sh                  \
67   lens-dput.sh                  \
68   lens-erlang.sh                \
69   lens-ethers.sh                \
70   lens-exports.sh               \
71   lens-fai_diskconfig.sh        \
72   lens-fonts.sh \
73   lens-fstab.sh                 \
74   lens-fuse.sh                  \
75   lens-gdm.sh                   \
76   lens-group.sh                 \
77   lens-gshadow.sh                       \
78   lens-gtkbookmarks.sh                  \
79   lens-json.sh          \
80   lens-hostname.sh                      \
81   lens-hosts.sh                 \
82   lens-hosts_access.sh                  \
83   lens-host_conf.sh                     \
84   lens-htpasswd.sh         \
85   lens-httpd.sh         \
86   lens-inetd.sh         \
87   lens-inifile.sh               \
88   lens-inittab.sh               \
89   lens-inputrc.sh               \
90   lens-interfaces.sh            \
91   lens-iptables.sh              \
92   lens-iproute2.sh              \
93   lens-iscsid.sh                \
94   lens-jettyrealm.sh            \
95   lens-jmxaccess.sh             \
96   lens-jmxpassword.sh           \
97   lens-kdump.sh                 \
98   lens-keepalived.sh    \
99   lens-known_hosts.sh   \
100   lens-koji.sh                  \
101   lens-krb5.sh                  \
102   lens-jaas.sh          \
103   lens-ldap.sh                  \
104   lens-ldif.sh                  \
105   lens-ldso.sh                  \
106   lens-lightdm.sh               \
107   lens-limits.sh                \
108   lens-login_defs.sh    \
109   lens-logrotate.sh             \
110   lens-logwatch.sh              \
111   lens-lokkit.sh                \
112   lens-lvm.sh                   \
113   lens-mailscanner.sh   \
114   lens-mailscanner_rules.sh     \
115   lens-masterpasswd.sh  \
116   lens-mcollective.sh   \
117   lens-mdadm_conf.sh    \
118   lens-memcached.sh             \
119   lens-mke2fs.sh                \
120   lens-modprobe.sh              \
121   lens-modules.sh               \
122   lens-modules_conf.sh  \
123   lens-mongodbserver.sh         \
124   lens-monit.sh                 \
125   lens-multipath.sh     \
126   lens-mysql.sh                 \
127   lens-nagioscfg.sh     \
128   lens-nagiosobjects.sh     \
129   lens-netmasks.sh     \
130   lens-networkmanager.sh     \
131   lens-networks.sh     \
132   lens-nginx.sh     \
133   lens-ntp.sh                   \
134   lens-ntpd.sh                  \
135   lens-nrpe.sh          \
136   lens-nsswitch.sh              \
137   lens-odbc.sh          \
138   lens-opendkim.sh          \
139   lens-openshift_config.sh      \
140   lens-openshift_http.sh        \
141   lens-openshift_quickstarts.sh \
142   lens-openvpn.sh               \
143   lens-pagekite.sh              \
144   lens-pam.sh                   \
145   lens-pamconf.sh               \
146   lens-passwd.sh                \
147   lens-pbuilder.sh              \
148   lens-pg_hba.sh                \
149   lens-pgbouncer.sh     \
150   lens-php.sh                   \
151   lens-phpvars.sh               \
152   lens-postfix_access.sh \
153   lens-postfix_main.sh          \
154   lens-postfix_master.sh        \
155   lens-postfix_passwordmap.sh \
156   lens-postfix_sasl_smtpd.sh \
157   lens-postfix_transport.sh     \
158   lens-postfix_virtual.sh       \
159   lens-postgresql.sh \
160   lens-properties.sh    \
161   lens-protocols.sh    \
162   lens-puppet.sh                \
163   lens-puppet_auth.sh           \
164   lens-puppetfile.sh            \
165   lens-puppetfileserver.sh              \
166   lens-pylonspaste.sh   \
167   lens-pythonpaste.sh   \
168   lens-qpid.sh          \
169   lens-quote.sh         \
170   lens-rabbitmq.sh              \
171   lens-radicale.sh              \
172   lens-redis.sh         \
173   lens-reprepro_uploaders.sh            \
174   lens-resolv.sh                \
175   lens-rhsm.sh                  \
176   lens-rmt.sh                   \
177   lens-rsyncd.sh                \
178   lens-rsyslog.sh               \
179   lens-rx.sh                    \
180   lens-samba.sh                 \
181   lens-securetty.sh     \
182   lens-services.sh              \
183   lens-shadow.sh                \
184   lens-shells.sh                \
185   lens-shellvars.sh             \
186   lens-shellvars_list.sh        \
187   lens-simplelines.sh   \
188   lens-simplevars.sh    \
189   lens-sip_conf.sh          \
190   lens-slapd.sh                 \
191   lens-smbusers.sh                      \
192   lens-solaris_system.sh                \
193   lens-soma.sh                  \
194   lens-spacevars.sh             \
195   lens-splunk.sh                \
196   lens-squid.sh                 \
197   lens-ssh.sh                   \
198   lens-sshd.sh                  \
199   lens-sssd.sh                  \
200   lens-star.sh          \
201   lens-stunnel.sh                       \
202   lens-subversion.sh            \
203   lens-sysconfig.sh             \
204   lens-sysconfig_route.sh               \
205   lens-syslog.sh                \
206   lens-sysctl.sh                \
207   lens-systemd.sh               \
208   lens-thttpd.sh                \
209   lens-tmpfiles.sh              \
210   lens-trapperkeeper.sh         \
211   lens-tuned.sh                 \
212   lens-up2date.sh               \
213   lens-updatedb.sh              \
214   lens-util.sh          \
215   lens-vfstab.sh                \
216   lens-vmware_config.sh         \
217   lens-vsftpd.sh                \
218   lens-webmin.sh                \
219   lens-wine.sh                  \
220   lens-xinetd.sh                \
221   lens-xml.sh                   \
222   lens-xorg.sh                  \
223   lens-xymon.sh                 \
224   lens-xymon_alerting.sh \
225   lens-grub.sh                  \
226   lens-schroot.sh                       \
227   lens-xendconfsxp.sh   \
228   lens-yaml.sh  \
229   lens-yum.sh
230
231 ME = tests/Makefile.am
232
233 # Ensure that the above list stays up to date:
234 # Construct two lists: list of lens-*.sh from lens_tests = ... above,
235 # and the list of ../lenses/tests/test_*.aug names.
236 # If they're not the same, print the new or removed names and fail.
237 check: check-lens-tests
238 .PHONY: check-lens-tests
239 _v = lens_tests
240 check-lens-tests:
241         @u=$$({ sed -n '/^$(_v) =[       ]*\\$$/,/[^\]$$/p'             \
242                 $(srcdir)/Makefile.am                                   \
243             | sed 's/^  *//;/^\$$.*/d;/^$(_v) =/d'                      \
244             | sed 's,\.sh.*\\,.sh,';                                    \
245           ls -1 $(srcdir)/../lenses/tests/test_*.aug                    \
246             | sed 's,.*/test_\([^./]*\)\.aug$$,lens-\1.sh,';            \
247         } | LC_ALL=C sort | uniq -u);                                   \
248         test "x$$u" = x && :                                            \
249           || { printf '%s\n' "$$u" >&2;                                 \
250                echo '$(ME): new test(s)?  update lens_tests' >&2; exit 1; }
251
252 DISTCLEANFILES = $(lens_tests)
253 $(lens_tests): lens-test-1
254         $(LN_S) $< $@
255
256 check_SCRIPTS = \
257   test-interpreter.sh \
258   $(lens_tests) \
259   test-get.sh test-augtool.sh \
260   test-put-symlink.sh test-put-symlink-augnew.sh \
261   test-put-symlink-augsave.sh test-put-symlink-augtemp.sh \
262   test-put-mount.sh test-put-mount-augnew.sh test-put-mount-augsave.sh \
263   test-save-empty.sh test-bug-1.sh test-idempotent.sh test-preserve.sh \
264   test-events-saved.sh test-save-mode.sh test-unlink-error.sh \
265   test-augtool-empty-line.sh test-augtool-modify-root.sh \
266   test-span-rec-lens.sh
267
268 EXTRA_DIST = \
269   test-augtool root lens-test-1 \
270   $(check_SCRIPTS) $(wildcard modules/*.aug) xpath.tests run.tests
271
272 noinst_SCRIPTS = $(check_SCRIPTS)
273
274 noinst_PROGRAMS = leak
275
276 check_PROGRAMS = fatest test-xpath test-load test-perf test-save test-api test-run
277
278 TESTS_ENVIRONMENT = \
279   PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" \
280   abs_top_builddir='$(abs_top_builddir)' \
281   abs_top_srcdir='$(abs_top_srcdir)' \
282   LANG=en_US
283
284 TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
285
286 INCLUDES = -I$(top_srcdir)/src
287
288 fatest_SOURCES = fatest.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
289 fatest_LDADD = $(top_builddir)/src/libfa.la $(LIBXML_LIBS) $(GNULIB)
290
291 test_xpath_SOURCES = test-xpath.c cutest.c cutest.h $(top_srcdir)/src/memory.c
292 test_xpath_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
293
294 test_load_SOURCES = test-load.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
295 test_load_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
296
297 test_save_SOURCES = test-save.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
298 test_save_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
299
300 test_api_SOURCES = test-api.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
301 test_api_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
302
303 test_run_SOURCES = test-run.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
304 test_run_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
305
306 test_perf_SOURCES = test-perf.c cutest.c cutest.h $(top_srcdir)/src/memory.c $(top_srcdir)/src/memory.h
307 test_perf_LDADD = $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
308
309 leak_SOURCES = leak.c
310 leak_LDADD =  $(top_builddir)/src/libaugeas.la $(LIBXML_LIBS) $(GNULIB)
311
312 FAILMALLOC_START ?= 1
313 FAILMALLOC_REP   ?= 20
314 FAILMALLOC_PROG ?= ./fatest
315
316 include $(top_srcdir)/Makefile.inc