From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Wang Nan <wangnan0@huawei.com>,
Jiri Olsa <jolsa@kernel.org>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Zefan Li <lizefan@huawei.com>,
pi3orama@163.com, Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 12/12] perf test: Reset err after using it hold errcode in hist testcases
Date: Mon, 11 Jan 2016 20:32:01 -0300 [thread overview]
Message-ID: <1452555121-21739-13-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1452555121-21739-1-git-send-email-acme@kernel.org>
From: Wang Nan <wangnan0@huawei.com>
All hists test cases forget to reset err after using it to hold an
error code. If error occure in setup_fake_machine() it incorrectly
return TEST_OK.
This patch fixes it.
Suggested-and-Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1452520124-2073-13-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/hists_cumulate.c | 1 +
tools/perf/tests/hists_filter.c | 1 +
tools/perf/tests/hists_link.c | 1 +
tools/perf/tests/hists_output.c | 1 +
4 files changed, 4 insertions(+)
diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c
index e36089212061..5e6a86e50fb9 100644
--- a/tools/perf/tests/hists_cumulate.c
+++ b/tools/perf/tests/hists_cumulate.c
@@ -706,6 +706,7 @@ int test__hists_cumulate(int subtest __maybe_unused)
err = parse_events(evlist, "cpu-clock", NULL);
if (err)
goto out;
+ err = TEST_FAIL;
machines__init(&machines);
diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c
index 2a784befd9ce..351a42463444 100644
--- a/tools/perf/tests/hists_filter.c
+++ b/tools/perf/tests/hists_filter.c
@@ -120,6 +120,7 @@ int test__hists_filter(int subtest __maybe_unused)
err = parse_events(evlist, "task-clock", NULL);
if (err)
goto out;
+ err = TEST_FAIL;
/* default sort order (comm,dso,sym) will be used */
if (setup_sorting(NULL) < 0)
diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c
index c764d69ac6ef..64b257d8d557 100644
--- a/tools/perf/tests/hists_link.c
+++ b/tools/perf/tests/hists_link.c
@@ -293,6 +293,7 @@ int test__hists_link(int subtest __maybe_unused)
if (err)
goto out;
+ err = TEST_FAIL;
/* default sort order (comm,dso,sym) will be used */
if (setup_sorting(NULL) < 0)
goto out;
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c
index ebe6cd485b5d..b231265148d8 100644
--- a/tools/perf/tests/hists_output.c
+++ b/tools/perf/tests/hists_output.c
@@ -597,6 +597,7 @@ int test__hists_output(int subtest __maybe_unused)
err = parse_events(evlist, "cpu-clock", NULL);
if (err)
goto out;
+ err = TEST_FAIL;
machines__init(&machines);
--
2.1.0
next prev parent reply other threads:[~2016-01-11 23:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-11 23:31 [GIT PULL 00/12] perf/core fixes Arnaldo Carvalho de Melo
2016-01-11 23:31 ` [PATCH 01/12] tools: Add clean targets for tools directory Arnaldo Carvalho de Melo
2016-01-11 23:31 ` [PATCH 02/12] tools bpf: Add *.cmd files clean up Arnaldo Carvalho de Melo
2016-01-11 23:31 ` [PATCH 03/12] tools lockdep: " Arnaldo Carvalho de Melo
2016-01-11 23:31 ` [PATCH 04/12] perf tools: Add missing sources to perf's MANIFEST Arnaldo Carvalho de Melo
2016-01-11 23:31 ` [PATCH 05/12] perf tools: Add -lutil in python lib list for broken python-config Arnaldo Carvalho de Melo
2016-01-11 23:31 ` [PATCH 06/12] perf tools: Fix phony build target for build-test Arnaldo Carvalho de Melo
2016-01-11 23:31 ` [PATCH 07/12] perf tools: Fix PowerPC native building Arnaldo Carvalho de Melo
2016-01-11 23:31 ` [PATCH 08/12] tools: Move Makefile.arch from perf/config to tools/scripts Arnaldo Carvalho de Melo
2016-01-11 23:31 ` [PATCH 09/12] perf bpf: Fix build breakage due to libbpf Arnaldo Carvalho de Melo
2016-01-11 23:31 ` [PATCH 10/12] tools build: Add BPF feature check to test-all Arnaldo Carvalho de Melo
2016-01-11 23:32 ` [PATCH 11/12] perf test: Fix false TEST_OK result for 'perf test hist' Arnaldo Carvalho de Melo
2016-01-11 23:32 ` Arnaldo Carvalho de Melo [this message]
2016-01-12 10:04 ` [GIT PULL 00/12] perf/core 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=1452555121-21739-13-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@kernel.org \
--cc=pi3orama@163.com \
--cc=wangnan0@huawei.com \
/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