aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2023-12-20 02:31:57 -0300
committerAlexandre Oliva <oliva@gnu.org>2023-12-21 01:02:41 -0300
commit586e32583a0cdba9ecc6bc914bd12465c0280c22 (patch)
treef58d6a990b22fe93a825330f9ea0dc107718e8c9 /contrib
parentef259ebeb39501bfddcc7c203a9a7a0daefa8ffd (diff)
compare_tests: distinguish c-c++-common results by tool
When compare_tests compares both C and C++ tests in c-c++-common, they get the same identifier, so expected differences in results across languages become undesirably noisy. This patch adds tool identifiers to tests, so that runs by different tools are not confused by the compare logic. It also fixes a bug in reporting differences, that would attempt to print an undefined fname (the definitions are in subshell loops), and adjusts the target insertion to match tabs in addition to blanks after colons. for contrib/ChangeLog * compare_tests: Add tool to test lines. Match tabs besides blanks to insert tool and target. Don't print undefined fname.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/compare_tests6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/compare_tests b/contrib/compare_tests
index 2dfa8640756..e09fc4f113a 100755
--- a/contrib/compare_tests
+++ b/contrib/compare_tests
@@ -96,7 +96,7 @@ if [ -d "$1" -a -d "$2" ] ; then
ret=$?
if [ $ret -ne 0 ]; then
exit_status=`expr $exit_status + 1`
- echo "## Differences found: $fname"
+ echo "## Differences found"
fi
if [ $exit_status -ne 0 ]; then
echo "# $exit_status differences in $cmnsums common sum files found"
@@ -108,8 +108,8 @@ elif [ -d "$1" -o -d "$2" ] ; then
usage "Must specify either two directories or two files"
fi
-sed 's/^XFAIL/FAIL/; s/^ERROR/FAIL/; s/^XPASS/PASS/' < "$1" | awk '/^Running target / {target = $3} { if (target != "unix") { sub(/: /, "&"target": " ); }; print $0; }' | cut -c1-2000 >$tmp1
-sed 's/^XFAIL/FAIL/; s/^ERROR/FAIL/; s/^XPASS/PASS/' < "$2" | awk '/^Running target / {target = $3} { if (target != "unix") { sub(/: /, "&"target": " ); }; print $0; }' | cut -c1-2000 >$tmp2
+sed 's/^XFAIL/FAIL/; s/^ERROR/FAIL/; s/^XPASS/PASS/' < "$1" | awk '/^[ ]*=== [^ ]* tests ===$/ {tool = $2} /^Running target / {target = $3} { if (tool != "") { sub(/:[ ]/, "&"tool": " ); }; if (target != "unix") { sub(/:[ ]/, "&"target": " ); }; print $0; }' | cut -c1-2000 >$tmp1
+sed 's/^XFAIL/FAIL/; s/^ERROR/FAIL/; s/^XPASS/PASS/' < "$2" | awk '/^[ ]*=== [^ ]* tests ===$/ {tool = $2} /^Running target / {target = $3} { if (tool != "") { sub(/:[ ]/, "&"tool": " ); }; if (target != "unix") { sub(/:[ ]/, "&"target": " ); }; print $0; }' | cut -c1-2000 >$tmp2
before=$tmp1
now=$tmp2