bb3e938d9c43d372d204bf1ce86c01e424191f34
[debian/amanda] / installcheck / Makefile.am
1 # Note that this architecture assumes a full install -- not just server
2 # or just client.  Neither is sufficiently test-able on its own.
3
4 include $(top_srcdir)/config/automake/vars.am
5 include $(top_srcdir)/config/automake/scripts.am
6
7 # Add your tests here.
8
9 common_tests = \
10         Amanda_Config \
11         Amanda_Types
12
13 server_tests = \
14         Amanda_Changer \
15         Amanda_Cmdline \
16         Amanda_Logfile \
17         amcheckdump \
18         amdevcheck \
19         amgetconf
20
21 tests = $(common_tests)
22 if WANT_SERVER
23 tests += $(server_tests)
24 endif
25
26 # Add any common files (that should not be run as tests) here:
27 test_utils = Amconfig.pm
28
29 SCRIPTS_PERL = $(common_tests) $(server_tests) $(test_utils)
30
31 # we don't need to syntax check the test scripts..
32 CHECK_PERL =
33
34 .PHONY: clobber_my_config_is_ok
35 clobber_my_config_is_ok:
36         @if test "$(CLOBBER_MY_CONFIG)" != "OK"; then \
37                 echo ""; \
38                 echo "'make installcheck' is a dangerous tool.  It will overwrite your"; \
39                 echo "amanda-client.conf and amandates, and (if it"; \
40                 echo "triggers an as-yet undetected bug) may do other unexpected things.  You are"; \
41                 echo "strongly encouraged"; \
42                 echo "  - not to run installchecks on a production install"; \
43                 echo "  - not to run installchecks as root"; \
44                 echo "See http://wiki.zmanda.com/index.php/Testing for instructions on setting up a"; \
45                 echo "test environment in which"; \
46                 echo "potential damage is limited by your filesystem's permissions.  To actually run"; \
47                 echo "the installchecks, invoke make"; \
48                 echo "as follows:"; \
49                 echo "  $(MAKE) CLOBBER_MY_CONFIG=OK installcheck"; \
50                 exit 1; \
51         fi
52
53 installcheck-local: clobber_my_config_is_ok $(SCRIPTS_PERL)
54         $(mkdir_p) $(AMANDA_TMPDIR)
55         $(PERL) -I$(srcdir) -I$(builddir) -e 'use Test::Harness qw(&runtests); runtests(@ARGV);' $(tests)
56         rm -rf "$(CONFIG_DIR)/TESTCONF"
57         rm -rf "$(CONFIG_DIR)/amanda-client.conf"
58         rm -rf "$(DEFAULT_AMANDATES_FILE)"
59         rm -rf "$(GNUTAR_LISTED_INCREMENTAL_DIR)"