From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Robert Richter <robert.richter@amd.com>,
Jiri Olsa <jolsa@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 02/12] perf test: Do not abort tests on error
Date: Thu, 23 Aug 2012 12:09:46 -0300 [thread overview]
Message-ID: <1345734596-7601-3-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1345734596-7601-1-git-send-email-acme@infradead.org>
From: Robert Richter <robert.richter@amd.com>
Run through all tests regardless of failures. On errors, return the
first error code detected.
Signed-off-by: Robert Richter <robert.richter@amd.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1345572195-23857-2-git-send-email-robert.richter@amd.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/parse-events-test.c | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/tools/perf/util/parse-events-test.c b/tools/perf/util/parse-events-test.c
index bf055ce..392308c 100644
--- a/tools/perf/util/parse-events-test.c
+++ b/tools/perf/util/parse-events-test.c
@@ -948,19 +948,19 @@ static int test_event(struct test__event_st *e)
static int test_events(struct test__event_st *events, unsigned cnt)
{
- int ret = 0;
+ int ret1, ret2 = 0;
unsigned i;
for (i = 0; i < cnt; i++) {
struct test__event_st *e = &events[i];
pr_debug("running test %d '%s'\n", i, e->name);
- ret = test_event(e);
- if (ret)
- break;
+ ret1 = test_event(e);
+ if (ret1)
+ ret2 = ret1;
}
- return ret;
+ return ret2;
}
static int test_term(struct test__term *t)
@@ -1021,13 +1021,13 @@ static int test_pmu(void)
int parse_events__test(void)
{
- int ret;
+ int ret1, ret2 = 0;
#define TEST_EVENTS(tests) \
do { \
- ret = test_events(tests, ARRAY_SIZE(tests)); \
- if (ret) \
- return ret; \
+ ret1 = test_events(tests, ARRAY_SIZE(tests)); \
+ if (!ret2) \
+ ret2 = ret1; \
} while (0)
TEST_EVENTS(test__events);
@@ -1035,5 +1035,9 @@ do { \
if (test_pmu())
TEST_EVENTS(test__events_pmu);
- return test_terms(test__terms, ARRAY_SIZE(test__terms));
+ ret1 = test_terms(test__terms, ARRAY_SIZE(test__terms));
+ if (!ret2)
+ ret2 = ret1;
+
+ return ret2;
}
--
1.7.1
next prev parent reply other threads:[~2012-08-23 15:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1345734596-7601-1-git-send-email-acme@infradead.org>
2012-08-23 15:09 ` [PATCH 01/12] perf tools: Fix 'No libunwind found' make warning message Arnaldo Carvalho de Melo
2012-08-23 15:09 ` Arnaldo Carvalho de Melo [this message]
2012-08-23 15:09 ` [PATCH 03/12] perf tools: Catch event names from command line Arnaldo Carvalho de Melo
2012-08-23 15:09 ` [PATCH 04/12] perf tools: Refactor print_event_desc() Arnaldo Carvalho de Melo
2012-08-23 15:09 ` [PATCH 05/12] perf report: Update event names from header description Arnaldo Carvalho de Melo
2012-08-23 15:09 ` [PATCH 06/12] perf tools: Add pmu mappings to header information Arnaldo Carvalho de Melo
2012-08-23 15:09 ` [PATCH 07/12] perf tools: Keep the perf_event_attr on version 3 Arnaldo Carvalho de Melo
2012-08-23 15:09 ` [PATCH 08/12] tools lib traceevent: Do not link broken field arg for an old ftrace event Arnaldo Carvalho de Melo
2012-08-23 15:09 ` [PATCH 09/12] tools lib traceevent: Introduce pevent_errno Arnaldo Carvalho de Melo
2012-08-23 15:09 ` [PATCH 10/12] tools lib traceevent: Introduce pevent_strerror Arnaldo Carvalho de Melo
2012-08-23 15:09 ` [PATCH 11/12] tools lib traceevent: Fix strerror_r() use in pevent_strerror Arnaldo Carvalho de Melo
2012-08-23 15:09 ` [PATCH 12/12] tools lib traceevent: Fix off-by-one bug in pevent_strerror() Arnaldo Carvalho de Melo
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=1345734596-7601-3-git-send-email-acme@infradead.org \
--to=acme@infradead.org \
--cc=acme@redhat.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=robert.richter@amd.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;
as well as URLs for NNTP newsgroup(s).