OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [contrib/] [dg-extract-results.sh] - Diff between revs 816 and 826

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 816 Rev 826
#! /bin/sh
#! /bin/sh
 
 
# For a specified tool and optional list of test variants, extract
# For a specified tool and optional list of test variants, extract
# test results from one or more test summary (.sum) files and combine
# test results from one or more test summary (.sum) files and combine
# the results into a new test summary file, sent to the standard output.
# the results into a new test summary file, sent to the standard output.
# The resulting file can be used with test result comparison scripts for
# The resulting file can be used with test result comparison scripts for
# results from tests that were run in parallel.  See usage() below.
# results from tests that were run in parallel.  See usage() below.
 
 
# Copyright (C) 2008, 2009, 2010 Free Software Foundation
# Copyright (C) 2008, 2009, 2010 Free Software Foundation
# Contributed by Janis Johnson <janis187@us.ibm.com>
# Contributed by Janis Johnson <janis187@us.ibm.com>
#
#
# This file is part of GCC.
# This file is part of GCC.
#
#
# GCC is free software; you can redistribute it and/or modify
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# any later version.
#
#
# GCC is distributed in the hope that it will be useful,
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING.  If not, write to
# along with GCC; see the file COPYING.  If not, write to
# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
# Boston, MA 02110-1301, USA.
 
 
PROGNAME=dg-extract-results.sh
PROGNAME=dg-extract-results.sh
 
 
usage() {
usage() {
  cat <<EOF >&2
  cat <<EOF >&2
Usage: $PROGNAME [-t tool] [-l variant-list] [-L] sum-file ...
Usage: $PROGNAME [-t tool] [-l variant-list] [-L] sum-file ...
 
 
    tool           The tool (e.g. g++, libffi) for which to create a
    tool           The tool (e.g. g++, libffi) for which to create a
                   new test summary file.  If not specified then all
                   new test summary file.  If not specified then all
                   specified sum files must be for the same tool.
                   specified sum files must be for the same tool.
    variant-list   One or more test variant names.  If the list is
    variant-list   One or more test variant names.  If the list is
                   not specified then one is constructed from all
                   not specified then one is constructed from all
                   variants in the files for <tool>.
                   variants in the files for <tool>.
    sum-file       A test summary file with the format of those
    sum-file       A test summary file with the format of those
                   created by runtest from DejaGnu.
                   created by runtest from DejaGnu.
    If -L is used, merge *.log files instead of *.sum.  In this
    If -L is used, merge *.log files instead of *.sum.  In this
    mode the exact order of lines may not be preserved, just different
    mode the exact order of lines may not be preserved, just different
    Running *.exp chunks should be in correct order.
    Running *.exp chunks should be in correct order.
EOF
EOF
}
}
 
 
# Write a message to the standard error.
# Write a message to the standard error.
 
 
msg() {
msg() {
  echo "$@" >&2
  echo "$@" >&2
}
}
 
 
# Parse the command-line options.
# Parse the command-line options.
 
 
VARIANTS=""
VARIANTS=""
TOOL=""
TOOL=""
MODE="sum"
MODE="sum"
 
 
while getopts "l:t:L" ARG; do
while getopts "l:t:L" ARG; do
  case $ARG in
  case $ARG in
  l)  VARIANTS="${VARIANTS} ${OPTARG}";;
  l)  VARIANTS="${VARIANTS} ${OPTARG}";;
  t)  test -z "$TOOL" || (msg "${PROGNAME}: only one tool can be specified"; exit 1);
  t)  test -z "$TOOL" || (msg "${PROGNAME}: only one tool can be specified"; exit 1);
      TOOL="${OPTARG}";;
      TOOL="${OPTARG}";;
  L)  MODE="log";;
  L)  MODE="log";;
  \?) usage; exit 0;;
  \?) usage; exit 0;;
  esac
  esac
done
done
shift `expr ${OPTIND} - 1`
shift `expr ${OPTIND} - 1`
 
 
if test $# -lt 1 ; then
if test $# -lt 1 ; then
  usage
  usage
  exit 1
  exit 1
