Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2222456/?format=api
{ "id": 2222456, "url": "http://patchwork.ozlabs.org/api/patches/2222456/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260412013451.2929001-3-sjg@chromium.org/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260412013451.2929001-3-sjg@chromium.org>", "list_archive_url": null, "date": "2026-04-12T01:34:30", "name": "[02/12] test: Add a helper to check the next line against a regex", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "4b9a2109e129d6905482e8c58276424ff4e168c9", "submitter": { "id": 6170, "url": "http://patchwork.ozlabs.org/api/people/6170/?format=api", "name": "Simon Glass", "email": "sjg@chromium.org" }, "delegate": { "id": 3184, "url": "http://patchwork.ozlabs.org/api/users/3184/?format=api", "username": "sjg", "first_name": "Simon", "last_name": "Glass", "email": "sjg@chromium.org" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260412013451.2929001-3-sjg@chromium.org/mbox/", "series": [ { "id": 499582, "url": "http://patchwork.ozlabs.org/api/series/499582/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=499582", "date": "2026-04-12T01:34:28", "name": "test: Add support for passing arguments to C unit tests", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499582/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2222456/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2222456/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=MqqgegJH;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org\n header.b=\"MqqgegJH\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org" ], "Received": [ "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4ftY5B69fNz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 12 Apr 2026 11:35:26 +1000 (AEST)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 2D98084201;\n\tSun, 12 Apr 2026 03:35:15 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id E15EB841CD; Sun, 12 Apr 2026 03:35:13 +0200 (CEST)", "from mail-ot1-x336.google.com (mail-ot1-x336.google.com\n [IPv6:2607:f8b0:4864:20::336])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id D68DE839D9\n for <u-boot@lists.denx.de>; Sun, 12 Apr 2026 03:35:10 +0200 (CEST)", "by mail-ot1-x336.google.com with SMTP id\n 46e09a7af769-7dbd08144deso2981304a34.0\n for <u-boot@lists.denx.de>; Sat, 11 Apr 2026 18:35:10 -0700 (PDT)", "from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id\n 46e09a7af769-7dc2d1aca3asm4242826a34.6.2026.04.11.18.35.04\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sat, 11 Apr 2026 18:35:05 -0700 (PDT)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=chromium.org; s=google; t=1775957707; x=1776562507; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=TaVAJCUw+eVY0YvFCdEVevvvhEsssQ8uhhWPDp87rRA=;\n b=MqqgegJHHqQ9wwqlkQo64Bz9arUUKb+m+mKnVlYqWJAvhfM+E9acdksi8DE+yBn+6g\n 6sdwzNTmrp7uzh9Zsa243PZS5iQTD2LqLrLQFz8PH56bfEN9c7TlLURuN3qROL3niWtF\n MR2aW8Wf41KWvu7BK2c1RK4YEyx6KIrUy2Chg=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775957707; x=1776562507;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=TaVAJCUw+eVY0YvFCdEVevvvhEsssQ8uhhWPDp87rRA=;\n b=iGNmHr84aVSN7o0Vij6jfmCjlksA1owk9JlYPs939MmxIN+ZhXpaORneWCso5Nr1up\n 5ELE3L6HUGtJNG0MUbKfeZ5XDvDX59zzQ2US5ymkyrK8wiylnCptArASceR3mR7g6/3A\n uVvQnEPTgkwtfX/NDiaGJ12v6cMvZU1BfkJm9PFFfbzJ6GlbVyjjFjH+F5aFIavUhR2W\n BkuVGeCleG0J9DOZmQB/8YQJ16InDmPmOKIiORRMXmfifamNhgxAXzvTwh+Ut9/VYomW\n Lu3HtQtpiAVCCSbDr9qADm3Un+3uBcsuC/Do2IccQVQOLnyWqUWronf2IapHupC6IdFx\n ewDg==", "X-Gm-Message-State": "AOJu0YzqBe5g8UZVEKzOatFuLGMvnoE9MkYfF/yr5tSheMvApdXZ3HYT\n AbPNckaacpXpd4l1y8YMT3m0c6l53LQe9f/crFfNUo+yWOP8Pi8C1FxKAmi8Y5i/eEl9BE/1bt1\n R9ReyTg==", "X-Gm-Gg": "AeBDieu4EcpYb0bkYlKj9dbx9t2mzd4SZsNWK4QM5GIivD8081ASl9TBab0KatQ6hnf\n QQ51AgkpSBt5ojBtdK5IARt4jzHbLNkVZlkcCpp1XP5QlJYK68IZrZpIMNjeqJstKEtDHGoFtJL\n dh/7aKvu0UYW43lW7kxHXpxkdjGlrfUvP/oTj9Qy0LAWqL1weBpz/WmMIo4YOOBIIbqLDVYCokB\n cGoVfCVsXGpQeFwIT2oI4Q3GT2GXD8S03dirYJjF/dFARsCk8FZFKIy8BXzPA9bLMwuwOk7/qx3\n LFCOa494//eDZV2xdWKJeTNo4D8dyWdiIAgbJSPLydleBI1yJsib02Vk8WGcXCB72i3qroUwD1c\n YdfQHtb3aYnSRxTflt4ci+haavj42hYhRNTmvgIj0q7CtflT7DMz9Nvzt1AHJYzbmjfrkItKM8L\n QCf/bRA1iD5c82AJ1T5g==", "X-Received": "by 2002:a05:6830:6f4a:b0:7d7:dcb1:1e6c with SMTP id\n 46e09a7af769-7dc27c99044mr5439057a34.7.1775957707152;\n Sat, 11 Apr 2026 18:35:07 -0700 (PDT)", "From": "Simon Glass <sjg@chromium.org>", "To": "u-boot@lists.denx.de", "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>, Tom Rini <trini@konsulko.com>,\n Simon Glass <simon.glass@canonical.com>, Simon Glass <sjg@chromium.org>", "Subject": "[PATCH 02/12] test: Add a helper to check the next line against a\n regex", "Date": "Sat, 11 Apr 2026 19:34:30 -0600", "Message-ID": "<20260412013451.2929001-3-sjg@chromium.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260412013451.2929001-1-sjg@chromium.org>", "References": "<20260412013451.2929001-1-sjg@chromium.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.39", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "From: Simon Glass <simon.glass@canonical.com>\n\nAdd a new ut_assert_nextline_regex() macro and\nut_check_console_line_regex() helper to check console output against a\nregex pattern. This is useful when the exact output varies (e.g., file\npaths or line numbers in error messages).\n\nSigned-off-by: Simon Glass <simon.glass@canonical.com>\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\n include/test/ut.h | 33 +++++++++++++++++++++++++++++----\n test/ut.c | 21 +++++++++++++++++++++\n 2 files changed, 50 insertions(+), 4 deletions(-)", "diff": "diff --git a/include/test/ut.h b/include/test/ut.h\nindex cda15f3a7a9..8f0e69a7734 100644\n--- a/include/test/ut.h\n+++ b/include/test/ut.h\n@@ -87,6 +87,20 @@ int ut_check_console_line(struct unit_test_state *uts, const char *fmt, ...)\n int ut_check_console_linen(struct unit_test_state *uts, const char *fmt, ...)\n \t\t\t__attribute__ ((format (__printf__, 2, 3)));\n \n+/**\n+ * ut_check_console_line_regex() - Check the next console line against a regex\n+ *\n+ * This checks the next line of console output against a regex pattern.\n+ *\n+ * After the function returns, uts->expect_str holds the regex pattern and\n+ * uts->actual_str holds the actual string read from the console.\n+ *\n+ * @uts: Test state\n+ * @regex: Regular expression pattern to match against\n+ * Return: 0 if OK, other value on error\n+ */\n+int ut_check_console_line_regex(struct unit_test_state *uts, const char *regex);\n+\n /**\n * ut_check_skipline() - Check that the next console line exists and skip it\n *\n@@ -451,10 +465,21 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);\n \t__ret;\t\t\t\t\t\t\t\t\\\n })\n \n-/**\n- * ut_assert_skipline() - Assert that there is a 'next' console output line,\n- *\t\t\t and skip it\n- */\n+/* Assert that the next console output line matches a regex pattern */\n+#define ut_assert_nextline_regex(pattern) ({\t\t\t\t\\\n+\tint __ret = 0;\t\t\t\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\tif (ut_check_console_line_regex(uts, pattern)) {\t\t\\\n+\t\tut_failf(uts, __FILE__, __LINE__, __func__,\t\t\\\n+\t\t\t \"console regex\",\t\t\t\t\\\n+\t\t\t \"\\nExpected regex '%s',\\n got '%s'\",\t\\\n+\t\t\t uts->expect_str, uts->actual_str);\t\t\\\n+\t\treturn CMD_RET_FAILURE;\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\t\\\n+\t__ret;\t\t\t\t\t\t\t\t\\\n+})\n+\n+/* Assert that there is a 'next' console output line, and skip it */\n #define ut_assert_skipline() ({\t\t\t\t\t\t\\\n \tint __ret = 0;\t\t\t\t\t\t\t\\\n \t\t\t\t\t\t\t\t\t\\\ndiff --git a/test/ut.c b/test/ut.c\nindex b4f2a8bf40f..b0cc0f3e8ff 100644\n--- a/test/ut.c\n+++ b/test/ut.c\n@@ -139,6 +139,27 @@ int ut_check_console_linen(struct unit_test_state *uts, const char *fmt, ...)\n \t\t strlen(uts->expect_str));\n }\n \n+int ut_check_console_line_regex(struct unit_test_state *uts, const char *regex)\n+{\n+\tchar err[UT_REGEX_ERR_SIZE];\n+\tint len;\n+\tint ret;\n+\n+\tlen = strlcpy(uts->expect_str, regex, sizeof(uts->expect_str));\n+\tif (len >= sizeof(uts->expect_str)) {\n+\t\tut_fail(uts, __FILE__, __LINE__, __func__,\n+\t\t\t\"unit_test_state->expect_str too small\");\n+\t\treturn -EOVERFLOW;\n+\t}\n+\tret = readline_check(uts);\n+\tif (ret == -ENOENT)\n+\t\treturn 1;\n+\n+\tret = ut_check_regex(regex, uts->actual_str, err);\n+\n+\treturn ret;\n+}\n+\n int ut_check_skipline(struct unit_test_state *uts)\n {\n \tint ret;\n", "prefixes": [ "02/12" ] }