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]

[testsuite patch] (checked in) fix testsuite/25247


This fixes dg-skip-if and dg-xfail-if to work with selector expresions
as the target.  It also allows running only the permanent tests in
gcc.test-framework and skipping the generated tests.  I'm probably the
only person who ever runs that directory since it's skipped by default
and must be run separately from the rest of the compiler testsuite.

Tested on powerpc64-linux.  Checked in on mainline; I'll check add it
to the 4.1 and 4.0 branches after testing it there.  This patch is not
relevant for the 3.4 branch.

2005-12-05  Janis Johnson  <janis187@us.ibm.com>

	PR testsuite/25247
	* lib/target-supports-dg.exp (dg-skip-if): Fix target selector for
	use in selector expressions.
	(dg-xfail-if): Ditto.
	* gcc.test-framework/dg-dot-run-sif-exp-P.c: New test.
	* gcc.test-framework/dg-dot-run-sif-exp-U.c: New test.
	* gcc.test-framework/dg-dot-run-xif-exp-P.c: New test.
	* gcc.test-framework/dg-dot-run-xif-exp-XP.c: New test.
	* gcc.test-framework/test-framework.exp: Skip generated tests if
	CHECK_TEST_FRAMEWORK is not 1.

Index: gcc/testsuite/lib/target-supports-dg.exp
===================================================================
--- gcc/testsuite/lib/target-supports-dg.exp	(revision 107890)
+++ gcc/testsuite/lib/target-supports-dg.exp	(working copy)
@@ -183,7 +183,7 @@
 proc dg-skip-if { args } {
     set args [lreplace $args 0 0]
 
-    set selector "target [join [lindex $args 1]]"
+    set selector [list target [lindex $args 1]]
     if { [dg-process-target $selector] == "S" } {
 	# The target list matched; now check the flags.  The DejaGnu proc
 	# check_conditional_xfail will look at the options in compiler_flags,
@@ -223,7 +223,7 @@
     }
 
     set args [lreplace $args 0 0]
-    set selector "target [join [lindex $args 1]]"
+    set selector [list target [lindex $args 1]]
     if { [dg-process-target $selector] == "S" } {
 	global compiler_conditional_xfail_data
 	set compiler_conditional_xfail_data [lreplace $args 1 1 "*-*-*"]
--- /dev/null	2004-06-24 11:06:20.000000000 -0700
+++ gcc/testsuite/gcc.test-framework/dg-dot-run-sif-exp-P.c	2005-12-02 09:43:41.000000000 -0800
@@ -0,0 +1,8 @@
+/* { dg-do run { target { *-*-* && yes } } } */
+/* { dg-skip-if "comment" { no && yes } { "*" } { "" } } */
+
+int
+main ()
+{
+  return 0;
+}
--- /dev/null	2004-06-24 11:06:20.000000000 -0700
+++ gcc/testsuite/gcc.test-framework/dg-dot-run-sif-exp-U.c	2005-12-02 09:43:41.000000000 -0800
@@ -0,0 +1,8 @@
+/* { dg-do run { target { *-*-* || no } } } */
+/* { dg-skip-if "comment" { *-*-* && yes } { "*" } { "" } } */
+
+int
+main ()
+{
+  return 0;
+}
--- /dev/null	2004-06-24 11:06:20.000000000 -0700
+++ gcc/testsuite/gcc.test-framework/dg-dot-run-xif-exp-P.c	2005-12-02 09:43:41.000000000 -0800
@@ -0,0 +1,8 @@
+/* { dg-do run { target { *-*-* && yes } } } */
+/* { dg-xfail-if "comment" { empty-*-* && yes } { "*" } { "" } } */
+
+int
+main ()
+{
+  return 0;
+}
--- /dev/null	2004-06-24 11:06:20.000000000 -0700
+++ gcc/testsuite/gcc.test-framework/dg-dot-run-xif-exp-XP.c	2005-12-02 09:43:41.000000000 -0800
@@ -0,0 +1,8 @@
+/* { dg-do compile { target { *-*-* empty-*-* } } } */
+/* { dg-xfail-if "comment" { *-*-* && yes } { "*" } { "" } } */
+
+int
+main ()
+{
+  return 0;
+}
Index: gcc/testsuite/gcc.test-framework/test-framework.exp
===================================================================
--- gcc/testsuite/gcc.test-framework/test-framework.exp	(revision 107890)
+++ gcc/testsuite/gcc.test-framework/test-framework.exp	(working copy)
@@ -51,6 +51,12 @@
 # Run tests from the source directory.
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/dg-*.c]] "" ""
 
+# Skip generated tests unless CHECK_TEST_FRAMEWORK is 1.
+if { $env(CHECK_TEST_FRAMEWORK) != 1 } {
+    verbose "skipping generated test framework tests, CHECK_TEST_FRAMEWORK is not 1" 0
+    return
+}
+
 # Generate additional tests.
 set tstobjdir "$tmpdir/gcc.test-framework"
 set generator "$srcdir/$subdir/gen_directive_tests"


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