fi
fi
 
 
TMPDIR=${TMPDIR-/tmp}
TMPDIR=${TMPDIR-/tmp}
SUM_FILES="$@"
SUM_FILES="$@"
FIRST_SUM=$1
FIRST_SUM=$1
TMP=
TMP=
trap 'EXIT_STATUS=$?; rm -rf $TMP && exit $EXIT_STATUS' 0
trap 'EXIT_STATUS=$?; rm -rf $TMP && exit $EXIT_STATUS' 0
# Create a (secure) tmp directory for tmp files.
# Create a (secure) tmp directory for tmp files.
{
{
  TMP=`(umask 077 && mktemp -d -q "${TMPDIR}/dg-combine-results-$$-XXXXXX") 2>/dev/null` &&
  TMP=`(umask 077 && mktemp -d -q "${TMPDIR}/dg-combine-results-$$-XXXXXX") 2>/dev/null` &&
  test -n "$TMP" && test -d "$TMP"
  test -n "$TMP" && test -d "$TMP"
} ||
} ||
{
{
  TMP=${TMPDIR}/dg-combine-results-$$-$RANDOM
  TMP=${TMPDIR}/dg-combine-results-$$-$RANDOM
  (umask 077 && mkdir $TMP)
  (umask 077 && mkdir $TMP)
} ||
} ||
{
{
  msg "${PROGNAME}: cannot create a temporary directory"
  msg "${PROGNAME}: cannot create a temporary directory"
  { (exit 1); exit 1; }
  { (exit 1); exit 1; }
}
}
 
 
# Find a good awk.
# Find a good awk.
 
 
if test -z "$AWK" ; then
if test -z "$AWK" ; then
  for AWK in gawk nawk awk
  for AWK in gawk nawk awk
  do
  do
    if type $AWK 2>&1 | grep 'not found' > /dev/null 2>&1 ; then
    if type $AWK 2>&1 | grep 'not found' > /dev/null 2>&1 ; then
      :
      :
    else
    else
      break
      break
    fi
    fi
  done
  done
fi
fi
 
 
# Verify that the specified summary files exist.
# Verify that the specified summary files exist.
 
 
ERROR=0
ERROR=0
for FILE in $SUM_FILES
for FILE in $SUM_FILES
do
do
  if ! test -f $FILE ; then
  if ! test -f $FILE ; then
    msg "${PROGNAME}: file $FILE does not exist."
    msg "${PROGNAME}: file $FILE does not exist."
    ERROR=1
    ERROR=1
  fi
  fi
done
done
test $ERROR -eq 0 || exit 1
test $ERROR -eq 0 || exit 1
 
 
if [ -z "$TOOL" ]; then
if [ -z "$TOOL" ]; then
  # If no tool was specified, all specified summary files must be for
  # If no tool was specified, all specified summary files must be for
  # the same tool.
  # the same tool.
 
 
  CNT=`grep '=== .* tests ===' $SUM_FILES | $AWK '{ print $3 }' | sort -u | wc -l`
  CNT=`grep '=== .* tests ===' $SUM_FILES | $AWK '{ print $3 }' | sort -u | wc -l`
  if [ $CNT -eq 1 ]; then
  if [ $CNT -eq 1 ]; then
    TOOL=`grep '=== .* tests ===' $FIRST_SUM | $AWK '{ print $2 }'`
    TOOL=`grep '=== .* tests ===' $FIRST_SUM | $AWK '{ print $2 }'`
  else
  else
    msg "${PROGNAME}: sum files are for multiple tools, specify a tool"
    msg "${PROGNAME}: sum files are for multiple tools, specify a tool"
    msg ""
    msg ""
    usage
    usage
    exit 1
    exit 1
  fi
  fi
else
else
  # Ignore the specified summary files that are not for this tool.  This
  # Ignore the specified summary files that are not for this tool.  This
  # should keep the relevant files in the same order.
  # should keep the relevant files in the same order.
 
 
  SUM_FILES=`grep -l "=== $TOOL" $SUM_FILES`
  SUM_FILES=`grep -l "=== $TOOL" $SUM_FILES`
  if test -z "$SUM_FILES" ; then
  if test -z "$SUM_FILES" ; then
    msg "${PROGNAME}: none of the specified files are results for $TOOL"
    msg "${PROGNAME}: none of the specified files are results for $TOOL"
    exit 1
    exit 1
  fi
  fi
