From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
David Ahern <dsahern@gmail.com>,
Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 06/39] tools build: Add test for missing include
Date: Mon, 28 Sep 2015 18:07:51 -0300 [thread overview]
Message-ID: <1443474504-16528-7-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1443474504-16528-1-git-send-email-acme@kernel.org>
From: Jiri Olsa <jolsa@kernel.org>
The current build framework fails to cope with header file removal. The
reason is that the removed header file stays in the .cmd file target
rule and forces the build to fail.
This issue is fixed and explained in the following patches.
Adding a new build test that simulates header removal.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1443004442-32660-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/tests/ex/Build | 1 +
tools/build/tests/ex/Makefile | 2 +-
tools/build/tests/ex/ex.c | 2 ++
tools/build/tests/ex/inc.c | 8 ++++++++
tools/build/tests/run.sh | 27 +++++++++++++++++++++++++++
5 files changed, 39 insertions(+), 1 deletion(-)
create mode 100644 tools/build/tests/ex/inc.c
diff --git a/tools/build/tests/ex/Build b/tools/build/tests/ex/Build
index 429c7d452101..4d502f9b1a50 100644
--- a/tools/build/tests/ex/Build
+++ b/tools/build/tests/ex/Build
@@ -4,6 +4,7 @@ ex-y += b.o
ex-y += b.o
ex-y += empty/
ex-y += empty2/
+ex-y += inc.o
libex-y += c.o
libex-y += d.o
diff --git a/tools/build/tests/ex/Makefile b/tools/build/tests/ex/Makefile
index a8f596e37fd2..f279b84cb859 100644
--- a/tools/build/tests/ex/Makefile
+++ b/tools/build/tests/ex/Makefile
@@ -1,4 +1,4 @@
-export srctree := ../../../..
+export srctree := $(abspath ../../../..)
export CC := gcc
export LD := ld
export AR := ar
diff --git a/tools/build/tests/ex/ex.c b/tools/build/tests/ex/ex.c
index dc42eb2e1a67..57de6074d252 100644
--- a/tools/build/tests/ex/ex.c
+++ b/tools/build/tests/ex/ex.c
@@ -5,6 +5,7 @@ int c(void);
int d(void);
int e(void);
int f(void);
+int inc(void);
int main(void)
{
@@ -14,6 +15,7 @@ int main(void)
d();
e();
f();
+ inc();
return 0;
}
diff --git a/tools/build/tests/ex/inc.c b/tools/build/tests/ex/inc.c
new file mode 100644
index 000000000000..c20f1e9033a3
--- /dev/null
+++ b/tools/build/tests/ex/inc.c
@@ -0,0 +1,8 @@
+#ifdef INCLUDE
+#include "krava.h"
+#endif
+
+int inc(void)
+{
+ return 0;
+}
diff --git a/tools/build/tests/run.sh b/tools/build/tests/run.sh
index 5494f8ea7567..44d2a0fade67 100755
--- a/tools/build/tests/run.sh
+++ b/tools/build/tests/run.sh
@@ -34,9 +34,36 @@ function test_ex_suffix {
make -C ex V=1 clean > /dev/null 2>&1
rm -f ex.out
}
+
+function test_ex_include {
+ make -C ex V=1 clean > ex.out 2>&1
+
+ # build with krava.h include
+ touch ex/krava.h
+ make -C ex V=1 CFLAGS=-DINCLUDE >> ex.out 2>&1
+
+ if [ ! -x ./ex/ex ]; then
+ echo FAILED
+ exit -1
+ fi
+
+ # build without the include
+ rm -f ex/krava.h ex/ex
+ make -C ex V=1 >> ex.out 2>&1
+
+ if [ ! -x ./ex/ex ]; then
+ echo FAILED
+ exit -1
+ fi
+
+ make -C ex V=1 clean > /dev/null 2>&1
+ rm -f ex.out
+}
+
echo -n Testing..
test_ex
test_ex_suffix
+test_ex_include
echo OK
--
2.1.0
next prev parent reply other threads:[~2015-09-28 21:08 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 21:07 [GIT PULL 00/39] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 01/39] perf top: Filter symbols based on __map__is_kernel(map) Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 02/39] perf hists browser: Use the map to determine if a DSO is being used as a kernel Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 03/39] perf tools: Use __map__is_kernel() when synthesizing kernel module mmap records Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 04/39] tools lib api fs: Store tracing mountpoint for better error message Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 05/39] tools build: Add Makefile.include Arnaldo Carvalho de Melo
2015-09-28 21:07 ` Arnaldo Carvalho de Melo [this message]
2015-09-28 21:07 ` [PATCH 07/39] tools build: Add fixdep dependency helper Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 08/39] tools build: Move dependency copy into function Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 09/39] tools build: Make the fixdep helper part of the build process Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 10/39] perf tools: Rename the 'single_dep' target to 'prepare' Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 11/39] tools build: Build fixdep helper from perf and basic libs Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 12/39] perf auxtrace: Fix 'instructions' period of zero Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 13/39] perf report: Fix sample type validation for synthesized callchains Arnaldo Carvalho de Melo
2015-09-28 21:07 ` [PATCH 14/39] perf intel-pt: Fix potential loop forever Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 15/39] perf intel-pt: Make logging slightly more efficient Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 16/39] perf script: Allow time to be displayed in nanoseconds Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 17/39] perf session: Warn when AUX data has been lost Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 18/39] perf tools: Add more documentation to export-to-postgresql.py script Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 19/39] perf auxtrace: Add option to synthesize branch stacks on samples Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 20/39] perf report: Adjust sample type validation for synthesized branch stacks Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 21/39] perf report: Also do default setup " Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 22/39] perf report: Skip events with null " Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 23/39] perf inject: Set branch stack feature flag when synthesizing " Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 24/39] perf intel-pt: Move branch filter logic Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 25/39] perf intel-pt: Support generating branch stack Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 26/39] perf report: Make max_stack value allow for synthesized callchains Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 27/39] perf hists: Allow for max_stack greater than PERF_MAX_STACK_DEPTH Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 28/39] perf script: Add a setting for maximum stack depth Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 29/39] perf scripting python: Allow for max_stack greater than PERF_MAX_STACK_DEPTH Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 30/39] perf script: Make scripting_max_stack value allow for synthesized callchains Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 31/39] perf evlist: Add perf_evlist__id2evsel_strict() Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 32/39] perf evlist: Add perf_evlist__remove() Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 33/39] perf inject: Remove more aux-related stuff when processing instruction traces Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 34/39] perf inject: Add --strip option to strip out non-synthesized events Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 35/39] perf intel-pt: Add mispred-all config option to aid use with autofdo Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 36/39] perf tools: Adds the config_term callback for different type events Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 37/39] perf tools: Show proper error message for wrong terms of hw/sw events Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 38/39] perf tools: Adds the tracepoint name parsing support Arnaldo Carvalho de Melo
2015-09-28 21:08 ` [PATCH 39/39] perf tools: Enable event_config terms to tracepoint events Arnaldo Carvalho de Melo
2015-09-29 7:47 ` [GIT PULL 00/39] perf/core improvements and fixes Ingo Molnar
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=1443474504-16528-7-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.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.