From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9740CC83F1B for ; Thu, 17 Jul 2025 08:49:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E90A28D0012; Thu, 17 Jul 2025 04:49:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DCC4F8D0010; Thu, 17 Jul 2025 04:49:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C459E8D0011; Thu, 17 Jul 2025 04:49:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A2DC38D0010 for ; Thu, 17 Jul 2025 04:49:01 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2D101160562 for ; Thu, 17 Jul 2025 08:49:01 +0000 (UTC) X-FDA: 83673131682.02.A6E13BF Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf12.hostedemail.com (Postfix) with ESMTP id 45E6540002 for ; Thu, 17 Jul 2025 08:48:59 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=Og6qufiN; dkim=pass header.d=linutronix.de header.s=2020e header.b=YeWwTP1h; spf=pass (imf12.hostedemail.com: domain of t-8ch@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=t-8ch@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1752742139; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HGd8ubbWunkfJYLzTiQIqN4TppaArb7LyPstVl7gkvQ=; b=NmyfgJWLi/yNp3hroVKy769r5HErfMPoHleaWXBm6+2ai2m1snuv1Euf7N9wmynCtcKSLa AZ1RczmZ8XwLlpbxFqU4OAv8XdEdDZEf68ZHP/hTHJ+gX8Sw+WtkjHObAnZuuWjVJMHfUN h9uIDiDkvxliIQCNIpEP9XWMTTkBNMU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1752742139; a=rsa-sha256; cv=none; b=ralnOGBYzb9HvyGsX3aufv2w4wdhEx68l8Timz2wnnh0EJIZLvg3jXuMJcuFWuoNdQLpEC BXs41Zb2eLN4TYYoyDiUxHvp8SuASKXkeyz815iCB340iqNI3IEiN5sC4gC7VmmJjCu0vO sQ2YsggayZPsw/ctniG8GloXKyeb6Vg= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=Og6qufiN; dkim=pass header.d=linutronix.de header.s=2020e header.b=YeWwTP1h; spf=pass (imf12.hostedemail.com: domain of t-8ch@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=t-8ch@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752742137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HGd8ubbWunkfJYLzTiQIqN4TppaArb7LyPstVl7gkvQ=; b=Og6qufiNQGQTQ57NkCHKoAAm7powCJgw7/RWO2qGF/jlRkLSrtw6iDwzo1vFuCIIijprke q0p5sJrXCLfKMmRDpYJDkQe/vCAAvfE/2Jiw/pf2g5NComZY0tnnhoXAJruDo246m0vcje XYQrXubbI9mIqvGpNrqCEENSMoAfFuO1iZ24o9GRVesA75TnCHM7J8r8bBazzX3G92ApYy bYrT1owphkLuKVLDI0OMlkrhXyTpNjPBieMANT95fRTsEI+k5e1lL/V1WSWgkg43WLlWDX M5OeZGEcM++g/Q+/F7AJ2/ZjtBejS5aSB0jLRDENJKPkOWiyonO3OsYeD1lOHQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752742137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HGd8ubbWunkfJYLzTiQIqN4TppaArb7LyPstVl7gkvQ=; b=YeWwTP1h32iVhGidFWcm+PUWWjNidVPw2Cr1BbPavgIbdVuqStheDJKKB3UdfkblaqVOh8 v9i3kGjHnBZUNHCw== Date: Thu, 17 Jul 2025 10:48:11 +0200 Subject: [PATCH v5 09/15] kunit: tool: Parse skipped tests from kselftest.h MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20250717-kunit-kselftests-v5-9-442b711cde2e@linutronix.de> References: <20250717-kunit-kselftests-v5-0-442b711cde2e@linutronix.de> In-Reply-To: <20250717-kunit-kselftests-v5-0-442b711cde2e@linutronix.de> To: Masahiro Yamada , Nathan Chancellor , Andrew Morton , Willy Tarreau , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Brendan Higgins , David Gow , Rae Moar , Shuah Khan , Jonathan Corbet , Nicolas Schier , Kees Cook , Alexander Viro , Christian Brauner , Jan Kara , Christoph Hellwig , Luis Chamberlain Cc: Christophe Leroy , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, workflows@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Nicolas Schier X-Developer-Signature: v=1; a=ed25519-sha256; t=1752742130; l=2829; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=nqksscqfXqyzTU4syNyfSYS0rZFgGTiiZdVYjcMKiOU=; b=Zq1mrbjSt+Zlq8ZjnVSL9Jo84/acvktNqayzm+LN1XPYXkxZ3xwwYilhJUXi7lj0rBygEeyvS W75qBTLoW7+CefyuYY2haaSY20fRRc00PlYkDHUKhWcMuAA+xgTM75/ X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 45E6540002 X-Stat-Signature: rt1mfxc4fofo3tghop6gopk4ni4h8pqx X-Rspam-User: X-HE-Tag: 1752742139-441789 X-HE-Meta: U2FsdGVkX1+oZ8impGm6SHPZCfjEaQgWO/jaAluqQJdOX/JAp05IKHaKGkqOVcINczH6Po24FGbtIxtPdLoBQOeQ3zWPL/JgVdbf+zr5wEhxEKv99xFF1eMfVM3qIvuhvLJkbM/8UQCPRpOcjU4TwCrOlrkgmAnF0aWyEatM5EzuFq2iSlLA65IK5Wr3SB0KsIv3LEYco+m0hLQJYHHo3Qz+LhHuAe1FcrMd3NfYM0p2kuXWJ7DMJ+PKZ6H45zyDDI3cV9FXVK4fRU90plGyJDjCks/LpStbd6ninnG/EhNqWOcmr6O3F9HtQMsITXomNz+/WwSYi2Wue4QyMAyF7Et62CH1MTj24t37kLe9cxe8OQPd+Z04ybCoUzIRFkLtnuoQZ8VokEFOoEElM1cUj1sd7yY284tuoUIw83dOJ7JIT6USxhHpKHiSj2oks+CuyyyyQPpKoBpJz+ppHRR1MHw/cH/ur/Pt6F3luclrK/YnTMLgq3ZZdKXlTsFAu52jg7xaR9pkihoVltcbByY85vw9TtcAmYb5wrj1TiBXmQgXN9Trj+iV6fqxtemG5+LhFn88o3v3WpWe80AIJZHY09e/3QZCasEWrJiE/FbGZqNAnEHPxXbSwbYjEogKMBiFaZGSDilXhpDkxGhSg9zKaBZXX4RQm4EfGQZO9WwFXJ5ZFNoHqS8ihXx0w2cD3Qqms0AvwpzAeqarbPj7GDlnGJf0zCJo11wtIQAMJWmxVYacA3CaLpwS55P6nBhqBeLLeKjYpcNsaZnOnqNZeKs3Hs/QpuT6hbtGn6o7KOSTewutkyDXQ26WDcsrV7F+9GzTqw3jkqFAN1MMRGUwLqovFTNBixvIzm1vT0xRvNJ3nBQpf1AZpX6DxN6oP4wNoprLDrf05LXXHH6y84boxobCK85KduLeWVm8sUGvgmVUFBYeEH7U6/ncNL1dX0BSb4peF/vwxFMAELqm7ZLzYOA Ah6lCDhu ElV0R9Nj8+4qt0lAJ/NVk96kMpuoo4S9o6PcG4QW8mbvGAxnaIFD3eAWwhxvjZEpD46J0+ICdK9ytMnKv+Vm9x1rLqW2H7F4zsOFv6LVO7xPphJURQ/dP/1pbHGhD+mbcU6sj+DDwfk/ANUzfEyXbjDVBpGetDT+OMC3wHEOD+Wv0juq5g12X3gOvd2UMHjRdNFYUnoLoXGOo4YSP9UbWYowZyCAmwvFYlaruru1yMfZI9EnCRY2OrMdo+IzWyguTRDsPvRErNiFU1b/sHaDWpzg49y907HZhS85FYByHDvNDVrVaAUYsrxrqD4WJV9WggXarmJrjvV8GaexiL4NEE7q8SHN6eoaka4vLu+rqmev0rf4KHE/Z7TVFVcxU/U/XgsiIXUg5YllkDH2NM01QPQb12Q3EW3ooV7TBZ/iiOO81qoGkHP+IBoX0FJbs8qONrtwdqLUYfxJTgOr4gINBYVoZ9u27USPJzJ7fyg1S8jOg5KCSUDyCoibE1w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Skipped tests reported by kselftest.h use a different format than KTAP, there is no explicit test name. Normally the test name is part of the free-form string after the SKIP keyword: ok 3 # SKIP test: some reason Extend the parser to handle those correctly. Use the free-form string as test name instead. Signed-off-by: Thomas Weißschuh Reviewed-by: David Gow --- tools/testing/kunit/kunit_parser.py | 8 +++++--- tools/testing/kunit/test_data/test_is_test_passed-kselftest.log | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/testing/kunit/kunit_parser.py b/tools/testing/kunit/kunit_parser.py index a7a61e627e348db14b953080ec8789994fba955a..5338489dcbe48c01912c5e8f02a481d6860a5d15 100644 --- a/tools/testing/kunit/kunit_parser.py +++ b/tools/testing/kunit/kunit_parser.py @@ -352,9 +352,9 @@ def parse_test_plan(lines: LineStream, test: Test) -> bool: lines.pop() return True -TEST_RESULT = re.compile(r'^\s*(ok|not ok) ([0-9]+) (- )?([^#]*)( # .*)?$') +TEST_RESULT = re.compile(r'^\s*(ok|not ok) ([0-9]+) ?(- )?([^#]*)( # .*)?$') -TEST_RESULT_SKIP = re.compile(r'^\s*(ok|not ok) ([0-9]+) (- )?(.*) # SKIP(.*)$') +TEST_RESULT_SKIP = re.compile(r'^\s*(ok|not ok) ([0-9]+) ?(- )?(.*) # SKIP ?(.*)$') def peek_test_name_match(lines: LineStream, test: Test) -> bool: """ @@ -379,6 +379,8 @@ def peek_test_name_match(lines: LineStream, test: Test) -> bool: if not match: return False name = match.group(4) + if not name: + return False return name == test.name def parse_test_result(lines: LineStream, test: Test, @@ -416,7 +418,7 @@ def parse_test_result(lines: LineStream, test: Test, # Set name of test object if skip_match: - test.name = skip_match.group(4) + test.name = skip_match.group(4) or skip_match.group(5) else: test.name = match.group(4) diff --git a/tools/testing/kunit/test_data/test_is_test_passed-kselftest.log b/tools/testing/kunit/test_data/test_is_test_passed-kselftest.log index 65d3f27feaf22a3f47ed831c4c24f6f11c625a92..30d9ef18bcec177067288d5242771236f29b7d56 100644 --- a/tools/testing/kunit/test_data/test_is_test_passed-kselftest.log +++ b/tools/testing/kunit/test_data/test_is_test_passed-kselftest.log @@ -1,5 +1,5 @@ TAP version 13 -1..2 +1..3 # selftests: membarrier: membarrier_test_single_thread # TAP version 13 # 1..2 @@ -12,3 +12,4 @@ ok 1 selftests: membarrier: membarrier_test_single_thread # ok 1 sys_membarrier available # ok 2 sys membarrier invalid command test: command = -1, flags = 0, errno = 22. Failed as expected ok 2 selftests: membarrier: membarrier_test_multi_thread +ok 3 # SKIP selftests: membarrier: membarrier_test_multi_thread -- 2.50.0