fi
fi
 
 
if [ "$TOOL" = acats ]; then
if [ "$TOOL" = acats ]; then
  # Acats *.sum or *.log files aren't dejagnu generated, and they have
  # Acats *.sum or *.log files aren't dejagnu generated, and they have
  # somewhat different format.
  # somewhat different format.
  ACATS_AWK=${TMP}/acats.awk
  ACATS_AWK=${TMP}/acats.awk
  cat <<EOF > $ACATS_AWK
  cat <<EOF > $ACATS_AWK
BEGIN {
BEGIN {
  print_prologue=1; curfile=""; insummary=0
  print_prologue=1; curfile=""; insummary=0
  passcnt=0; failcnt=0; unsupcnt=0; failures=""
  passcnt=0; failcnt=0; unsupcnt=0; failures=""
}
}
/^[ \t]*=== acats configuration ===/ {
/^[ \t]*=== acats configuration ===/ {
  insummary=0
  insummary=0
  if (print_prologue) print
  if (print_prologue) print
  next
  next
}
}
/^[ \t]*=== acats tests ===/ {
/^[ \t]*=== acats tests ===/ {
  if (print_prologue) print
  if (print_prologue) print
  print_prologue=0
  print_prologue=0
  next
  next
}
}
/^Running chapter / {
/^Running chapter / {
  if (curfile) close (curfile)
  if (curfile) close (curfile)
  curfile="${TMP}/chapter-"\$3
  curfile="${TMP}/chapter-"\$3
  print >> curfile
  print >> curfile
  next
  next
}
}
/^[ \t]*=== acats Summary ===/ {
/^[ \t]*=== acats Summary ===/ {
  if (curfile) close (curfile)
  if (curfile) close (curfile)
  curfile=""
  curfile=""
  insummary=1
  insummary=1
  next
  next
}
}
/^# of expected passes/         { if (insummary == 1) passcnt += \$5; next; }
/^# of expected passes/         { if (insummary == 1) passcnt += \$5; next; }
/^# of unexpected failures/     { if (insummary == 1) failcnt += \$5; next; }
/^# of unexpected failures/     { if (insummary == 1) failcnt += \$5; next; }
/^# of unsupported tests/       { if (insummary == 1) unsupcnt += \$5; next; }
/^# of unsupported tests/       { if (insummary == 1) unsupcnt += \$5; next; }
/^\*\*\* FAILURES: / {
/^\*\*\* FAILURES: / {
  if (insummary == 1) {
  if (insummary == 1) {
    if (failures) sub(/^\*\*\* FAILURES:/,"")
    if (failures) sub(/^\*\*\* FAILURES:/,"")
    failures=failures""\$0
    failures=failures""\$0
  }
  }
}
}
{
{
  if (print_prologue) { print; next }
  if (print_prologue) { print; next }
  if (curfile) print >> curfile
  if (curfile) print >> curfile
}
}
END {
END {
  system ("cat ${TMP}/chapter-*")
  system ("cat ${TMP}/chapter-*")
  print "               === acats Summary ==="
  print "               === acats Summary ==="
  print "# of expected passes           " passcnt
  print "# of expected passes           " passcnt
  print "# of unexpected failures       " failcnt
  print "# of unexpected failures       " failcnt
  if (unsupcnt) print "# of unsupported tests           " unsupcnt
  if (unsupcnt) print "# of unsupported tests           " unsupcnt
  if (failures) print failures
  if (failures) print failures
}
}
EOF
EOF
 
 
  rm -f ${TMP}/chapter-*
  rm -f ${TMP}/chapter-*
  $AWK -f $ACATS_AWK $SUM_FILES
  $AWK -f $ACATS_AWK $SUM_FILES
  exit 0
  exit 0
fi
fi
 
 
# If no variants were specified, find all variants in the remaining
# If no variants were specified, find all variants in the remaining
# summary files.  Otherwise, ignore specified variants that aren't in
# summary files.  Otherwise, ignore specified variants that aren't in
# any of those summary files.
# any of those summary files.
 
 
if test -z "$VARIANTS" ; then
if test -z "$VARIANTS" ; then
  VAR_AWK=${TMP}/variants.awk
  VAR_AWK=${TMP}/variants.awk
  cat <<EOF > $VAR_AWK
  cat <<EOF > $VAR_AWK
