From patchwork Sat Jan 15 16:44:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15281 X-Patchwork-Delegate: laurent.pinchart@ideasonboard.com Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id DFE17BE086 for ; Sat, 15 Jan 2022 16:44:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0D69460868; Sat, 15 Jan 2022 17:44:52 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="cSbeIUXG"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5FB706017B for ; Sat, 15 Jan 2022 17:44:50 +0100 (CET) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B8EC0A24; Sat, 15 Jan 2022 17:44:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1642265090; bh=pvL2FinqixLdbgwBbmVGXyfxlXQYHUZYDP07v1fTJ+w=; h=From:To:Cc:Subject:Date:From; b=cSbeIUXGJNiVyAASZDuDl4fVI/NRGpUloCu3lwTUnQfbvAtTfoOpwZ8VhmMPCHqT9 FtHbURBhpqOOyg0Hl18QJWec0gOU7FVprCCBWatsPD757BdztZsl3ky+V5f8CmMhFD WfRSet1WOMLrAGoGI/NvO1aSZ/fx9IzDzMeWS9Wo= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 15 Jan 2022 18:44:34 +0200 Message-Id: <20220115164434.30763-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] test: v4l2_compat: Add --verbose argument X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a -v/--verbose argument to the v4l2_compat test to print the output of v4l2-compliance, even when the test passes. This can be useful when debugging. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Kieran Bingham --- test/v4l2_compat/v4l2_compat_test.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/v4l2_compat/v4l2_compat_test.py b/test/v4l2_compat/v4l2_compat_test.py index 29c25974c1c9..a77585fc2f49 100755 --- a/test/v4l2_compat/v4l2_compat_test.py +++ b/test/v4l2_compat/v4l2_compat_test.py @@ -65,7 +65,7 @@ def test_v4l2_compliance(v4l2_compliance, v4l2_compat, device, base_driver): result = extract_result(output[-2]) if result['failed'] == 0: - return TestPass, None + return TestPass, output # vimc will fail s_fmt because it only supports framesizes that are # multiples of 3 @@ -73,7 +73,7 @@ def test_v4l2_compliance(v4l2_compliance, v4l2_compat, device, base_driver): failures = grep('fail', output) if re.search('S_FMT cannot handle an invalid format', failures[0]) is None: return TestFail, output - return TestPass, None + return TestPass, output return TestFail, output @@ -82,6 +82,8 @@ def main(argv): parser = argparse.ArgumentParser() parser.add_argument('-a', '--all', action='store_true', help='Test all available cameras') + parser.add_argument('-v', '--verbose', action='store_true', + help='Make the output verbose') parser.add_argument('v4l2_compat', type=str, help='Path to v4l2-compat.so') args = parser.parse_args(argv[1:]) @@ -146,9 +148,12 @@ def main(argv): if ret == TestFail: failed.append(device) print('failed') - print('\n'.join(msg)) else: print('success') + + if ret == TestFail or args.verbose: + print('\n'.join(msg)) + drivers_tested[driver] = True if len(drivers_tested) == 0: