mirror of https://lore.kernel.org/lkml/
 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>
Subject: [PATCH 01/27] perf tools: Add automated make test suite
Date: Mon,  1 Apr 2013 21:18:24 +0200	[thread overview]
Message-ID: <1364843930-17974-2-git-send-email-jolsa@redhat.com> (raw)
In-Reply-To: <1364843930-17974-1-git-send-email-jolsa@redhat.com>

Adding automatd test for testing the build process.
To run it you needto 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_DEBUG: cd . && make -f Makefile DEBUG=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 succesfull 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>
---
 tools/perf/tests/make | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 122 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..0cc64ea
--- /dev/null
+++ b/tools/perf/tests/make
@@ -0,0 +1,122 @@
+ifndef PERF
+PERF := .
+endif
+
+ifndef MK
+MK := Makefile
+endif
+
+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_MINIMAL        := NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 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
+
+RUN := \
+	MAKE_PURE \
+	MAKE_DEBUG \
+	MAKE_NO_LIBPERL \
+	MAKE_NO_LIBPYTHON \
+	MAKE_NO_SCRIPTS \
+	MAKE_NO_NEWT \
+	MAKE_NO_SLANG \
+	MAKE_NO_GTK2 \
+	MAKE_NO_UI \
+	MAKE_NO_DEMANGLE \
+	MAKE_NO_LIBELF \
+	MAKE_NO_LIBUNWIND \
+	MAKE_NO_BACKTRACE \
+	MAKE_NO_LIBNUMA \
+	MAKE_NO_LIBAUDIT \
+	MAKE_NO_LIBBIONIC \
+	MAKE_MINIMAL \
+	MAKE_TAGS \
+	MAKE_CSCOPE \
+	MAKE_HELP \
+	MAKE_DOC \
+	MAKE_PERF_O \
+	MAKE_UTIL_MAP_O
+
+RUN_O := $(addsuffix _O,$(RUN))
+
+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_PERF_O     := test -f $(PERF)/perf.o
+TEST_MAKE_UTIL_MAP_O := test -f $(PERF)/util/map.o
+
+# Kbuild tests only
+#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,$@)
+
+$(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 -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-04-01 19:19 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01 19:18 [RFC 00/27] perf tools: Build changes and kbuild support Jiri Olsa
2013-04-01 19:18 ` Jiri Olsa [this message]
2013-04-01 19:53   ` [PATCH 01/27] perf tools: Add automated make test suite Sam Ravnborg
2013-04-01 21:09     ` Jiri Olsa
2013-04-01 19:18 ` [PATCH 02/27] perf tools: Fix tab vs spaces issue in Makefile ifdef/endif Jiri Olsa
2013-04-01 19:49   ` Sam Ravnborg
2013-04-01 21:11     ` Jiri Olsa
2013-04-01 19:18 ` [PATCH 03/27] perf tools: Move arch check into config/Makefile Jiri Olsa
2013-04-01 19:54   ` Sam Ravnborg
2013-04-01 21:07     ` Jiri Olsa
2013-04-01 21:54   ` Namhyung Kim
2013-04-01 22:00     ` Jiri Olsa
2013-04-01 19:18 ` [PATCH 04/27] perf tools: Move programs " Jiri Olsa
2013-04-01 22:09   ` Namhyung Kim
2013-04-01 22:27     ` Jiri Olsa
2013-04-02  3:59       ` Namhyung Kim
2013-04-01 19:18 ` [PATCH 05/27] perf tools: Move compiler and linker flags " Jiri Olsa
2013-04-01 22:20   ` Namhyung Kim
2013-04-01 23:06     ` Jiri Olsa
2013-04-01 19:18 ` [PATCH 06/27] perf tools: Move libelf check config " Jiri Olsa
2013-04-01 19:18 ` [PATCH 07/27] perf tools: Move libdw " Jiri Olsa
2013-04-01 19:18 ` [PATCH 08/27] perf tools: Move libunwind " Jiri Olsa
2013-04-01 19:18 ` [PATCH 09/27] perf tools: Move libaudit " Jiri Olsa
2013-04-01 19:18 ` [PATCH 10/27] perf tools: Move slang " Jiri Olsa
2013-04-01 19:18 ` [PATCH 11/27] perf tools: Move gtk2 " Jiri Olsa
2013-04-01 19:18 ` [PATCH 12/27] perf tools: Move libperl " Jiri Olsa
2013-04-01 19:18 ` [PATCH 13/27] perf tools: Move libpython " Jiri Olsa
2013-04-01 19:18 ` [PATCH 14/27] perf tools: Move libbfd " Jiri Olsa
2013-04-01 19:18 ` [PATCH 15/27] perf tools: Move stdlib " Jiri Olsa
2013-04-01 19:18 ` [PATCH 16/27] perf tools: Move libnuma " Jiri Olsa
2013-04-01 19:18 ` [PATCH 17/27] perf tools: Move paths " Jiri Olsa
2013-04-01 19:18 ` [PATCH 18/27] perf tools: Final touches for CHK config move Jiri Olsa
2013-04-01 19:18 ` [PATCH 19/27] perf tools: Merge all *CFLAGS* make variable into CFLAGS Jiri Olsa
2013-04-01 19:18 ` [PATCH 20/27] perf tools: Merge all *LDFLAGS* make variable into LDFLAGS Jiri Olsa
2013-04-01 19:18 ` [PATCH 21/27] perf tools: Switch to full patch C include directories Jiri Olsa
2013-04-01 19:18 ` [PATCH 22/27] perf tools: Add NO_BIONIC variable to confiure bionic setup Jiri Olsa
2013-04-01 19:18 ` [PATCH 23/27] kbuild: Introduce KBUILD_AUTOCONF variable for auto.conf include Jiri Olsa
2013-04-01 19:18 ` [PATCH 24/27] kbuild: Introduce KCONFIG_AUTOCONFIGDEP variable for conf tool Jiri Olsa
2013-04-11 10:29   ` Michal Marek
2013-04-01 19:18 ` [PATCH 25/27] perf tools: Kbuild builtin source related fixies Jiri Olsa
2013-04-01 19:18 ` [PATCH 26/27] perf tools: Kbuild " Jiri Olsa
2013-04-01 19:18 ` [PATCH 27/27] perf tools: Add kbuild support into Makefile.kbuild Jiri Olsa
2013-04-01 20:03   ` Sam Ravnborg
2013-04-01 21:05     ` Jiri Olsa
2013-04-01 20:45 ` [RFC 00/27] perf tools: Build changes and kbuild support David Ahern
2013-04-01 21:18   ` 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=1364843930-17974-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=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 \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®