Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

of: prepare to add processing of EXPECT_NOT to of_unittest_expect

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 <frowand.list@gmail.com>
Link: https://lore.kernel.org/r/20230213185702.395776-2-frowand.list@gmail.com
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Frank Rowand and committed by
Rob Herring
511f3aa7 16b0c7ca

+20 -20
+20 -20
scripts/dtc/of_unittest_expect
··· 9 9 # on the console log that results from executing the Linux kernel 10 10 # devicetree unittest (drivers/of/unitest.c). 11 11 12 - $VUFX = "220201a"; 12 + $VUFX = "230121a"; 13 13 14 14 use strict 'refs'; 15 15 use strict subs; ··· 274 274 if ($line =~ /^\s*$exp_begin/) { 275 275 $data = $line; 276 276 $data =~ s/^\s*$exp_begin//; 277 - push @begin, $data; 277 + push @exp_begin_stack, $data; 278 278 279 279 if ($verbose) { 280 280 if ($print_line_num) { ··· 302 302 303 303 $found = 0; 304 304 $no_begin = 0; 305 - if (@found_or_begin > 0) { 306 - $begin = pop @found_or_begin; 305 + if (@exp_found_or_begin > 0) { 306 + $begin = pop @exp_found_or_begin; 307 307 if (compare($data, $begin)) { 308 308 $found = 1; 309 309 } 310 310 } elsif (@begin > 0) { 311 - $begin = pop @begin; 311 + $begin = pop @exp_begin_stack; 312 312 } else { 313 313 $no_begin = 1; 314 314 } 315 315 316 316 if ($no_begin) { 317 317 318 - $expect_missing_begin++; 318 + $exp_missing_begin++; 319 319 print "** ERROR: EXPECT end without any EXPECT begin:\n"; 320 320 print " end ---> $line\n"; 321 321 ··· 325 325 $line_num = sprintf("%4s ", $.); 326 326 } 327 327 328 - $expect_not_found++; 328 + $exp_missing++; 329 329 printf "** %s%s$script_name WARNING - not found ---> %s\n", 330 330 $line_num, $timestamp, $data; 331 331 332 332 } elsif (! compare($data, $begin)) { 333 333 334 - $expect_missing_end++; 334 + $exp_missing_end++; 335 335 print "** ERROR: EXPECT end does not match EXPECT begin:\n"; 336 336 print " begin -> $begin\n"; 337 337 print " end ---> $line\n"; 338 338 339 339 } else { 340 340 341 - $expect_found++; 341 + $exp_found++; 342 342 343 343 } 344 344 ··· 357 357 } 358 358 359 359 $found = 0; 360 - foreach $begin (@begin) { 360 + foreach $begin (@exp_begin_stack) { 361 361 if (compare($begin, $line)) { 362 362 $found = 1; 363 363 last; ··· 365 365 } 366 366 367 367 if ($found) { 368 - $begin = shift @begin; 368 + $begin = shift @exp_begin_stack; 369 369 while (! compare($begin, $line)) { 370 - push @found_or_begin, $begin; 371 - $begin = shift @begin; 370 + push @exp_found_or_begin, $begin; 371 + $begin = shift @exp_begin_stack; 372 372 } 373 - push @found_or_begin, $line; 373 + push @exp_found_or_begin, $line; 374 374 375 375 if ($hide_expect) { 376 376 $suppress_line = 1; ··· 391 391 print "\n"; 392 392 print "** EXPECT statistics:\n"; 393 393 print "**\n"; 394 - printf "** EXPECT found : %4i\n", $expect_found; 395 - printf "** EXPECT not found : %4i\n", $expect_not_found; 396 - printf "** missing EXPECT begin : %4i\n", $expect_missing_begin; 397 - printf "** missing EXPECT end : %4i\n", $expect_missing_end; 394 + printf "** EXPECT found : %4i\n", $exp_found; 395 + printf "** EXPECT not found : %4i\n", $exp_missing; 396 + printf "** missing EXPECT begin : %4i\n", $exp_missing_begin; 397 + printf "** missing EXPECT end : %4i\n", $exp_missing_end; 398 398 printf "** unittest FAIL : %4i\n", $unittest_fail; 399 399 printf "** internal error : %4i\n", $internal_err; 400 400 } 401 401 402 - if (@begin) { 402 + if (@exp_begin_stack) { 403 403 print "** ERROR: EXPECT begin without any EXPECT end:\n"; 404 404 print " This list may be misleading.\n"; 405 - foreach $begin (@begin) { 405 + foreach $begin (@exp_begin_stack) { 406 406 print " begin ---> $begin\n"; 407 407 } 408 408 }