1998-08-14 12:09:42 +02:00
|
|
|
#! /bin/sh
|
|
|
|
|
2007-02-26 21:40:13 +01:00
|
|
|
# (C) 1998, 2000, 2002, 2003, 2007 Free Software Foundation
|
1998-08-14 12:09:42 +02:00
|
|
|
# Originally by Alexandre Oliva <oliva@dcc.unicamp.br>
|
|
|
|
|
|
|
|
# This script is Free Software, and it can be copied, distributed and
|
|
|
|
# modified as defined in the GNU General Public License. A copy of
|
|
|
|
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
2000-10-08 20:39:27 +02:00
|
|
|
# This scripts assumes it lives in the contrib directory of the GCC
|
1998-08-14 12:09:42 +02:00
|
|
|
# source tree, so it will find the testsuite tree from its location.
|
|
|
|
# If you move it elsewhere, or want to use another testsuite tree, you
|
2000-10-08 20:39:27 +02:00
|
|
|
# can override the defaults with --srcdir=/some/dir/GCC or
|
|
|
|
# --testsuite=/some/dir/GCC/gcc/testsuite. If you specify
|
1998-08-14 12:09:42 +02:00
|
|
|
# --testsuite, --srcdir will be ignored; otherwise, `/gcc/testsuite'
|
|
|
|
# will be appended to the srcdir.
|
|
|
|
|
|
|
|
# You may specify where the binaries to be tested should be picked up
|
2007-02-26 21:40:13 +01:00
|
|
|
# from. If you specify --prefix=/some/dir, gcc, g++ and gfortran will be
|
1998-08-14 12:09:42 +02:00
|
|
|
# looked for at /some/dir/bin. Each one may be overridden by
|
|
|
|
# specifying --with-gcc=/pathname/to/gcc, --with-g++=/pathname/to/g++
|
2007-02-26 21:40:13 +01:00
|
|
|
# and --with-gfortran=/pathname/to/gfortran. If you specify --without-gcc,
|
|
|
|
# --without-g++ or --without-gfortran, the test for the specified program
|
|
|
|
# will be skipped. By default, gcc, g++ and gfortran will be searched in
|
1998-08-14 12:09:42 +02:00
|
|
|
# the PATH.
|
|
|
|
|
|
|
|
# An additional argument may specify --tmpdir=/some/dir; by default,
|
|
|
|
# temporaries will be stored in the current directory, where the log
|
|
|
|
# files will be stored.
|
|
|
|
|
|
|
|
# The script will interpret arguments until it finds one it does not
|
|
|
|
# understand. The remaining ones will be passed to `runtest'. A
|
|
|
|
# double-dash can be used to explicitly separate the arguments to
|
|
|
|
# `test_installed' from the ones to `runtest'.
|
|
|
|
|
|
|
|
# This script should be run in an empty directory; it will refuse to
|
|
|
|
# run if it finds a file named site.exp in the current directory.
|
|
|
|
|
|
|
|
|
|
|
|
if test -f site.exp; then
|
|
|
|
echo site.exp already exists >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
while true; do
|
|
|
|
case "$1" in
|
|
|
|
--with-testsuite=*) testsuite=`echo "$1" | sed 's/[^=]*=//'`; shift;;
|
|
|
|
--srcdir=*) srcdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;
|
2015-06-02 19:12:16 +02:00
|
|
|
--target=*) target=`echo "$1" | sed 's/[^=]*=//'`; shift;;
|
1998-08-14 12:09:42 +02:00
|
|
|
--prefix=*) prefix=`echo "$1" | sed 's/[^=]*=//'`; shift;;
|
|
|
|
--with-gcc=*) GCC_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
|
|
|
|
--with-g++=*) GXX_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
|
2007-02-26 21:40:13 +01:00
|
|
|
--with-gfortran=*) GFORTRAN_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
|
1998-08-14 12:09:42 +02:00
|
|
|
--without-gcc) GCC_UNDER_TEST=no; shift;;
|
|
|
|
--without-g++) GXX_UNDER_TEST=no; shift;;
|
2007-02-26 21:40:13 +01:00
|
|
|
--without-gfortran) GFORTRAN_UNDER_TEST=no; shift;;
|
2003-07-11 08:05:01 +02:00
|
|
|
--without-objc) OBJC_UNDER_TEST=no; shift;;
|
1998-08-14 12:09:42 +02:00
|
|
|
|
|
|
|
--tmpdir=*) tmpdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;
|
|
|
|
|
|
|
|
--help) cat <<\EOF
|
2007-02-26 21:40:13 +01:00
|
|
|
Runs the testsuite for an installed version of gcc/g++/gfortran/objc
|
1998-08-14 12:09:42 +02:00
|
|
|
Copyright (C) 1998 Free Software Foundation
|
|
|
|
by Alexandre Oliva <oliva@dcc.unicamp.br>
|
|
|
|
|
|
|
|
Supported arguments:
|
|
|
|
|
|
|
|
--help prints this page
|
|
|
|
|
|
|
|
--with-testsuite=/some/dir/gcc/testsuite specify the testsuite directory
|
|
|
|
--srcdir=/some/dir same as --with-testsuite=/some/dir/gcc/testsuite
|
|
|
|
[deduced from shell-script pathname]
|
|
|
|
|
2015-06-02 19:12:16 +02:00
|
|
|
--target=triplet The target architecture of the compiler being
|
|
|
|
tested if different than the host.
|
|
|
|
|
2007-02-26 21:40:13 +01:00
|
|
|
--prefix=/some/dir use gcc, g++ and gfortran from /some/dir/bin [PATH]
|
1998-08-14 12:09:42 +02:00
|
|
|
--with-gcc=/some/dir/bin/gcc use specified gcc program [gcc]
|
|
|
|
--with-g++=/some/dir/bin/g++ use specified g++ program [g++]
|
2007-02-26 21:40:13 +01:00
|
|
|
--with-gfortran=/some/dir/bin/gfortran use specified gfortran program [gfortran]
|
1998-08-14 12:09:42 +02:00
|
|
|
--without-gcc do not run gcc testsuite
|
|
|
|
--without-g++ do not run g++ testsuite
|
2007-02-26 21:40:13 +01:00
|
|
|
--without-gfortran do not run gfortran testsuite
|
2003-07-11 08:05:01 +02:00
|
|
|
--without-objc do not run objc testsuite
|
1998-08-14 12:09:42 +02:00
|
|
|
|
|
|
|
--tmpdir=/some/dir create temporaries and leave failed programs
|
|
|
|
at specified directory [.]
|
|
|
|
|
|
|
|
-- end of argument list; following arguments are passed to runtest
|
|
|
|
EOF
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
|
|
|
|
--) shift; break;;
|
|
|
|
*) break;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if test x"${testsuite+set}" != x"set" && test x"${srcdir+set}" != x"set"; then
|
|
|
|
file=$0
|
|
|
|
while [ -h $file ]; do
|
|
|
|
file=`ls -l $file | sed s/'.* -> '//`
|
|
|
|
done
|
2002-05-16 19:43:21 +02:00
|
|
|
srcdir=`CDPATH=. && cd \`echo "$file" | sed 's,/*[^/]*$,,;s,^$,.,'\`/.. >/dev/null && ${PWDCMD-pwd}`
|
1998-08-14 12:09:42 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
cat >site.exp <<EOF
|
2003-07-11 08:05:01 +02:00
|
|
|
set rootme "."
|
2002-05-16 19:43:21 +02:00
|
|
|
set tmpdir "${tmpdir-`${PWDCMD-pwd}`}"
|
1998-08-14 12:09:42 +02:00
|
|
|
set srcdir "${testsuite-${srcdir}/gcc/testsuite}"
|
2003-07-11 08:05:01 +02:00
|
|
|
set CFLAGS ""
|
|
|
|
set CXXFLAGS ""
|
1998-08-14 12:09:42 +02:00
|
|
|
set GCC_UNDER_TEST "${GCC_UNDER_TEST-${prefix}${prefix+/bin/}gcc}"
|
|
|
|
set GXX_UNDER_TEST "${GXX_UNDER_TEST-${prefix}${prefix+/bin/}g++}"
|
2007-02-26 21:40:13 +01:00
|
|
|
set GFORTRAN_UNDER_TEST "${GFORTRAN_UNDER_TEST-${prefix}${prefix+/bin/}gfortran}"
|
2003-07-11 08:05:01 +02:00
|
|
|
set OBJC_UNDER_TEST "${OBJC_UNDER_TEST-${prefix}${prefix+/bin/}gcc}"
|
1998-08-14 12:09:42 +02:00
|
|
|
EOF
|
2015-06-02 19:12:16 +02:00
|
|
|
if test x${target} != x; then
|
|
|
|
echo "set target_triplet $target" >> site.exp
|
|
|
|
echo "set target_alias $target" >> site.exp
|
|
|
|
fi
|
1998-08-14 12:09:42 +02:00
|
|
|
|
|
|
|
test x"${GCC_UNDER_TEST}" = x"no" || runtest --tool gcc ${1+"$@"}
|
|
|
|
test x"${GXX_UNDER_TEST}" = x"no" || runtest --tool g++ ${1+"$@"}
|
2007-02-26 21:40:13 +01:00
|
|
|
test x"${GFORTRAN_UNDER_TEST}" = x"no" || runtest --tool gfortran ${1+"$@"}
|
2003-07-11 08:05:01 +02:00
|
|
|
test x"${OBJC_UNDER_TEST}" = x"no" || runtest --tool objc ${1+"$@"}
|
1998-08-14 12:09:42 +02:00
|
|
|
|
|
|
|
exit 0
|