Having just been experimenting with testing of installed compilers - yes
something like this could be useful, however: to do cross-testing I found I also
(a) had to set my target_list; so either an extra flag for that, or maybe just a
generic 'extra_site_flags' parameter?
(b) I had to set up some boards...so maybe could have got there with the
--tmpdir flag, ok;
(c) lost all the parallelism provided by the Makefile in build/gcc. It should be
possible to use the (check-parallel-xxx rules from) Makefile in conjunction with
the site.exp from contrib/test_installed, haven't got that far yet...
This does leave me wondering (1) whether a one-step "$ test_installed" is
feasible, or a two-stage setup and then run is inevitable; (2) whether having
all that parallelism expressed in the Makefile is the best place for it. Not
that I have an alternative proposal at this point...
--Alan
Steve Ellcey wrote:
I noticed I never got a reply to this patch proposal I sent out back
in March. Does anyone have an opinion on this? I think it would make
testing of installed cross compilers easier.
Steve Ellcey
sell...@imgtec.com
--------------- Original Email ---------------
I was doing some testing of an installed cross-compiler using the
test_installed script in contrib and I noticed that there was no way
to set the target_triplet in the site.exp script that test_installed
creates. This patch adds a new option (--target) that can be used to
set target_triplet in site.exp before running the testsuite, thus
making it more useful when testing cross-compilers. If you don't use
the option nothing is changed.
OK to checkin?
Steve Ellcey
sell...@mips.com
2014-03-06 Steve Ellcey <sell...@mips.com>
* test_installed (--target=): New option.
diff --git a/contrib/test_installed b/contrib/test_installed
index e518cbc..8102e7f 100755
--- a/contrib/test_installed
+++ b/contrib/test_installed
@@ -46,7 +46,7 @@ while true; do
case "$1" in
--with-testsuite=*) testsuite=`echo "$1" | sed 's/[^=]*=//'`; shift;;
--srcdir=*) srcdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;
-
+ --target=*) target=`echo "$1" | sed 's/[^=]*=//'`; shift;;
--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;;
@@ -71,6 +71,9 @@ Supported arguments:
--srcdir=/some/dir same as --with-testsuite=/some/dir/gcc/testsuite
[deduced from shell-script pathname]
+--target=triplet The target architecture of the compiler being
+ tested if different then the host.
+
--prefix=/some/dir use gcc, g++ and gfortran from /some/dir/bin
[PATH]
--with-gcc=/some/dir/bin/gcc use specified gcc program [gcc]
--with-g++=/some/dir/bin/g++ use specified g++ program [g++]
@@ -112,6 +115,9 @@ set GXX_UNDER_TEST
"${GXX_UNDER_TEST-${prefix}${prefix+/bin/}g++}"
set GFORTRAN_UNDER_TEST
"${GFORTRAN_UNDER_TEST-${prefix}${prefix+/bin/}gfortran}"
set OBJC_UNDER_TEST "${OBJC_UNDER_TEST-${prefix}${prefix+/bin/}gcc}"
EOF
+if test x${target} != x; then
+ echo "set target_triplet $target" >> site.exp
+fi
test x"${GCC_UNDER_TEST}" = x"no" || runtest --tool gcc ${1+"$@"}
test x"${GXX_UNDER_TEST}" = x"no" || runtest --tool g++ ${1+"$@"}