This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
PATCH to run only test where appropriate
On Tue, 29 September 1998, 15:53:53, manfred@s-direktnet.de wrote:
> Another thing which should be fixed: currently "make check" ignores
> any definition of LANGUAGES; on my Motorola machines I restrict them
> to "c c++" due to the slow machines. Unfortunately, the "check-..."
> targets don't consider if they actually can do anything useful,
> e.g. if "cc1plus" doesn't exist, don't even try to start "runtest"; in
> my example, the check-f77 causes me one additional *hour* of checking
> on the dog slow m68k box :-( I'll be sending a patch for this, too.
This patch
- adds code to check if the compiler to be tested even exists,
- eliminates the redundancy of having a separate "check-" target
for each compiler; they actually only differ in the `--tool'
argument.
OK to install?
manfred
1998-09-29 Manfred Hollstein <manfred@s-direktnet.de>
* Makefile.in (check-*): Combine existing check-<lang> targets
to avoid redundancy; add code to check if the tests actually
need to run.
diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19980929.orig/gcc/Makefile.in egcs-19980929/gcc/Makefile.in
--- egcs-19980929.orig/gcc/Makefile.in Mon Sep 21 10:12:05 1998
+++ egcs-19980929/gcc/Makefile.in Tue Sep 29 16:16:44 1998
@@ -2612,45 +2612,26 @@ testsuite/site.exp: site.exp
rm -rf testsuite/site.exp
cp site.exp testsuite/site.exp
-check-g++: testsuite/site.exp
- -rootme=`pwd`; export rootme; \
- srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
- cd testsuite; \
- EXPECT=${EXPECT} ; export EXPECT ; \
- if [ -f $${rootme}/../expect/expect ] ; then \
- TCL_LIBRARY=$${srcdir}/../tcl/library ; \
- export TCL_LIBRARY ; fi ; \
- $(RUNTEST) --tool g++ $(RUNTESTFLAGS)
-
-check-gcc: testsuite/site.exp
- -rootme=`pwd`; export rootme; \
- srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
- cd testsuite; \
- EXPECT=${EXPECT} ; export EXPECT ; \
- if [ -f $${rootme}/../expect/expect ] ; then \
- TCL_LIBRARY=$${srcdir}/../tcl/library ; \
- export TCL_LIBRARY ; fi ; \
- $(RUNTEST) --tool gcc $(RUNTESTFLAGS)
-
-check-g77: testsuite/site.exp
- -rootme=`pwd`; export rootme; \
- srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
- cd testsuite; \
- EXPECT=${EXPECT} ; export EXPECT ; \
- if [ -f $${rootme}/../expect/expect ] ; then \
- TCL_LIBRARY=$${srcdir}/../tcl/library ; \
- export TCL_LIBRARY ; fi ; \
- $(RUNTEST) --tool g77 $(RUNTESTFLAGS)
-
-check-objc: testsuite/site.exp
- -rootme=`pwd`; export rootme; \
- srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
- cd testsuite; \
- EXPECT=${EXPECT} ; export EXPECT ; \
- if [ -f $${rootme}/../expect/expect ] ; then \
- TCL_LIBRARY=$${srcdir}/../tcl/library ; \
- export TCL_LIBRARY ; fi ; \
- $(RUNTEST) --tool objc $(RUNTESTFLAGS)
+check-g++ check-gcc check-g77 check-objc: testsuite/site.exp
+ -tool=`echo $@ | sed -e 's,^check-,,'`; \
+ runtests=no; \
+ case $$tool in \
+ g++ ) if [ -f ./cc1plus$(exeext) ]; then runtests=yes; else true; fi ;; \
+ gcc ) if [ -f ./cc1$(exeext) ]; then runtests=yes; else true; fi ;; \
+ g77 ) if [ -f ./f771$(exeext) ]; then runtests=yes; else true; fi ;; \
+ objc) if [ -f ./cc1obj$(exeext) ]; then runtests=yes; else true; fi ;; \
+ * ) true ;; \
+ esac; \
+ if [ $$runtests = yes ]; then \
+ rootme=`pwd`; export rootme; \
+ srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
+ cd testsuite; \
+ EXPECT=${EXPECT} ; export EXPECT ; \
+ if [ -f $${rootme}/../expect/expect ] ; then \
+ TCL_LIBRARY=$${srcdir}/../tcl/library ; \
+ export TCL_LIBRARY ; fi ; \
+ $(RUNTEST) --tool $$tool $(RUNTESTFLAGS) ; \
+ else true; fi
# These exist for maintenance purposes.