Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2222490/?format=api
{ "id": 2222490, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2222490/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260412111958.943933-3-sjg@chromium.org/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260412111958.943933-3-sjg@chromium.org>", "list_archive_url": null, "date": "2026-04-12T11:19:39", "name": "[v2,02/12] test: Add a helper to check the next line against a regex", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "4b9a2109e129d6905482e8c58276424ff4e168c9", "submitter": { "id": 6170, "url": "http://patchwork.ozlabs.org/api/1.2/people/6170/?format=api", "name": "Simon Glass", "email": "sjg@chromium.org" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/1.2/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260412111958.943933-3-sjg@chromium.org/mbox/", "series": [ { "id": 499596, "url": "http://patchwork.ozlabs.org/api/1.2/series/499596/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=499596", "date": "2026-04-12T11:19:37", "name": "test: Add support for passing arguments to C unit tests", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/499596/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2222490/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2222490/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=XUl4AKGg;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=\"XUl4AKGg\";\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\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\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 4ftp8X3Tm1z1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 12 Apr 2026 21:24:12 +1000 (AEST)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 621418419E;\n\tSun, 12 Apr 2026 13:24:08 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 9EE91841A2; Sun, 12 Apr 2026 13:24:07 +0200 (CEST)", "from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com\n [IPv6:2607:f8b0:4864:20::32d])\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 6EDB484181\n for <u-boot@lists.denx.de>; Sun, 12 Apr 2026 13:24:05 +0200 (CEST)", "by mail-ot1-x32d.google.com with SMTP id\n 46e09a7af769-7d556c1a79eso4944103a34.3\n for <u-boot@lists.denx.de>; Sun, 12 Apr 2026 04:24:05 -0700 (PDT)", "from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id\n 586e51a60fabf-423dd395606sm6622071fac.1.2026.04.12.04.24.00\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 12 Apr 2026 04:24:02 -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=1775993043; x=1776597843; 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=vl3C/Ro/3cVsjKPA140+6mn8hoCVXeFEF/h8GYnjB/U=;\n b=XUl4AKGgej/J9csQgTEyW9kAP+/XhzfLpV2WXrDPLhOoHI80BpiyiFBNJYcN61Qeft\n kH5KmG9fCvlR7mgdLP1LepWiaeVDjdNJO4lM7uwtFwSMkPGQxCXjNHbi48kBwv6ogYKP\n tTLHk5thkMpwDaa7p3QOrZZs2LaTx7WCI0YGs=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775993043; x=1776597843;\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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lYeg==", "X-Received": "by 2002:a05:6820:310a:b0:685:5300:f1c2 with SMTP id\n 006d021491bc7-68be671f863mr4820037eaf.28.1775993043547;\n Sun, 12 Apr 2026 04:24:03 -0700 (PDT)", "From": "Simon Glass <sjg@chromium.org>", "To": "u-boot@lists.denx.de", "Cc": "Tom Rini <trini@konsulko.com>, Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Simon Glass <sjg@chromium.org>", "Subject": "[PATCH v2 02/12] test: Add a helper to check the next line against a\n regex", "Date": "Sun, 12 Apr 2026 05:19:39 -0600", "Message-ID": "<20260412111958.943933-3-sjg@chromium.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260412111958.943933-1-sjg@chromium.org>", "References": "<20260412111958.943933-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": "Add 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 <sjg@chromium.org>\n---\n\n(no changes since v1)\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": [ "v2", "02/12" ] }