/^Schedule of variations:/      { in_vars=1; next }
/^Schedule of variations:/      { in_vars=1; next }
/^$/                            { in_vars=0 }
/^$/                            { in_vars=0 }
/^Running target/               { exit }
/^Running target/               { exit }
{ if (in_vars==1) print \$1; else next }
{ if (in_vars==1) print \$1; else next }
EOF
EOF
 
 
  touch ${TMP}/varlist
  touch ${TMP}/varlist
  for FILE in $SUM_FILES; do
  for FILE in $SUM_FILES; do
    $AWK -f $VAR_AWK $FILE >> ${TMP}/varlist
    $AWK -f $VAR_AWK $FILE >> ${TMP}/varlist
  done
  done
  VARIANTS="`sort -u ${TMP}/varlist`"
  VARIANTS="`sort -u ${TMP}/varlist`"
else
else
  VARS="$VARIANTS"
  VARS="$VARIANTS"
  VARIANTS=""
  VARIANTS=""
  for VAR in $VARS
  for VAR in $VARS
  do
  do
    grep "Running target $VAR" $SUM_FILES > /dev/null && VARIANTS="$VARIANTS $VAR"
    grep "Running target $VAR" $SUM_FILES > /dev/null && VARIANTS="$VARIANTS $VAR"
  done
  done
fi
fi
 
 
# Find out if we have more than one variant, or any at all.
# Find out if we have more than one variant, or any at all.
 
 
VARIANT_COUNT=0
VARIANT_COUNT=0
for VAR in $VARIANTS
for VAR in $VARIANTS
do
do
  VARIANT_COUNT=`expr $VARIANT_COUNT + 1`
  VARIANT_COUNT=`expr $VARIANT_COUNT + 1`
done
done
 
 
if test $VARIANT_COUNT -eq 0 ; then
if test $VARIANT_COUNT -eq 0 ; then
  msg "${PROGNAME}: no file for $TOOL has results for the specified variants"
  msg "${PROGNAME}: no file for $TOOL has results for the specified variants"
  exit 1
  exit 1
fi
fi
 
 
cat $SUM_FILES \
cat $SUM_FILES \
  | $AWK '/^Running/ { if ($2 != "target" && $3 == "...") print "EXPFILE: "$2 } ' \
  | $AWK '/^Running/ { if ($2 != "target" && $3 == "...") print "EXPFILE: "$2 } ' \
  | sort -u > ${TMP}/expfiles
  | sort -u > ${TMP}/expfiles
 
 
# Write the begining of the combined summary file.
# Write the begining of the combined summary file.
 
 
head -n 2 $FIRST_SUM
head -n 2 $FIRST_SUM
echo
echo
echo "          === $TOOL tests ==="
echo "          === $TOOL tests ==="
echo
echo
echo "Schedule of variations:"
echo "Schedule of variations:"
for VAR in $VARIANTS
for VAR in $VARIANTS
do
do
  echo "    $VAR"
  echo "    $VAR"
done
done
echo
echo
 
 
# For each test variant for the tool, copy test reports from each of the
# For each test variant for the tool, copy test reports from each of the
# summary files.  Set up two awk scripts from within the loop to
# summary files.  Set up two awk scripts from within the loop to
# initialize VAR and TOOL with the script, rather than assuming that the
# initialize VAR and TOOL with the script, rather than assuming that the
# available version of awk can pass variables from the command line.
# available version of awk can pass variables from the command line.
 
 
for VAR in $VARIANTS
for VAR in $VARIANTS
do
do
  GUTS_AWK=${TMP}/guts.awk
  GUTS_AWK=${TMP}/guts.awk
  cat << EOF > $GUTS_AWK
  cat << EOF > $GUTS_AWK
