]> git.ipfire.org Git - thirdparty/gcc.git/blame - contrib/test_installed
PR c++/87554 - ICE with extern template and reference member.
[thirdparty/gcc.git] / contrib / test_installed
CommitLineData
38af0326 1#! /bin/sh
2
aad3c56b 3# (C) 1998, 2000, 2002, 2003, 2007 Free Software Foundation
38af0326 4# Originally by Alexandre Oliva <oliva@dcc.unicamp.br>
5
6# This script is Free Software, and it can be copied, distributed and
7# modified as defined in the GNU General Public License. A copy of
8# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
9
9d013742 10# This scripts assumes it lives in the contrib directory of the GCC
38af0326 11# source tree, so it will find the testsuite tree from its location.
12# If you move it elsewhere, or want to use another testsuite tree, you
9d013742 13# can override the defaults with --srcdir=/some/dir/GCC or
14# --testsuite=/some/dir/GCC/gcc/testsuite. If you specify
38af0326 15# --testsuite, --srcdir will be ignored; otherwise, `/gcc/testsuite'
16# will be appended to the srcdir.
17
18# You may specify where the binaries to be tested should be picked up
aad3c56b 19# from. If you specify --prefix=/some/dir, gcc, g++ and gfortran will be
38af0326 20# looked for at /some/dir/bin. Each one may be overridden by
21# specifying --with-gcc=/pathname/to/gcc, --with-g++=/pathname/to/g++
aad3c56b 22# and --with-gfortran=/pathname/to/gfortran. If you specify --without-gcc,
23# --without-g++ or --without-gfortran, the test for the specified program
24# will be skipped. By default, gcc, g++ and gfortran will be searched in
38af0326 25# the PATH.
26
27# An additional argument may specify --tmpdir=/some/dir; by default,
28# temporaries will be stored in the current directory, where the log
29# files will be stored.
30
31# The script will interpret arguments until it finds one it does not
32# understand. The remaining ones will be passed to `runtest'. A
33# double-dash can be used to explicitly separate the arguments to
34# `test_installed' from the ones to `runtest'.
35
36# This script should be run in an empty directory; it will refuse to
37# run if it finds a file named site.exp in the current directory.
38
39
40if test -f site.exp; then
41 echo site.exp already exists >&2
42 exit 1
43fi
44
45while true; do
46 case "$1" in
47 --with-testsuite=*) testsuite=`echo "$1" | sed 's/[^=]*=//'`; shift;;
48 --srcdir=*) srcdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;
8ad38f2f 49 --target=*) target=`echo "$1" | sed 's/[^=]*=//'`; shift;;
38af0326 50 --prefix=*) prefix=`echo "$1" | sed 's/[^=]*=//'`; shift;;
51 --with-gcc=*) GCC_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
52 --with-g++=*) GXX_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
aad3c56b 53 --with-gfortran=*) GFORTRAN_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
38af0326 54 --without-gcc) GCC_UNDER_TEST=no; shift;;
55 --without-g++) GXX_UNDER_TEST=no; shift;;
aad3c56b 56 --without-gfortran) GFORTRAN_UNDER_TEST=no; shift;;
f860362b 57 --without-objc) OBJC_UNDER_TEST=no; shift;;
38af0326 58
59 --tmpdir=*) tmpdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;
60
61 --help) cat <<\EOF
aad3c56b 62Runs the testsuite for an installed version of gcc/g++/gfortran/objc
38af0326 63Copyright (C) 1998 Free Software Foundation
64by Alexandre Oliva <oliva@dcc.unicamp.br>
65
66Supported arguments:
67
68--help prints this page
69
70--with-testsuite=/some/dir/gcc/testsuite specify the testsuite directory
71--srcdir=/some/dir same as --with-testsuite=/some/dir/gcc/testsuite
72 [deduced from shell-script pathname]
73
8ad38f2f 74--target=triplet The target architecture of the compiler being
75 tested if different than the host.
76
aad3c56b 77--prefix=/some/dir use gcc, g++ and gfortran from /some/dir/bin [PATH]
38af0326 78--with-gcc=/some/dir/bin/gcc use specified gcc program [gcc]
79--with-g++=/some/dir/bin/g++ use specified g++ program [g++]
aad3c56b 80--with-gfortran=/some/dir/bin/gfortran use specified gfortran program [gfortran]
38af0326 81--without-gcc do not run gcc testsuite
82--without-g++ do not run g++ testsuite
aad3c56b 83--without-gfortran do not run gfortran testsuite
f860362b 84--without-objc do not run objc testsuite
38af0326 85
86--tmpdir=/some/dir create temporaries and leave failed programs
87 at specified directory [.]
88
89-- end of argument list; following arguments are passed to runtest
90EOF
91 exit
92 ;;
93
94 --) shift; break;;
95 *) break;;
96 esac
97done
98
99if test x"${testsuite+set}" != x"set" && test x"${srcdir+set}" != x"set"; then
100 file=$0
101 while [ -h $file ]; do
102 file=`ls -l $file | sed s/'.* -> '//`
103 done
3354d061 104 srcdir=`CDPATH=. && cd \`echo "$file" | sed 's,/*[^/]*$,,;s,^$,.,'\`/.. >/dev/null && ${PWDCMD-pwd}`
38af0326 105fi
106
107cat >site.exp <<EOF
f860362b 108set rootme "."
3354d061 109set tmpdir "${tmpdir-`${PWDCMD-pwd}`}"
38af0326 110set srcdir "${testsuite-${srcdir}/gcc/testsuite}"
f860362b 111set CFLAGS ""
112set CXXFLAGS ""
38af0326 113set GCC_UNDER_TEST "${GCC_UNDER_TEST-${prefix}${prefix+/bin/}gcc}"
114set GXX_UNDER_TEST "${GXX_UNDER_TEST-${prefix}${prefix+/bin/}g++}"
aad3c56b 115set GFORTRAN_UNDER_TEST "${GFORTRAN_UNDER_TEST-${prefix}${prefix+/bin/}gfortran}"
f860362b 116set OBJC_UNDER_TEST "${OBJC_UNDER_TEST-${prefix}${prefix+/bin/}gcc}"
38af0326 117EOF
8ad38f2f 118if test x${target} != x; then
119 echo "set target_triplet $target" >> site.exp
120 echo "set target_alias $target" >> site.exp
121fi
38af0326 122
123test x"${GCC_UNDER_TEST}" = x"no" || runtest --tool gcc ${1+"$@"}
124test x"${GXX_UNDER_TEST}" = x"no" || runtest --tool g++ ${1+"$@"}
aad3c56b 125test x"${GFORTRAN_UNDER_TEST}" = x"no" || runtest --tool gfortran ${1+"$@"}
f860362b 126test x"${OBJC_UNDER_TEST}" = x"no" || runtest --tool objc ${1+"$@"}
38af0326 127
128exit 0