All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Jiri Olsa <jolsa@redhat.com>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Borislav Petkov <bp@alien8.de>,
	Stephane Eranian <eranian@google.com>,
	Sam Ravnborg <sam@ravnborg.org>, David Ahern <dsahern@gmail.com>
Subject: [PATCH 01/25] perf tools: Add automated make test suite
Date: Fri, 24 May 2013 14:35:04 +0200	[thread overview]
Message-ID: <1369398928-9809-2-git-send-email-jolsa@redhat.com> (raw)
In-Reply-To: <1369398928-9809-1-git-send-email-jolsa@redhat.com>

Adding automated test for testing the build process.
To run it you need to be in perf directory or specify
one with PERF variable. It's also possible to specify
optional Makefile to test via MK variable.

Whole suite is executed twice, the second time with
O=/tmp/xxx option added.

To run the whole suite:
  $ make -f tests/make
  - make_pure: cd . && make -f Makefile
    test: test -x ./perf
  - make_clean_all: cd . && make -f Makefile clean all
    test: test -x ./perf
  - make_python_perf_so: cd . && make -f Makefile python/perf.so
    test: test -f ./python/perf.so
  - make_debug: cd . && make -f Makefile DEBUG=1
    test: test -x ./perf
  - make_no_libperl: cd . && make -f Makefile NO_LIBPERL=1
    test: test -x ./perf

You see command line for 'make_pure' test right away,
and the output is stored into 'make_pure' file.

To run simple test:
  $ make -f tests/make make_debug
  - make_debug: cd . && make -f Makefile DEBUG=1
    test: test -x ./perf

At this moment tests checks for successfull build
and for existence of several built files. Additional
after-build checks could be added.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: David Ahern <dsahern@gmail.com>
---
 tools/perf/tests/make | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)
 create mode 100644 tools/perf/tests/make

