From patchwork Mon Feb 13 18:56:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Rowand X-Patchwork-Id: 56471 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2515455wrn; Mon, 13 Feb 2023 10:58:35 -0800 (PST) X-Google-Smtp-Source: AK7set8aUUnk1hfID/I4JTo89Smap8eRg/DfIv8xYifTpH5cNYs/Sjw6tYzri1Y+oxQMG3ARV0Q0 X-Received: by 2002:a17:906:f1c9:b0:88c:6345:d0e7 with SMTP id gx9-20020a170906f1c900b0088c6345d0e7mr25380756ejb.36.1676314715468; Mon, 13 Feb 2023 10:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676314715; cv=none; d=google.com; s=arc-20160816; b=DomT7NwTSqsQ8GJ9YQoW2L78puqLh1AWpcikdb7J4jESl32D0lXVIiS2ETc8odLzYF PxL4QVBIyKCjWZNh8DBVeZ1IT7BRw0IVF3Bwf3nfY2+M6kxA1T7EKxML/8NZ3Adhgk6t zYvkSChw6giiWZoUrztfWRFWU1aCJr8BQ6H7r1Qu+LTyQ0pw5Jqu3mnRFtCPBYqX1xLT oDEVSBEAWfzGtuGuHpxpPBEFrbiC62y6uKEcWk2QWCKwCoHKc+glOtTcm9kMx70DzGjC V80QZVj42x2mfBdMpQspjjO20/U0gQHsB3DUT1REYQgy4o1FdAM/xxBWsHvLaLOMtTGd rAvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nx9tTMJiSK3aN1a8Ha38HJ8pQWFwoYnzXFo+Xp9k7Yc=; b=Wbf6Es4RoDVo49zQxO8GvOomv48QkSBs7FczxKmVkzG3mCCPUMdhP34N3gC1OE7VnL EnA5vhmKr7tN7QBXjGdGD8172H+GwyxbUpV9s4LT7gqivvx5NLBOXpkTkjjQkjDNTOAx KqG5lFV/rW6gX27TfuMLcYqGZWxKhRSb0vR7GYng3gQQ4f0cnyAhQBy/xp3F3o1hzam5 AhKKXpjfK1WheANCZ21nwww8HHTGistTjYpCaOnV/8pOy/WlSQs6oZD8x3zN0IOd01A6 AzRP7DvBfkEwJJVC/EHF0GkZO2NuIkika3woljSAyF8lUNr84ywcH10FSKSIJJx9RY2M eVlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kdbR0U1u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020aa7d4c8000000b004acbe7b3479si6380424edr.653.2023.02.13.10.58.11; Mon, 13 Feb 2023 10:58:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kdbR0U1u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230208AbjBMS5s (ORCPT + 99 others); Mon, 13 Feb 2023 13:57:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbjBMS5p (ORCPT ); Mon, 13 Feb 2023 13:57:45 -0500 Received: from mail-oa1-x30.google.com (mail-oa1-x30.google.com [IPv6:2001:4860:4864:20::30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B58EC1CAFA; Mon, 13 Feb 2023 10:57:44 -0800 (PST) Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1442977d77dso16297431fac.6; Mon, 13 Feb 2023 10:57:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nx9tTMJiSK3aN1a8Ha38HJ8pQWFwoYnzXFo+Xp9k7Yc=; b=kdbR0U1uF6p9WpZYN9ndpHtdCvfkSHBZ3woLf3cQlVZh2ABRW2Zog/kv7JvC5k9MIJ y5e33kUGQk98Jwbe9Jkthe7mUM6aupcdEz4/GAvQ+UTkDs0xVLoNyCL5KAI0/T14qmih U73Zn+c1x0i7SUOfcfRsZQGhYRUSo3zwWyHWdDmHwPOXFp0Chhz3j6b27poHm+0+CNtZ uO94syer0odfNfw/L6HWcaOp3DQde+QnHtQRdtKvQnGGLqo+ZcvJOE+W8FV3RxDk5cC5 PWti4cip0uV/tvxuWMUkq2Z2SfE1HBoppSAvK8vk20SAyP404zmC/+uUn8vSsEhlNVoc t3eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nx9tTMJiSK3aN1a8Ha38HJ8pQWFwoYnzXFo+Xp9k7Yc=; b=5U3ffZ+iSX42dVFDGy4Y5Na7nPCaOWBLocjZoV4213Ehe+6HtoFZxgvX/uHvq07UlH EPaiXF4j2HfYQ7/BE/YfnkxUWu2uhuQM3bfcEkbXvYLoTqAlPFSZj9LEhZDqeNhk1+NA 0bpO2vGgjNCj4bVPhpJB0DNAvUI/QDwkE0rguQwCTc49NNdKydZ5aK5AFAhF+8WOwEbt mSvijSQE0vnIQHun9bYhtbjp1vwdJUsFi+ZB4cVcfQFP+isdVYsvJg6V0+EI+l7v/6lJ XMdMcjUT6c6jXmYoi6w3EbLpL5MM5L6qL7qtLPazUw/UNTccdixG+c/XcvBE6xsxRIma ILrA== X-Gm-Message-State: AO0yUKUrAoSf/hvLkrajMznkiGQ9kSyI5PrLWxG1xuYBuGBsw6AUPWA7 17O2UrlyZVoRi+1GFTuSrT8= X-Received: by 2002:a05:6870:8a20:b0:16e:676:bfea with SMTP id p32-20020a0568708a2000b0016e0676bfeamr2598306oaq.9.1676314664010; Mon, 13 Feb 2023 10:57:44 -0800 (PST) Received: from xps8900.attlocal.net ([2600:1700:2442:6db0:5829:dabf:a50e:e9f2]) by smtp.gmail.com with ESMTPSA id ef15-20020a0568701a8f00b0016df97ab05bsm1654958oab.31.2023.02.13.10.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 10:57:43 -0800 (PST) From: Frank Rowand To: Rob Herring Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/7] of: prepare to add processing of EXPECT_NOT to of_unittest_expect Date: Mon, 13 Feb 2023 12:56:56 -0600 Message-Id: <20230213185702.395776-2-frowand.list@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230213185702.395776-1-frowand.list@gmail.com> References: <20230213185702.395776-1-frowand.list@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757743379123887820?= X-GMAIL-MSGID: =?utf-8?q?1757743379123887820?= scripts/dtc/of_unittest_expect processes EXPECT messages that document expected kernel messages triggered by unittest. Add processing of EXPECT_NOT messages that document kernel messages triggered by unittest that are not expected. This is commit 1 of 2, renaming existing variables in anticipation of the changes needed to process EXPECT_NOT, so that commit 2 of 2 will be smaller and easier to read. This commit is not intended to make any functional changes. Signed-off-by: Frank Rowand --- scripts/dtc/of_unittest_expect | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/scripts/dtc/of_unittest_expect b/scripts/dtc/of_unittest_expect index 96b12d9ea606..7b25bb693162 100755 --- a/scripts/dtc/of_unittest_expect +++ b/scripts/dtc/of_unittest_expect @@ -9,7 +9,7 @@ # on the console log that results from executing the Linux kernel # devicetree unittest (drivers/of/unitest.c). -$VUFX = "220201a"; +$VUFX = "230121a"; use strict 'refs'; use strict subs; @@ -274,7 +274,7 @@ while ($line = ) { if ($line =~ /^\s*$exp_begin/) { $data = $line; $data =~ s/^\s*$exp_begin//; - push @begin, $data; + push @exp_begin_stack, $data; if ($verbose) { if ($print_line_num) { @@ -302,20 +302,20 @@ while ($line = ) { $found = 0; $no_begin = 0; - if (@found_or_begin > 0) { - $begin = pop @found_or_begin; + if (@exp_found_or_begin > 0) { + $begin = pop @exp_found_or_begin; if (compare($data, $begin)) { $found = 1; } } elsif (@begin > 0) { - $begin = pop @begin; + $begin = pop @exp_begin_stack; } else { $no_begin = 1; } if ($no_begin) { - $expect_missing_begin++; + $exp_missing_begin++; print "** ERROR: EXPECT end without any EXPECT begin:\n"; print " end ---> $line\n"; @@ -325,20 +325,20 @@ while ($line = ) { $line_num = sprintf("%4s ", $.); } - $expect_not_found++; + $exp_missing++; printf "** %s%s$script_name WARNING - not found ---> %s\n", $line_num, $timestamp, $data; } elsif (! compare($data, $begin)) { - $expect_missing_end++; + $exp_missing_end++; print "** ERROR: EXPECT end does not match EXPECT begin:\n"; print " begin -> $begin\n"; print " end ---> $line\n"; } else { - $expect_found++; + $exp_found++; } @@ -357,7 +357,7 @@ while ($line = ) { } $found = 0; - foreach $begin (@begin) { + foreach $begin (@exp_begin_stack) { if (compare($begin, $line)) { $found = 1; last; @@ -365,12 +365,12 @@ while ($line = ) { } if ($found) { - $begin = shift @begin; + $begin = shift @exp_begin_stack; while (! compare($begin, $line)) { - push @found_or_begin, $begin; - $begin = shift @begin; + push @exp_found_or_begin, $begin; + $begin = shift @exp_begin_stack; } - push @found_or_begin, $line; + push @exp_found_or_begin, $line; if ($hide_expect) { $suppress_line = 1; @@ -391,18 +391,18 @@ if (! $no_expect_stats) { print "\n"; print "** EXPECT statistics:\n"; print "**\n"; - printf "** EXPECT found : %4i\n", $expect_found; - printf "** EXPECT not found : %4i\n", $expect_not_found; - printf "** missing EXPECT begin : %4i\n", $expect_missing_begin; - printf "** missing EXPECT end : %4i\n", $expect_missing_end; + printf "** EXPECT found : %4i\n", $exp_found; + printf "** EXPECT not found : %4i\n", $exp_missing; + printf "** missing EXPECT begin : %4i\n", $exp_missing_begin; + printf "** missing EXPECT end : %4i\n", $exp_missing_end; printf "** unittest FAIL : %4i\n", $unittest_fail; printf "** internal error : %4i\n", $internal_err; } -if (@begin) { +if (@exp_begin_stack) { print "** ERROR: EXPECT begin without any EXPECT end:\n"; print " This list may be misleading.\n"; - foreach $begin (@begin) { + foreach $begin (@exp_begin_stack) { print " begin ---> $begin\n"; } }