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