diff --git a/tools/perf/tests/make b/tools/perf/tests/make
new file mode 100644
index 0000000..c441a28
--- /dev/null
+++ b/tools/perf/tests/make
@@ -0,0 +1,138 @@
+PERF := .
+MK   := Makefile
+
+# standard single make variable specified
+make_clean_all      := clean all
+make_python_perf_so := python/perf.so
+make_debug          := DEBUG=1
+make_no_libperl     := NO_LIBPERL=1
+make_no_libpython   := NO_LIBPYTHON=1
+make_no_scripts     := NO_LIBPYTHON=1 NO_LIBPERL=1
+make_no_newt        := NO_NEWT=1
+make_no_slang       := NO_SLANG=1
+make_no_gtk2        := NO_GTK2=1
+make_no_ui          := NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
+make_no_demangle    := NO_DEMANGLE=1
+make_no_libelf      := NO_LIBELF=1
+make_no_libunwind   := NO_LIBUNWIND=1
+make_no_backtrace   := NO_BACKTRACE=1
+make_no_libnuma     := NO_LIBNUMA=1
+make_no_libaudit    := NO_LIBAUDIT=1
+make_no_libbionic   := NO_LIBBIONIC=1
+make_tags           := tags
+make_cscope         := cscope
+make_help           := help
+make_doc            := doc
+make_perf_o         := perf.o
+make_util_map_o     := util/map.o
+
+# all the NO_* variable combined
+make_minimal        := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1
+make_minimal        += NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1
+make_minimal        += NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1
+
+# $(run) contains all available tests
+run := make_pure
+run += make_clean_all
+run += make_python_perf_so
+run += make_debug
+run += make_no_libperl
+run += make_no_libpython
+run += make_no_scripts
+run += make_no_newt
+run += make_no_slang
+run += make_no_gtk2
+run += make_no_ui
+run += make_no_demangle
+run += make_no_libelf
+run += make_no_libunwind
+run += make_no_backtrace
+run += make_no_libnuma
+run += make_no_libaudit
+run += make_no_libbionic
+run += make_tags
+run += make_cscope
+run += make_help
+run += make_doc
+run += make_perf_o
+run += make_util_map_o
+run += make_minimal
+
+# $(run_O) contains same portion of $(run) tests with '_O' attached
+# to distinguish O=... tests
+run_O := $(addsuffix _O,$(run))
+
+# disable some tests for O=...
+run_O := $(filter-out make_python_perf_so_O,$(run_O))
+
+# define test for each compile as 'test_NAME' variable
+# with the test itself as a value
+test_make_tags   = test -f tags
+test_make_cscope = test -f cscope.out
+
+test_make_tags_O   := $(test_make_tags)
+test_make_cscope_O := $(test_make_cscope)
+
+test_ok          := true
+test_make_help   := $(test_ok)
+test_make_doc    := $(test_ok)
+test_make_help_O := $(test_ok)
+test_make_doc_O  := $(test_ok)
+
+test_make_python_perf_so := test -f $(PERF)/python/perf.so
+
+test_make_perf_o     := test -f $(PERF)/perf.o
+test_make_util_map_o := test -f $(PERF)/util/map.o
+
+# Kbuild tests only
+#test_make_python_perf_so_O := test -f $$TMP/tools/perf/python/perf.so
+#test_make_perf_o_O         := test -f $$TMP/tools/perf/perf.o
+#test_make_util_map_o_O     := test -f $$TMP/tools/perf/util/map.o
+
+test_make_perf_o_O     := true
+test_make_util_map_o_O := true
+
+test_default = test -x $(PERF)/perf
+test = $(if $(test_$1),$(test_$1),$(test_default))
+
+test_default_O = test -x $$TMP/perf
+test_O = $(if $(test_$1),$(test_$1),$(test_default_O))
+
+all:
+
+ifdef DEBUG
+d := $(info run   $(run))
+d := $(info run_O $(run_O))
+endif
+
+MAKEFLAGS := --no-print-directory
+
+clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null)
+
+$(run):
+	$(call clean)
+	@cmd="cd $(PERF) && make -f $(MK) $($@)"; \
+	echo "- $@: $$cmd" && echo $$cmd > $@ && \
+	( eval $$cmd ) >> $@ 2>&1; \
+	echo "  test: $(call test,$@)"; \
+	$(call test,$@) && \
+	rm -f $@
+
+$(run_O):
+	$(call clean)
+	@TMP=$$(mktemp -d); \
+	cmd="cd $(PERF) && make -f $(MK) $($(patsubst %_O,%,$@)) O=$$TMP"; \
+	echo "- $@: $$cmd" && echo $$cmd > $@ && \
+	( eval $$cmd ) >> $@ 2>&1 && \
+	echo "  test: $(call test_O,$@)"; \
+	$(call test_O,$@) && \
+	rm -f $@ && \
+	rm -rf $$TMP
+
+all: $(run) $(run_O)
+	@echo OK
+
+out: $(run_O)
+	@echo OK
+
+.PHONY: all $(run) $(run_O) clean
-- 
1.7.11.7


  reply	other threads:[~2013-05-24 12:36 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-24 12:35 [PATCHv3 00/25] perf tools: Makefile changes Jiri Olsa
2013-05-24 12:35 ` Jiri Olsa [this message]
2013-05-31 11:54   ` [tip:perf/core] perf tools: Add automated make test suite tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 02/25] perf tools: Move arch check into config/Makefile Jiri Olsa
2013-05-31 11:55   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 03/25] perf tools: Move programs " Jiri Olsa
2013-05-31 11:57   ` [tip:perf/core] perf tools: Move programs check into config/ Makefile tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 04/25] perf tools: Move compiler and linker flags check into config/Makefile Jiri Olsa
2013-05-31 11:58   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 05/25] perf tools: Move libelf check config " Jiri Olsa
2013-05-31 11:59   ` [tip:perf/core] perf tools: Move libelf check config into config/ Makefile tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 06/25] perf tools: Move libdw check config into config/Makefile Jiri Olsa
2013-05-31 12:01   ` [tip:perf/core] perf tools: Move libdw check config into config/ Makefile tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 07/25] perf tools: Move libunwind check config into config/Makefile Jiri Olsa
2013-05-31 12:02   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 08/25] perf tools: Move libaudit " Jiri Olsa
2013-05-31 12:03   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 09/25] perf tools: Move slang " Jiri Olsa
2013-05-31 12:04   ` [tip:perf/core] perf tools: Move slang check config into config/ Makefile tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 10/25] perf tools: Move gtk2 check config into config/Makefile Jiri Olsa
2013-05-31 12:06   ` [tip:perf/core] perf tools: Move gtk2 check config into config/ Makefile tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 11/25] perf tools: Move libperl check config into config/Makefile Jiri Olsa
2013-05-31 12:07   ` [tip:perf/core] perf tools: Move libperl check config into config /Makefile tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 12/25] perf tools: Move libpython check config into config/Makefile Jiri Olsa
2013-05-31 12:08   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 13/25] perf tools: Move libbfd " Jiri Olsa
2013-05-31 12:10   ` [tip:perf/core] perf tools: Move libbfd check config into config/ Makefile tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 14/25] perf tools: Move stdlib check config into config/Makefile Jiri Olsa
2013-05-31 12:11   ` [tip:perf/core] perf tools: Move stdlib check config into config/ Makefile tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 15/25] perf tools: Move libnuma check config into config/Makefile Jiri Olsa
2013-05-31 12:12   ` [tip:perf/core] perf tools: Move libnuma check config into config /Makefile tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 16/25] perf tools: Move paths config into config/Makefile Jiri Olsa
2013-05-31 12:13   ` [tip:perf/core] perf tools: Move paths config into config/ Makefile tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 17/25] perf tools: Final touches for CHK config move Jiri Olsa
2013-05-31 12:15   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 18/25] perf tools: Merge all *CFLAGS* make variable into CFLAGS Jiri Olsa
2013-05-31 12:29   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 19/25] perf tools: Merge all *LDFLAGS* make variable into LDFLAGS Jiri Olsa
2013-05-31 12:30   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 20/25] perf tools: Switch to full path C include directories Jiri Olsa
2013-05-31 12:31   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 21/25] perf tools: Add NO_BIONIC variable to confiure bionic setup Jiri Olsa
2013-05-31 12:33   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 22/25] perf tools: Replace tabs with spaces for all non-commands statements Jiri Olsa
2013-05-31 12:34   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 23/25] perf tools: Replace multiple line assignment with multiple statements Jiri Olsa
2013-05-31 12:35   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 24/25] perf tools: Remove '?=' Makefile STRIP assignment Jiri Olsa
2013-05-31 12:37   ` [tip:perf/core] " tip-bot for Jiri Olsa
2013-05-24 12:35 ` [PATCH 25/25] perf tools: Add missing liblk.a dependency for python/perf.so Jiri Olsa
2013-05-31 12:38   ` [tip:perf/core] " tip-bot for Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369398928-9809-2-git-send-email-jolsa@redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=bp@alien8.de \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.