Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4920607ybg; Mon, 21 Oct 2019 17:06:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyo+omK3arlVn1qZzauvyK3iJ4gc5sVypqXSfkTQGmn+cS/E7xWshEj8vfckJWBisJol9El X-Received: by 2002:a05:6402:2042:: with SMTP id bc2mr28200498edb.12.1571702785104; Mon, 21 Oct 2019 17:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571702785; cv=none; d=google.com; s=arc-20160816; b=IORvIkFXAfrXaob9INjLJabJ2Y2yZeMmvXIQbJ/vlFjkpEpPVu4/MFyzGDl/E+oCO8 cDUb9CQEeLyOvUhsfxLWJNsTei6+1LmwybtvlorJIzVq/ukwLUVsDlX53gx6JCiaDy0Q Esh14/KGxPrDZq4T9rps+GJOozRrY5utUn0wxA+HYXCrKgjAWBfcQVUHi7VdQf2iVlEl waD7eQxlxjCSKEwG1tco2U5utGv5JwyrWEN7F3uifbAT7YlIFW43ohwgVt3CLZSVI8Nf cydFA9GjmhIn0pEwVZZdHevn6DNX6qKi7PSzepkM+TU5CBfYwrikcMAJUgC16CX1Baf+ 6hlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=AjWd3lh/r/MY6OcFWTiUH5vdATCWYdFU02Gyk36liIg=; b=vTMAEObMMjEt0/ra4/hgFgNGVFSOSYhFxlYO7E9z8lPZeR4CcYsv+l9h2umqgJOQof VOPQpGbBNVfsTjZj1F6TsVtFNyHGy2mu0Vgh7nYy5YpIj+EPkZ2iE9+JvY1FxxepLJhI WhFQ1R7riMsQUwWIBcgRc28/TM1aW7BGcOAkksIGNH68wEy1aAxFNmLA9R9SMxcArLpy ixljmOpV1hlLSqUjvFnOEQ4GYtCks3cvoZ7qNskwzSDjzVHPqR27ow4IA5qeCd2SBUux sBXVOJoiU+bLrqselQFQkXSDQE+SAJduUi9R1SRINZdOjoM4aSRN08TzNbgsAOFkrvVx DTjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si11550668edy.188.2019.10.21.17.06.01; Mon, 21 Oct 2019 17:06:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387560AbfJVAFH (ORCPT + 99 others); Mon, 21 Oct 2019 20:05:07 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:38895 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387548AbfJVAFG (ORCPT ); Mon, 21 Oct 2019 20:05:06 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iMgws-0003qu-CE; Tue, 22 Oct 2019 01:18:50 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id AD15D1C047B; Tue, 22 Oct 2019 01:18:49 +0200 (CEST) Date: Mon, 21 Oct 2019 23:18:49 -0000 From: "tip-bot2 for Jiri Olsa" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] libperf: Keep count of failed tests Cc: Jiri Olsa , Alexander Shishkin , Alexey Budankov , Andi Kleen , Jin Yao , Michael Petlan , Namhyung Kim , Peter Zijlstra , Stephane Eranian , Arnaldo Carvalho de Melo , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org In-Reply-To: <20191017105918.20873-9-jolsa@kernel.org> References: <20191017105918.20873-9-jolsa@kernel.org> MIME-Version: 1.0 Message-ID: <157169992933.29376.15176117865199883044.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: 301a89f8cf628316eea6c768787a836b63a83439 Gitweb: https://git.kernel.org/tip/301a89f8cf628316eea6c768787a836b63a83439 Author: Jiri Olsa AuthorDate: Thu, 17 Oct 2019 12:59:16 +02:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Sat, 19 Oct 2019 15:35:01 -03:00 libperf: Keep count of failed tests Keep the count of failed tests, so we get better output with failures, like: # make tests ... running static: - running test-cpumap.c...OK - running test-threadmap.c...OK - running test-evlist.c...FAILED test-evlist.c:53 failed to create evsel2 FAILED test-evlist.c:163 failed to create evsel2 FAILED test-evlist.c:287 failed count FAILED (3) - running test-evsel.c...OK running dynamic: - running test-cpumap.c...OK - running test-threadmap.c...OK - running test-evlist.c...FAILED test-evlist.c:53 failed to create evsel2 FAILED test-evlist.c:163 failed to create evsel2 FAILED test-evlist.c:287 failed count FAILED (3) - running test-evsel.c...OK ... Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Jin Yao Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20191017105918.20873-9-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/lib/include/internal/tests.h | 20 +++++++++++++++++--- tools/perf/lib/tests/test-cpumap.c | 2 +- tools/perf/lib/tests/test-evlist.c | 2 +- tools/perf/lib/tests/test-evsel.c | 2 +- tools/perf/lib/tests/test-threadmap.c | 2 +- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/tools/perf/lib/include/internal/tests.h b/tools/perf/lib/include/internal/tests.h index b7a20cd..2093e88 100644 --- a/tools/perf/lib/include/internal/tests.h +++ b/tools/perf/lib/include/internal/tests.h @@ -4,14 +4,28 @@ #include -#define __T_START fprintf(stdout, "- running %s...", __FILE__) -#define __T_OK fprintf(stdout, "OK\n") -#define __T_FAIL fprintf(stdout, "FAIL\n") +int tests_failed; + +#define __T_START \ +do { \ + fprintf(stdout, "- running %s...", __FILE__); \ + fflush(NULL); \ + tests_failed = 0; \ +} while (0) + +#define __T_END \ +do { \ + if (tests_failed) \ + fprintf(stdout, " FAILED (%d)\n", tests_failed); \ + else \ + fprintf(stdout, "OK\n"); \ +} while (0) #define __T(text, cond) \ do { \ if (!(cond)) { \ fprintf(stderr, "FAILED %s:%d %s\n", __FILE__, __LINE__, text); \ + tests_failed++; \ return -1; \ } \ } while (0) diff --git a/tools/perf/lib/tests/test-cpumap.c b/tools/perf/lib/tests/test-cpumap.c index aa34c20..c8d4509 100644 --- a/tools/perf/lib/tests/test-cpumap.c +++ b/tools/perf/lib/tests/test-cpumap.c @@ -26,6 +26,6 @@ int main(int argc, char **argv) perf_cpu_map__put(cpus); perf_cpu_map__put(cpus); - __T_OK; + __T_END; return 0; } diff --git a/tools/perf/lib/tests/test-evlist.c b/tools/perf/lib/tests/test-evlist.c index 741bc1b..6d8ebe0 100644 --- a/tools/perf/lib/tests/test-evlist.c +++ b/tools/perf/lib/tests/test-evlist.c @@ -408,6 +408,6 @@ int main(int argc, char **argv) test_mmap_thread(); test_mmap_cpus(); - __T_OK; + __T_END; return 0; } diff --git a/tools/perf/lib/tests/test-evsel.c b/tools/perf/lib/tests/test-evsel.c index 1b6c428..135722a 100644 --- a/tools/perf/lib/tests/test-evsel.c +++ b/tools/perf/lib/tests/test-evsel.c @@ -130,6 +130,6 @@ int main(int argc, char **argv) test_stat_thread(); test_stat_thread_enable(); - __T_OK; + __T_END; return 0; } diff --git a/tools/perf/lib/tests/test-threadmap.c b/tools/perf/lib/tests/test-threadmap.c index 8c5f472..7dc4d6f 100644 --- a/tools/perf/lib/tests/test-threadmap.c +++ b/tools/perf/lib/tests/test-threadmap.c @@ -26,6 +26,6 @@ int main(int argc, char **argv) perf_thread_map__put(threads); perf_thread_map__put(threads); - __T_OK; + __T_END; return 0; }