diff options
author | Jiri Olsa <jolsa@redhat.com> | 2013-12-19 08:41:59 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-19 14:18:08 -0500 |
commit | ee4ad93e82b8fd260ae618f6b0413cd321bc09cb (patch) | |
tree | d1de3ac651a44a2a8a366717ccf4038690a80b6d | |
parent | b40067964f09a5b4d9e133dec225007ee0a13050 (diff) |
perf tests: Factor make install tests
Factoring make install tests to check for multiple files. Adding default
set of installed files for install and install_bin tests.
Putting the 'test' line into the log file instead to the screen as it
gets more complex now.
If the tests fails to find a file, following message is displayed:
$ make -f tests/make make_install_bin
- make_install_bin: cd . && make -f Makefile DESTDIR=/tmp/tmp.nCVuQoSHaJ install-bin
failed to find: bin/perf
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1387460527-15030-2-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/tests/make | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/tools/perf/tests/make b/tools/perf/tests/make index 2ca0abf1b2b6..f641c35f2321 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make | |||
@@ -106,10 +106,36 @@ test_make_python_perf_so := test -f $(PERF)/python/perf.so | |||
106 | test_make_perf_o := test -f $(PERF)/perf.o | 106 | test_make_perf_o := test -f $(PERF)/perf.o |
107 | test_make_util_map_o := test -f $(PERF)/util/map.o | 107 | test_make_util_map_o := test -f $(PERF)/util/map.o |
108 | 108 | ||
109 | test_make_install := test -x $$TMP_DEST/bin/perf | 109 | define test_dest_files |
110 | test_make_install_O := $(test_make_install) | 110 | for file in $(1); do \ |
111 | test_make_install_bin := $(test_make_install) | 111 | if [ ! -x $$TMP_DEST/$$file ]; then \ |
112 | test_make_install_bin_O := $(test_make_install) | 112 | echo " failed to find: $$file"; \ |
113 | fi \ | ||
114 | done | ||
115 | endef | ||
116 | |||
117 | installed_files_bin := bin/perf | ||
118 | installed_files_bin += etc/bash_completion.d/perf | ||
119 | installed_files_bin += libexec/perf-core/perf-archive | ||
120 | |||
121 | installed_files_plugins := lib64/traceevent/plugins/plugin_cfg80211.so | ||
122 | installed_files_plugins += lib64/traceevent/plugins/plugin_scsi.so | ||
123 | installed_files_plugins += lib64/traceevent/plugins/plugin_xen.so | ||
124 | installed_files_plugins += lib64/traceevent/plugins/plugin_function.so | ||
125 | installed_files_plugins += lib64/traceevent/plugins/plugin_sched_switch.so | ||
126 | installed_files_plugins += lib64/traceevent/plugins/plugin_mac80211.so | ||
127 | installed_files_plugins += lib64/traceevent/plugins/plugin_kvm.so | ||
128 | installed_files_plugins += lib64/traceevent/plugins/plugin_kmem.so | ||
129 | installed_files_plugins += lib64/traceevent/plugins/plugin_hrtimer.so | ||
130 | installed_files_plugins += lib64/traceevent/plugins/plugin_jbd2.so | ||
131 | |||
132 | installed_files_all := $(installed_files_bin) | ||
133 | installed_files_all += $(installed_files_plugins) | ||
134 | |||
135 | test_make_install := $(call test_dest_files,$(installed_files_all)) | ||
136 | test_make_install_O := $(call test_dest_files,$(installed_files_all)) | ||
137 | test_make_install_bin := $(call test_dest_files,$(installed_files_bin)) | ||
138 | test_make_install_bin_O := $(call test_dest_files,$(installed_files_bin)) | ||
113 | 139 | ||
114 | # FIXME nothing gets installed | 140 | # FIXME nothing gets installed |
115 | test_make_install_man := test -f $$TMP_DEST/share/man/man1/perf.1 | 141 | test_make_install_man := test -f $$TMP_DEST/share/man/man1/perf.1 |
@@ -162,7 +188,7 @@ $(run): | |||
162 | cmd="cd $(PERF) && make -f $(MK) DESTDIR=$$TMP_DEST $($@)"; \ | 188 | cmd="cd $(PERF) && make -f $(MK) DESTDIR=$$TMP_DEST $($@)"; \ |
163 | echo "- $@: $$cmd" && echo $$cmd > $@ && \ | 189 | echo "- $@: $$cmd" && echo $$cmd > $@ && \ |
164 | ( eval $$cmd ) >> $@ 2>&1; \ | 190 | ( eval $$cmd ) >> $@ 2>&1; \ |
165 | echo " test: $(call test,$@)"; \ | 191 | echo " test: $(call test,$@)" >> $@ 2>&1; \ |
166 | $(call test,$@) && \ | 192 | $(call test,$@) && \ |
167 | rm -f $@ \ | 193 | rm -f $@ \ |
168 | rm -rf $$TMP_DEST | 194 | rm -rf $$TMP_DEST |
@@ -174,7 +200,7 @@ $(run_O): | |||
174 | cmd="cd $(PERF) && make -f $(MK) O=$$TMP_O DESTDIR=$$TMP_DEST $($(patsubst %_O,%,$@))"; \ | 200 | cmd="cd $(PERF) && make -f $(MK) O=$$TMP_O DESTDIR=$$TMP_DEST $($(patsubst %_O,%,$@))"; \ |
175 | echo "- $@: $$cmd" && echo $$cmd > $@ && \ | 201 | echo "- $@: $$cmd" && echo $$cmd > $@ && \ |
176 | ( eval $$cmd ) >> $@ 2>&1 && \ | 202 | ( eval $$cmd ) >> $@ 2>&1 && \ |
177 | echo " test: $(call test_O,$@)"; \ | 203 | echo " test: $(call test_O,$@)" >> $@ 2>&1; \ |
178 | $(call test_O,$@) && \ | 204 | $(call test_O,$@) && \ |
179 | rm -f $@ && \ | 205 | rm -f $@ && \ |
180 | rm -rf $$TMP_O \ | 206 | rm -rf $$TMP_O \ |