]>
Commit | Line | Data |
---|---|---|
49e921be AO |
1 | #! /bin/sh |
2 | ||
6f298a0a | 3 | # (C) 1998, 2000 Free Software Foundation |
49e921be AO |
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 | ||
6f298a0a | 10 | # This scripts assumes it lives in the contrib directory of the GCC |
49e921be AO |
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 | |
6f298a0a JM |
13 | # can override the defaults with --srcdir=/some/dir/GCC or |
14 | # --testsuite=/some/dir/GCC/gcc/testsuite. If you specify | |
49e921be AO |
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 | |
19 | # from. If you specify --prefix=/some/dir, gcc, g++ and g77 will be | |
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++ | |
22 | # and --with-g77=/pathname/to/g77. If you specify --without-gcc, | |
23 | # --without-g++ or --without-g77, the test for the specified program | |
24 | # will be skipped. By default, gcc, g++ and g77 will be searched in | |
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 | ||
40 | if test -f site.exp; then | |
41 | echo site.exp already exists >&2 | |
42 | exit 1 | |
43 | fi | |
44 | ||
45 | while true; do | |
46 | case "$1" in | |
47 | --with-testsuite=*) testsuite=`echo "$1" | sed 's/[^=]*=//'`; shift;; | |
48 | --srcdir=*) srcdir=`echo "$1" | sed 's/[^=]*=//'`; shift;; | |
49 | ||
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;; | |
53 | --with-g77=*) G77_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;; | |
54 | --without-gcc) GCC_UNDER_TEST=no; shift;; | |
55 | --without-g++) GXX_UNDER_TEST=no; shift;; | |
56 | --without-g77) G77_UNDER_TEST=no; shift;; | |
57 | ||
58 | --tmpdir=*) tmpdir=`echo "$1" | sed 's/[^=]*=//'`; shift;; | |
59 | ||
60 | --help) cat <<\EOF | |
61 | Runs the testsuite for an installed version of gcc/g++/g77 | |
62 | Copyright (C) 1998 Free Software Foundation | |
63 | by Alexandre Oliva <oliva@dcc.unicamp.br> | |
64 | ||
65 | Supported arguments: | |
66 | ||
67 | --help prints this page | |
68 | ||
69 | --with-testsuite=/some/dir/gcc/testsuite specify the testsuite directory | |
70 | --srcdir=/some/dir same as --with-testsuite=/some/dir/gcc/testsuite | |
71 | [deduced from shell-script pathname] | |
72 | ||
73 | --prefix=/some/dir use gcc, g++ and g77 from /some/dir/bin [PATH] | |
74 | --with-gcc=/some/dir/bin/gcc use specified gcc program [gcc] | |
75 | --with-g++=/some/dir/bin/g++ use specified g++ program [g++] | |
76 | --with-g77=/some/dir/bin/g77 use specified g77 program [g77] | |
77 | --without-gcc do not run gcc testsuite | |
78 | --without-g++ do not run g++ testsuite | |
79 | --without-g77 do not run g77 testsuite | |
80 | ||
81 | --tmpdir=/some/dir create temporaries and leave failed programs | |
82 | at specified directory [.] | |
83 | ||
84 | -- end of argument list; following arguments are passed to runtest | |
85 | EOF | |
86 | exit | |
87 | ;; | |
88 | ||
89 | --) shift; break;; | |
90 | *) break;; | |
91 | esac | |
92 | done | |
93 | ||
94 | if test x"${testsuite+set}" != x"set" && test x"${srcdir+set}" != x"set"; then | |
95 | file=$0 | |
96 | while [ -h $file ]; do | |
97 | file=`ls -l $file | sed s/'.* -> '//` | |
98 | done | |
99 | srcdir=`CDPATH=. && cd \`echo "$file" | sed 's,/*[^/]*$,,;s,^$,.,'\`/.. >/dev/null && pwd` | |
100 | fi | |
101 | ||
102 | cat >site.exp <<EOF | |
103 | set tmpdir "${tmpdir-`pwd`}" | |
104 | set srcdir "${testsuite-${srcdir}/gcc/testsuite}" | |
105 | set GCC_UNDER_TEST "${GCC_UNDER_TEST-${prefix}${prefix+/bin/}gcc}" | |
106 | set GXX_UNDER_TEST "${GXX_UNDER_TEST-${prefix}${prefix+/bin/}g++}" | |
107 | set G77_UNDER_TEST "${G77_UNDER_TEST-${prefix}${prefix+/bin/}g77}" | |
108 | EOF | |
109 | ||
110 | test x"${GCC_UNDER_TEST}" = x"no" || runtest --tool gcc ${1+"$@"} | |
111 | test x"${GXX_UNDER_TEST}" = x"no" || runtest --tool g++ ${1+"$@"} | |
112 | test x"${G77_UNDER_TEST}" = x"no" || runtest --tool g77 ${1+"$@"} | |
113 | ||
114 | exit 0 |