This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] testsuite: clean up gcc.misc-tests/linkage.c


The failure message for gcc.misc-tests/linkage.exp is only
"FAIL linkage.c".  This patch adds the directory name to pass/fail
messages and adds a message when the test is unsupported because it
can't find a native compiler to test.  It also deletes generated files
and renames the executable file from "x" to "linkage.exe".

Tested on powerpc64-unknown-linux-gnu with -m32 (which passes) and -m64
(which fails), and with temporary hacks to make it fail in various ways;
OK for mainline?

2004-10-29  Janis Johnson  <janis187@us.ibm.com>

	* gcc.misc-tests/linkage.exp: Prepend directory name to pass/fail
	message, delete generated files, use more descriptive name for
	executable, and make the test unsupported when it cannot be run.

Index: gcc.misc-tests/linkage.exp
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/gcc.misc-tests/linkage.exp,v
retrieving revision 1.13
diff -u -p -r1.13 linkage.exp
--- gcc.misc-tests/linkage.exp	22 Jun 2004 19:52:33 -0000	1.13
+++ gcc.misc-tests/linkage.exp	29 Oct 2004 20:05:26 -0000
@@ -21,7 +21,7 @@
 if [isnative] then {
     set lines [gcc_target_compile "$srcdir/$subdir/linkage-x.c" "linkage-x.o" object {additional_flags="-w"}]
     if ![string match "" $lines] then {
-	fail "linkage.c"
+	fail "$subdir/linkage.c compile"
     } else {
 	# This is a completely bogus test. Sorry.
 
@@ -65,7 +65,9 @@ if [isnative] then {
 	    }
 	}
 
-	catch { exec rm -f linkage-y.o }
+	if [file exists "linkage-y.o"] then {
+	    file delete "linkage-y.o"
+	}
 	send_log "cc -c $native_cflags $srcdir/$subdir/linkage-y.c >&/dev/null\n"
 	catch { exec cc -c $native_cflags "$srcdir/$subdir/linkage-y.c" >&/dev/null }
 	if ![file exists "linkage-y.o"] then {
@@ -73,12 +75,17 @@ if [isnative] then {
 	    catch { exec c89 -c $native_cflags "$srcdir/$subdir/linkage-y.c" >&/dev/null }
 	}
 	if [file exists "linkage-y.o"] then {
-	    set lines [gcc_target_compile "linkage-y.o linkage-x.o" "x" executable ""]
+	    set lines [gcc_target_compile "linkage-y.o linkage-x.o" "linkage.exe" executable ""]
 	    if [string match "" $lines] then {
-		pass "linkage.c"
+		pass "$subdir/linkage.c link"
+		file delete "linkage.exe"
 	    } else {
-		fail "linkage.c"
+		fail "$subdir/linkage.c link"
 	    }
+	    file delete "linkage-y.o"
+	} else {
+	    unsupported "$subdir/linkage.c native compile failed"
 	}
+	file delete "linkage-x.o"
     }
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]