BEGIN {
BEGIN {
  variant="$VAR"
  variant="$VAR"
  firstvar=1
  firstvar=1
  expfileno=1
  expfileno=1
  cnt=0
  cnt=0
  print_using=0
  print_using=0
  need_close=0
  need_close=0
}
}
/^EXPFILE: / {
/^EXPFILE: / {
  expfiles[expfileno] = \$2
  expfiles[expfileno] = \$2
  expfilesr[\$2] = expfileno
  expfilesr[\$2] = expfileno
  expfileno = expfileno + 1
  expfileno = expfileno + 1
}
}
/^Running target / {
/^Running target / {
  curvar = \$3
  curvar = \$3
  if (variant == curvar && firstvar == 1) { print; print_using=1; firstvar = 0 }
  if (variant == curvar && firstvar == 1) { print; print_using=1; firstvar = 0 }
  next
  next
}
}
/^Using / {
/^Using / {
  if (variant == curvar && print_using) { print; next }
  if (variant == curvar && print_using) { print; next }
}
}
/^Running / {
/^Running / {
  print_using=0
  print_using=0
  if (variant == curvar) {
  if (variant == curvar) {
    if (need_close) close(curfile)
    if (need_close) close(curfile)
    curfile="${TMP}/list"expfilesr[\$2]
    curfile="${TMP}/list"expfilesr[\$2]
    expfileseen[\$2]=expfileseen[\$2] + 1
    expfileseen[\$2]=expfileseen[\$2] + 1
    need_close=0
    need_close=0
    testname="00"
    testname="00"
    next
    next
  }
  }
}
}
/^\t\t=== .* ===$/ { curvar = ""; next }
/^\t\t=== .* ===$/ { curvar = ""; next }
/^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED|WARNING|ERROR|UNSUPPORTED|UNTESTED|KFAIL):/ {
/^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED|WARNING|ERROR|UNSUPPORTED|UNTESTED|KFAIL):/ {
  testname=\$2
  testname=\$2
  # Ugly hack for gfortran.dg/dg.exp
  # Ugly hack for gfortran.dg/dg.exp
  if ("$TOOL" == "gfortran" && testname ~ /^gfortran.dg\/g77\//)
  if ("$TOOL" == "gfortran" && testname ~ /^gfortran.dg\/g77\//)
    testname="h"testname
    testname="h"testname
}
}
/^$/ { if ("$MODE" == "sum") next }
/^$/ { if ("$MODE" == "sum") next }
{ if (variant == curvar && curfile) {
{ if (variant == curvar && curfile) {
    if ("$MODE" == "sum") {
    if ("$MODE" == "sum") {
      printf "%s %08d|", testname, cnt >> curfile
      printf "%s %08d|", testname, cnt >> curfile
      cnt = cnt + 1
      cnt = cnt + 1
    }
    }
    filewritten[curfile]=1
    filewritten[curfile]=1
    need_close=1
    need_close=1
    print >> curfile
    print >> curfile
  } else
  } else
    next
    next
}
}
END {
END {
  n=1
  n=1
  while (n < expfileno) {
  while (n < expfileno) {
    if (expfileseen[expfiles[n]]) {
    if (expfileseen[expfiles[n]]) {
      print "Running "expfiles[n]" ..."
      print "Running "expfiles[n]" ..."
      if (filewritten["${TMP}/list"n]) {
      if (filewritten["${TMP}/list"n]) {
        if (expfileseen[expfiles[n]] == 1)
        if (expfileseen[expfiles[n]] == 1)
          cmd="cat"
          cmd="cat"
        else
        else
          cmd="LC_ALL=C sort"
          cmd="LC_ALL=C sort"
        if ("$MODE" == "sum")
        if ("$MODE" == "sum")
          system (cmd" ${TMP}/list"n" | sed -n 's/^[^ ]* [^ |]*|//p'")
          system (cmd" ${TMP}/list"n" | sed -n 's/^[^ ]* [^ |]*|//p'")
        else
        else
          system ("cat ${TMP}/list"n)
          system ("cat ${TMP}/list"n)
      }
      }
    }
    }
    n = n + 1
    n = n + 1
  }
  }
}
}
EOF
EOF
 
 
  SUMS_AWK=${TMP}/sums.awk
  SUMS_AWK=${TMP}/sums.awk
  rm -f $SUMS_AWK
  rm -f $SUMS_AWK
  cat << EOF > $SUMS_AWK
  cat << EOF > $SUMS_AWK
BEGIN {
BEGIN {
  variant="$VAR"
  variant="$VAR"
  tool="$TOOL"
  tool="$TOOL"
  passcnt=0; failcnt=0; untstcnt=0; xpasscnt=0; xfailcnt=0; unsupcnt=0; unrescnt=0;
  passcnt=0; failcnt=0; untstcnt=0; xpasscnt=0; xfailcnt=0; unsupcnt=0; unrescnt=0;
  curvar=""; insummary=0
  curvar=""; insummary=0
}
}
/^Running target /              { curvar = \$3; next }
/^Running target /              { curvar = \$3; next }
/^# of /                        { if (variant == curvar) insummary = 1 }
/^# of /                        { if (variant == curvar) insummary = 1 }
/^# of expected passes/         { if (insummary == 1) passcnt += \$5; next; }
/^# of expected passes/         { if (insummary == 1) passcnt += \$5; next; }
/^# of unexpected successes/    { if (insummary == 1) xpasscnt += \$5; next; }
/^# of unexpected successes/    { if (insummary == 1) xpasscnt += \$5; next; }
/^# of unexpected failures/     { if (insummary == 1) failcnt += \$5; next; }
/^# of unexpected failures/     { if (insummary == 1) failcnt += \$5; next; }
/^# of expected failures/       { if (insummary == 1) xfailcnt += \$5; next; }
/^# of expected failures/       { if (insummary == 1) xfailcnt += \$5; next; }
/^# of untested testcases/      { if (insummary == 1) untstcnt += \$5; next; }
/^# of untested testcases/      { if (insummary == 1) untstcnt += \$5; next; }
/^# of unresolved testcases/    { if (insummary == 1) unrescnt += \$5; next; }
/^# of unresolved testcases/    { if (insummary == 1) unrescnt += \$5; next; }
/^# of unsupported tests/       { if (insummary == 1) unsupcnt += \$5; next; }
/^# of unsupported tests/       { if (insummary == 1) unsupcnt += \$5; next; }
/^$/                            { if (insummary == 1)
/^$/                            { if (insummary == 1)
                                    { insummary = 0; curvar = "" }
                                    { insummary = 0; curvar = "" }
                                  next
                                  next
                                }
                                }
{ next }
{ next }
END {
END {
  printf ("\t\t=== %s Summary for %s ===\n\n", tool, variant)
  printf ("\t\t=== %s Summary for %s ===\n\n", tool, variant)
  if (passcnt != 0) printf ("# of expected passes\t\t%d\n", passcnt)
  if (passcnt != 0) printf ("# of expected passes\t\t%d\n", passcnt)
  if (failcnt != 0) printf ("# of unexpected failures\t%d\n", failcnt)
  if (failcnt != 0) printf ("# of unexpected failures\t%d\n", failcnt)
  if (xpasscnt != 0) printf ("# of unexpected successes\t%d\n", xpasscnt)
  if (xpasscnt != 0) printf ("# of unexpected successes\t%d\n", xpasscnt)
  if (xfailcnt != 0) printf ("# of expected failures\t\t%d\n", xfailcnt)
  if (xfailcnt != 0) printf ("# of expected failures\t\t%d\n", xfailcnt)
  if (untstcnt != 0) printf ("# of untested testcases\t\t%d\n", untstcnt)
  if (untstcnt != 0) printf ("# of untested testcases\t\t%d\n", untstcnt)
  if (unrescnt != 0) printf ("# of unresolved testcases\t%d\n", unrescnt)
  if (unrescnt != 0) printf ("# of unresolved testcases\t%d\n", unrescnt)
  if (unsupcnt != 0) printf ("# of unsupported tests\t\t%d\n", unsupcnt)
  if (unsupcnt != 0) printf ("# of unsupported tests\t\t%d\n", unsupcnt)
}
}
EOF
EOF
 
 
  PVAR=`echo $VAR | sed 's,/,.,g'`
  PVAR=`echo $VAR | sed 's,/,.,g'`
  TMPFILE=${TMP}/var-$PVAR
  TMPFILE=${TMP}/var-$PVAR
  rm -f $TMPFILE
  rm -f $TMPFILE
  rm -f ${TMP}/list*
  rm -f ${TMP}/list*
  cat ${TMP}/expfiles $SUM_FILES | $AWK -f $GUTS_AWK
  cat ${TMP}/expfiles $SUM_FILES | $AWK -f $GUTS_AWK
  cat $SUM_FILES | $AWK -f $SUMS_AWK > $TMPFILE
  cat $SUM_FILES | $AWK -f $SUMS_AWK > $TMPFILE
  # If there are multiple variants, output the counts for this one;
  # If there are multiple variants, output the counts for this one;
  # otherwise there will just be the final counts at the end.
  # otherwise there will just be the final counts at the end.
  test $VARIANT_COUNT -eq 1 || cat $TMPFILE
  test $VARIANT_COUNT -eq 1 || cat $TMPFILE
done
done
 
 
# Set up an awk script to get the combined summary counts for the tool.
# Set up an awk script to get the combined summary counts for the tool.
 
 
TOTAL_AWK=${TMP}/total.awk
TOTAL_AWK=${TMP}/total.awk
cat << EOF > $TOTAL_AWK
cat << EOF > $TOTAL_AWK
BEGIN {
BEGIN {
  tool="$TOOL"
  tool="$TOOL"
  passcnt=0; failcnt=0; untstcnt=0; xpasscnt=0; xfailcnt=0; unsupcnt=0; unrescnt=0
  passcnt=0; failcnt=0; untstcnt=0; xpasscnt=0; xfailcnt=0; unsupcnt=0; unrescnt=0
}
}
/^# of expected passes/         { passcnt += \$5 }
/^# of expected passes/         { passcnt += \$5 }
/^# of unexpected failures/     { failcnt += \$5 }
/^# of unexpected failures/     { failcnt += \$5 }
/^# of unexpected successes/    { xpasscnt += \$5 }
/^# of unexpected successes/    { xpasscnt += \$5 }
/^# of expected failures/       { xfailcnt += \$5 }
/^# of expected failures/       { xfailcnt += \$5 }
/^# of untested testcases/      { untstcnt += \$5 }
/^# of untested testcases/      { untstcnt += \$5 }
/^# of unresolved testcases/    { unrescnt += \$5 }
/^# of unresolved testcases/    { unrescnt += \$5 }
/^# of unsupported tests/       { unsupcnt += \$5 }
/^# of unsupported tests/       { unsupcnt += \$5 }
END {
END {
  printf ("\n\t\t=== %s Summary ===\n\n", tool)
  printf ("\n\t\t=== %s Summary ===\n\n", tool)
  if (passcnt != 0) printf ("# of expected passes\t\t%d\n", passcnt)
  if (passcnt != 0) printf ("# of expected passes\t\t%d\n", passcnt)
  if (failcnt != 0) printf ("# of unexpected failures\t%d\n", failcnt)
  if (failcnt != 0) printf ("# of unexpected failures\t%d\n", failcnt)
  if (xpasscnt != 0) printf ("# of unexpected successes\t%d\n", xpasscnt)
  if (xpasscnt != 0) printf ("# of unexpected successes\t%d\n", xpasscnt)
  if (xfailcnt != 0) printf ("# of expected failures\t\t%d\n", xfailcnt)
  if (xfailcnt != 0) printf ("# of expected failures\t\t%d\n", xfailcnt)
  if (untstcnt != 0) printf ("# of untested testcases\t\t%d\n", untstcnt)
  if (untstcnt != 0) printf ("# of untested testcases\t\t%d\n", untstcnt)
  if (unrescnt != 0) printf ("# of unresolved testcases\t%d\n", unrescnt)
  if (unrescnt != 0) printf ("# of unresolved testcases\t%d\n", unrescnt)
  if (unsupcnt != 0) printf ("# of unsupported tests\t\t%d\n", unsupcnt)
  if (unsupcnt != 0) printf ("# of unsupported tests\t\t%d\n", unsupcnt)
}
}
EOF
EOF
 
 
# Find the total summaries for the tool and add to the end of the output.
# Find the total summaries for the tool and add to the end of the output.
cat ${TMP}/var-* | $AWK -f $TOTAL_AWK
cat ${TMP}/var-* | $AWK -f $TOTAL_AWK
 
 
# This is ugly, but if there's version output from the compiler under test
# This is ugly, but if there's version output from the compiler under test
# at the end of the file, we want it.  The other thing that might be there
# at the end of the file, we want it.  The other thing that might be there
# is the final summary counts.
# is the final summary counts.
tail -2 $FIRST_SUM | grep '^#' > /dev/null || tail -2 $FIRST_SUM
tail -2 $FIRST_SUM | grep '^#' > /dev/null || tail -2 $FIRST_SUM
 
 
exit 0
exit 0
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.