+2018-02-19 Yury Gribov <tetra2005@gmail.com>
+
+ * compare_tests: Use TMPDIR when set.
+ * dg-cmp-results.sh: Ditto.
+ * warn_summary: Ditto.
+
2018-01-29 Jonathan Wakely <jwakely@redhat.com>
* download_prerequisites: Use shasum for FreeBSD and DragonFly.
tool=gxx
-tmp1=/tmp/$tool-testing.$$a
-tmp2=/tmp/$tool-testing.$$b
-now_s=/tmp/$tool-testing.$$d
-before_s=/tmp/$tool-testing.$$e
-lst1=/tmp/$tool-lst1.$$
-lst2=/tmp/$tool-lst2.$$
-lst3=/tmp/$tool-lst3.$$
-lst4=/tmp/$tool-lst4.$$
-lst5=/tmp/$tool-lst5.$$
-sum1=/tmp/$tool-sum1.$$
-sum2=/tmp/$tool-sum2.$$
+TMPDIR=${TMPDIR:-/tmp}
+tmp1=$TMPDIR/$tool-testing.$$a
+tmp2=$TMPDIR/$tool-testing.$$b
+now_s=$TMPDIR/$tool-testing.$$d
+before_s=$TMPDIR/$tool-testing.$$e
+lst1=$TMPDIR/$tool-lst1.$$
+lst2=$TMPDIR/$tool-lst2.$$
+lst3=$TMPDIR/$tool-lst3.$$
+lst4=$TMPDIR/$tool-lst4.$$
+lst5=$TMPDIR/$tool-lst5.$$
+sum1=$TMPDIR/$tool-sum1.$$
+sum2=$TMPDIR/$tool-sum2.$$
tmps="$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5 $sum1 $sum2"
[ "$1" = "-strict" ] && strict=$1 && shift
OBASE=`basename "$2"`
NFILE="$3"
NBASE=`basename "$3"`
+TMPDIR=${TMPDIR:-/tmp}
echo "dg-cmp-results.sh: Verbosity is ${verbose}, Variant is \"${VARIANT}\""
echo
-e 's/^/O:/' \
$OFILE |
sort -s -t : -k 3b - \
- >/tmp/o$$-$OBASE
+ >$TMPDIR/o$$-$OBASE
# Create a temporary file from the new file's interesting section.
sed $E -e "/$header/,/^[[:space:]]+===.*Summary ===/!d" \
-e 's/^/N:/' \
$NFILE |
sort -s -t : -k 3b - \
- >/tmp/n$$-$NBASE
+ >$TMPDIR/n$$-$NBASE
# Merge the two files, then compare adjacent lines.
# Comparison is complicated by tests that may be run multiple times.
while (old = peek()) compare("", "")
}
EOF
-sort -m -s -t : -k 3b /tmp/o$$-$OBASE /tmp/n$$-$NBASE |
+sort -m -s -t : -k 3b $TMPDIR/o$$-$OBASE $TMPDIR/n$$-$NBASE |
awk -v verbose=$verbose -f compare-$$.awk /dev/stdin
# Delete the temporary files.
-rm -f compare-$$.awk /tmp/o$$-$OBASE /tmp/n$$-$NBASE
+rm -f compare-$$.awk $TMPDIR/o$$-$OBASE $TMPDIR/n$$-$NBASE
exit 0
usage="usage: `basename $0` [-llf] [-s stage] [-nosub|-ch|-cp|-f|-fortran|-ada|-intl|-fixinc] [-pass|-wpass] [file(s)]"
stageN=3
-tmpfile=/tmp/tmp-warn.$$
+tmpfile=${TMPDIR:-/tmp}/tmp-warn.$$
# Remove $tmpfile on exit and various signals.
trap "rm -f $tmpfile" 0