aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-03-11 20:57:46 +0000
committerSam James <sam@gentoo.org>2024-03-12 15:49:25 +0000
commitf9b7cc0cd2a1699c5cb7d5b159c8392e6973663c (patch)
tree7af924d73ee1be91eb9d6efb2dc7ab263e490fb2 /contrib
parenta02a739070ebec5f645b2c82f421d59521c830b6 (diff)
downloadgdb-f9b7cc0cd2a1699c5cb7d5b159c8392e6973663c.zip
gdb-f9b7cc0cd2a1699c5cb7d5b159c8392e6973663c.tar.gz
gdb-f9b7cc0cd2a1699c5cb7d5b159c8392e6973663c.tar.bz2
contrib: sync dg-extract-results.sh with GCC
This syncs dg-extract-results.sh with GCC. It contains two commits: r14-4333-g346f5991569fae and r14-9393-g64273a7e6bd8ba. contrib/ChangeLog: * dg-extract-results.sh: Sync with GCC. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog1
-rwxr-xr-xcontrib/dg-extract-results.sh21
2 files changed, 13 insertions, 9 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 369bcc5..e5c54c3 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,6 +1,7 @@
2024-03-11 Sam James <sam@gentoo.org>
* dg-extract-results.py: Sync with GCC.
+ * dg-extract-results.sh: Sync with GCC.
2020-09-25 Simon Marchi <simon.marchi@polymtl.ca>
diff --git a/contrib/dg-extract-results.sh b/contrib/dg-extract-results.sh
index ff6c50d..539d596 100755
--- a/contrib/dg-extract-results.sh
+++ b/contrib/dg-extract-results.sh
@@ -6,7 +6,7 @@
# The resulting file can be used with test result comparison scripts for
# results from tests that were run in parallel. See usage() below.
-# Copyright (C) 2008, 2009, 2010, 2012 Free Software Foundation
+# Copyright (C) 2008-2024 Free Software Foundation, Inc.
# Contributed by Janis Johnson <janis187@us.ibm.com>
#
# This file is part of GCC.
@@ -28,14 +28,17 @@
PROGNAME=dg-extract-results.sh
-# Try to use the python version if possible, since it tends to be faster.
+# Try to use the python version if possible, since it tends to be faster and
+# produces more stable results.
PYTHON_VER=`echo "$0" | sed 's/sh$/py/'`
-if test "$PYTHON_VER" != "$0" &&
- test -f "$PYTHON_VER" &&
- python -c 'import sys, getopt, re, io, datetime, operator; sys.exit (0 if sys.version_info >= (2, 6) else 1)' \
- > /dev/null 2> /dev/null; then
- exec python $PYTHON_VER "$@"
-fi
+for python in python3 python python2 ; do
+ if test "$PYTHON_VER" != "$0" &&
+ test -f "$PYTHON_VER" &&
+ ${python} -c 'import sys, getopt, re, io, datetime, operator; sys.exit (0 if sys.version_info >= (2, 6) else 1)' \
+ > /dev/null 2> /dev/null; then
+ exec ${python} $PYTHON_VER "$@"
+ fi
+done
usage() {
cat <<EOF >&2
@@ -271,7 +274,7 @@ cat $SUM_FILES \
# Write the begining of the combined summary file.
-head -n 2 $FIRST_SUM
+head -n 3 $FIRST_SUM
echo
echo " === $TOOL tests ==="
echo