contrib: handle GDB's 'unexpected core files' count

This commit is for the benefit of GDB, but as the binutils-gdb
repository shares the contrib/ directory with gcc, this commit must
first be applied to gcc then copied back to binutils-gdb.

This commit extends the two scripts contrib/dg-extract-results.{py,sh}
to handle GDB's 'unexpected core files' count.  This test result type
should never appear in GCC, or any other tool that shares the contrib/
directory, so this change should be harmless for others.

The 'unexpected core files' count was added to GDB's results by this
series:

  https://inbox.sourceware.org/gdb-patches/20220623183053.172430-1-pedro@palves.net

this count is added to the gdb.sum file after all the tests have run,
and counts up any core.* files that have appeared.

GDB also has a make-check-all.sh script which runs a test with all the
different board files that GDB supports.  After each test is run the
'unexpected core files' count will be added to that board's results.

I'm now trying to use the dg-extract-results.* scripts to merge the
results from all the different board files, and the 'unexpected core
files' count is confusing these scripts.

contrib/ChangeLog:

	* dg-extract-results.py: Handle GDB's unexpected core file count.
	* dg-extract-results.sh: Likewise.
This commit is contained in:
Andrew Burgess
2025-06-23 16:17:19 +01:00
parent 2334d30cd8
commit 4e9104ae54
2 changed files with 8 additions and 3 deletions

View File

@@ -146,7 +146,8 @@ class Prog:
'# of unresolved testcases\t',
'# of unsupported tests\t\t',
'# of paths in test names\t',
'# of duplicate test names\t'
'# of duplicate test names\t',
'# of unexpected core files\t'
]
self.runs = dict()

View File

@@ -403,7 +403,7 @@ BEGIN {
variant="$VAR"
tool="$TOOL"
passcnt=0; failcnt=0; untstcnt=0; xpasscnt=0; xfailcnt=0; kpasscnt=0; kfailcnt=0; unsupcnt=0; unrescnt=0; dgerrorcnt=0;
pathcnt=0; dupcnt=0
pathcnt=0; dupcnt=0; corecnt=0
curvar=""; insummary=0
}
/^Running target / { curvar = \$3; next }
@@ -420,6 +420,7 @@ BEGIN {
/^# of unsupported tests/ { if (insummary == 1) unsupcnt += \$5; next; }
/^# of paths in test names/ { if (insummary == 1) pathcnt += \$7; next; }
/^# of duplicate test names/ { if (insummary == 1) dupcnt += \$6; next; }
/^# of unexpected core files/ { if (insummary == 1) corecnt += \$6; next; }
/^$/ { if (insummary == 1)
{ insummary = 0; curvar = "" }
next
@@ -439,6 +440,7 @@ END {
if (unsupcnt != 0) printf ("# of unsupported tests\t\t%d\n", unsupcnt)
if (pathcnt != 0) printf ("# of paths in test names\t%d\n", pathcnt)
if (dupcnt != 0) printf ("# of duplicate test names\t%d\n", dupcnt)
if (corecnt != 0) printf ("# of unexpected core files\t%d\n", corecnt)
}
EOF
@@ -460,7 +462,7 @@ cat << EOF > $TOTAL_AWK
BEGIN {
tool="$TOOL"
passcnt=0; failcnt=0; untstcnt=0; xpasscnt=0; xfailcnt=0; kfailcnt=0; unsupcnt=0; unrescnt=0; dgerrorcnt=0
pathcnt=0; dupcnt=0
pathcnt=0; dupcnt=0; corecnt=0
}
/^# of DejaGnu errors/ { dgerrorcnt += \$5 }
/^# of expected passes/ { passcnt += \$5 }
@@ -474,6 +476,7 @@ BEGIN {
/^# of unsupported tests/ { unsupcnt += \$5 }
/^# of paths in test names/ { pathcnt += \$7 }
/^# of duplicate test names/ { dupcnt += \$6 }
/^# of unexpected core files/ { corecnt += \$6 }
END {
printf ("\n\t\t=== %s Summary ===\n\n", tool)
if (dgerrorcnt != 0) printf ("# of DejaGnu errors\t\t%d\n", dgerrorcnt)
@@ -488,6 +491,7 @@ END {
if (unsupcnt != 0) printf ("# of unsupported tests\t\t%d\n", unsupcnt)
if (pathcnt != 0) printf ("# of paths in test names\t%d\n", pathcnt)
if (dupcnt != 0) printf ("# of duplicate test names\t%d\n", dupcnt)
if (corecnt != 0) printf ("# of unexpected core files\t%d\n", corecnt)
}
EOF