From patchwork Mon Jul 6 03:41:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1323279 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B0WcW1FhRz9sDX for ; Mon, 6 Jul 2020 13:43:07 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=cJMfhA6v; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4B0WcW0YwvzDqXJ for ; Mon, 6 Jul 2020 13:43:07 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::12b; helo=mail-il1-x12b.google.com; envelope-from=sjg@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=cJMfhA6v; dkim-atps=neutral Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4B0WbY6GZ4zDqQ6 for ; Mon, 6 Jul 2020 13:42:13 +1000 (AEST) Received: by mail-il1-x12b.google.com with SMTP id s21so16563551ilk.5 for ; Sun, 05 Jul 2020 20:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uet5YIhnHaO3k4U7fj7drRe8Wi7cDmDgfwJ2fZXeYto=; b=cJMfhA6vZhAuhkiHpvWeT9iDbSJ4QdYKCaMvl5lDXJHC8370d0opev+6Hu+jO+kpHM Fh8GAH90X7SBTXI2jSjfaTMti9Ekb3vBbz+3GSfMpTH6GaWZcXIdWoAHj6cpLACwqIns FG8+shItCTWUm7SUKzObo6zWMuoVvggJBWwvs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uet5YIhnHaO3k4U7fj7drRe8Wi7cDmDgfwJ2fZXeYto=; b=Ja+ZGgQ55VSBCX2v5AhIwD8mVn38KjwoDSAcSFWMipHIEzFfopk1EReakGkH3YTW1v v89fdKZNuO70soWOZ6JC7ZcwCuOzQD70MYTiQ7ECLrnil+tTPu3XZXA0Jgey7Af5xWqp KMJkunGQggUcB8wt1Kl1pNVti5rbdl/FzryqThopsso2NoGvhtlt9ZegtmZcPqXwm5O1 JI99JH7Wn6hZaO2QiMD6vbcvVU7xPuiExHw4dmOHgPlFw6khZdZjRHYJDAf3AvmO8ZxH stn8ak3WcU95L5EdMeEG36oNDXjzI/pcXxyaqb/MvCwduRrqGB3jPnbIhHq/A2tWLOyV jP7Q== X-Gm-Message-State: AOAM533NQS7hOT/Tfhc9MbyWo+PdccWLsOw346Uc3tu4Ltznihqx+VZM +aITJ5lRhyN7SCUbxce/EMyhJw== X-Google-Smtp-Source: ABdhPJzulBYUixvHDGWkiBdUzNtF4zkcSV09WAXN5QU5P8lYyLjDAtvXyYFeG5AMl6eoDQuVQKejvw== X-Received: by 2002:a05:6e02:1246:: with SMTP id j6mr27864026ilq.216.1594006931427; Sun, 05 Jul 2020 20:42:11 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id r15sm1664958ilh.86.2020.07.05.20.42.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 20:42:11 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Subject: [RFC PATCH 01/16] patman: Use test_util to show test results Date: Sun, 5 Jul 2020 21:41:48 -0600 Message-Id: <20200706034203.2171077-2-sjg@chromium.org> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog In-Reply-To: <20200706034203.2171077-1-sjg@chromium.org> References: <20200706034203.2171077-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Rini , Simon Glass , patchwork@lists.ozlabs.org Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" This handles skipped tests correctly, so use it instead of the existing code. Signed-off-by: Simon Glass --- tools/patman/main.py | 8 ++------ tools/patman/test_util.py | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tools/patman/main.py b/tools/patman/main.py index 28a9a26087..03668d1bb8 100755 --- a/tools/patman/main.py +++ b/tools/patman/main.py @@ -25,6 +25,7 @@ from patman import patchstream from patman import project from patman import settings from patman import terminal +from patman import test_util from patman import test_checkpatch @@ -101,12 +102,7 @@ elif options.test: suite = doctest.DocTestSuite(module) suite.run(result) - # TODO: Surely we can just 'print' result? - print(result) - for test, err in result.errors: - print(err) - for test, err in result.failures: - print(err) + sys.exit(test_util.ReportResult('patman', None, result)) # Called from git with a patch filename as argument # Printout a list of additional CC recipients for this patch diff --git a/tools/patman/test_util.py b/tools/patman/test_util.py index aac58fb72f..0827488f33 100644 --- a/tools/patman/test_util.py +++ b/tools/patman/test_util.py @@ -123,12 +123,12 @@ def ReportResult(toolname:str, test_name: str, result: unittest.TestResult): for test, err in result.failures: print(err, result.failures) if result.skipped: - print('%d binman test%s SKIPPED:' % - (len(result.skipped), 's' if len(result.skipped) > 1 else '')) + print('%d %s test%s SKIPPED:' % (len(result.skipped), toolname, + 's' if len(result.skipped) > 1 else '')) for skip_info in result.skipped: print('%s: %s' % (skip_info[0], skip_info[1])) if result.errors or result.failures: - print('binman tests FAILED') + print('%s tests FAILED' % toolname) return 1 return 0