From: janis Date: Tue, 1 Feb 2005 17:37:25 +0000 (+0000) Subject: * gcc.test-framework/README: Describe tests in source directory. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=c7d010f2a6166ee00638f2eb0038150367e89b08 * gcc.test-framework/README: Describe tests in source directory. * gcc.test-framework/test-framework.awk: Handle dg- tests. * gcc.test-framework/test-framework.exp: Handle dg- tests. * gcc.test-framework/dg-bogus-exp-P.c: New test. * gcc.test-framework/dg-bogus-exp-XF.c: New test. * gcc.test-framework/dg-do-assemble-exp-P.c: New test. * gcc.test-framework/dg-do-compile-exp-P.c: New test. * gcc.test-framework/dg-do-link-exp-P.c: New test. * gcc.test-framework/dg-do-run-exp-P.c: New test. * gcc.test-framework/dg-dot-run-exp-P.c: New test. * gcc.test-framework/dg-dot-run-exp-U.c: New test. * gcc.test-framework/dg-dox-run-exp-XF.c: New test. * gcc.test-framework/dg-error-exp-P.c: New test. * gcc.test-framework/dg-error-exp-XP.c: New test. * gcc.test-framework/dg-excess-errors-exp-XF.c: New test. * gcc.test-framework/dg-excess-errors-exp-XP.c: New test. * gcc.test-framework/dg-output-exp-P.c: New test. * gcc.test-framework/dg-output-exp-XF.c: New test. * gcc.test-framework/dg-warning-exp-P.c: New test. * gcc.misc-tests/dg-1.c: Remove. * gcc.misc-tests/dg-2.c: Remove. * gcc.misc-tests/dg-3.c: Remove. * gcc.misc-tests/dg-4.c: Remove. * gcc.misc-tests/dg-5.c: Remove. * gcc.misc-tests/dg-6.c: Remove. * gcc.misc-tests/dg-7.c: Remove. * gcc.misc-tests/dg-8.c: Remove. * gcc.misc-tests/dg-9.c: Remove. * gcc.misc-tests/dg-10.c: Remove. * gcc.misc-tests/dg-11.c: Remove. * gcc.misc-tests/dg-12.c: Remove. * gcc.misc-tests/dg-test.exp: Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94550 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7a3356c3677..1a394f2fef1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,38 @@ 2005-02-01 Janis Johnson + * gcc.test-framework/README: Describe tests in source directory. + * gcc.test-framework/test-framework.awk: Handle dg- tests. + * gcc.test-framework/test-framework.exp: Handle dg- tests. + * gcc.test-framework/dg-bogus-exp-P.c: New test. + * gcc.test-framework/dg-bogus-exp-XF.c: New test. + * gcc.test-framework/dg-do-assemble-exp-P.c: New test. + * gcc.test-framework/dg-do-compile-exp-P.c: New test. + * gcc.test-framework/dg-do-link-exp-P.c: New test. + * gcc.test-framework/dg-do-run-exp-P.c: New test. + * gcc.test-framework/dg-dot-run-exp-P.c: New test. + * gcc.test-framework/dg-dot-run-exp-U.c: New test. + * gcc.test-framework/dg-dox-run-exp-XF.c: New test. + * gcc.test-framework/dg-error-exp-P.c: New test. + * gcc.test-framework/dg-error-exp-XP.c: New test. + * gcc.test-framework/dg-excess-errors-exp-XF.c: New test. + * gcc.test-framework/dg-excess-errors-exp-XP.c: New test. + * gcc.test-framework/dg-output-exp-P.c: New test. + * gcc.test-framework/dg-output-exp-XF.c: New test. + * gcc.test-framework/dg-warning-exp-P.c: New test. + * gcc.misc-tests/dg-1.c: Remove. + * gcc.misc-tests/dg-2.c: Remove. + * gcc.misc-tests/dg-3.c: Remove. + * gcc.misc-tests/dg-4.c: Remove. + * gcc.misc-tests/dg-5.c: Remove. + * gcc.misc-tests/dg-6.c: Remove. + * gcc.misc-tests/dg-7.c: Remove. + * gcc.misc-tests/dg-8.c: Remove. + * gcc.misc-tests/dg-9.c: Remove. + * gcc.misc-tests/dg-10.c: Remove. + * gcc.misc-tests/dg-11.c: Remove. + * gcc.misc-tests/dg-12.c: Remove. + * gcc.misc-tests/dg-test.exp: Remove. + * gcc.test-framework/test-framework.awk: Change recording and printing of passes and failures. diff --git a/gcc/testsuite/gcc.misc-tests/dg-1.c b/gcc/testsuite/gcc.misc-tests/dg-1.c deleted file mode 100644 index 319f8a20a7b..00000000000 --- a/gcc/testsuite/gcc.misc-tests/dg-1.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Test the tester. */ -/* { dg-prms-id 42 } */ -/* { dg-do compile } */ - -main () { return 0; } - -/* { dg-final { if ![file exists dg-1.s] { fail "dg-1.c (compile)"; return; } } } */ - -/* { dg-final { set tmp [grep dg-1.s main line] } } */ -/* { dg-final { if ![string match "" $tmp] \{ } } */ -/* { dg-final { pass "dg-1.c (main function present)" } } */ -/* { dg-final { \} else \{ } } */ -/* { dg-final { fail "dg-1.c (main function not present)" } } */ -/* { dg-final { \} } } */ diff --git a/gcc/testsuite/gcc.misc-tests/dg-10.c b/gcc/testsuite/gcc.misc-tests/dg-10.c deleted file mode 100644 index 6d7b3441623..00000000000 --- a/gcc/testsuite/gcc.misc-tests/dg-10.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Test the tester. */ -/* { dg-prms-id 42 } */ -/* { dg-options "-Wall" } */ - -/* FIXME: we want to test dg-lose here. Anyone know of a good way to - crash the compiler? */ - -int -main (int argc, char *argv[]) -{ - return 0; -} diff --git a/gcc/testsuite/gcc.misc-tests/dg-2.c b/gcc/testsuite/gcc.misc-tests/dg-2.c deleted file mode 100644 index bb40387e632..00000000000 --- a/gcc/testsuite/gcc.misc-tests/dg-2.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Test the tester. */ -/* { dg-prms-id 42 } */ -/* { dg-do assemble } */ - -main () { return 0; } - -/* { dg-final { if [file exists dg-2.o] \{ } } */ -/* { dg-final { pass "dg-2.c (assemble: produce .o test)" } } */ -/* { dg-final { \} else \{ } } */ -/* { dg-final { fail "dg-2.c (assemble: produce .o test)" } } */ -/* { dg-final { \} } } */ diff --git a/gcc/testsuite/gcc.misc-tests/dg-3.c b/gcc/testsuite/gcc.misc-tests/dg-3.c deleted file mode 100644 index 017ab279f8e..00000000000 --- a/gcc/testsuite/gcc.misc-tests/dg-3.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Test the tester. */ -/* { dg-prms-id 42 } */ -/* { dg-do link } */ - -main () { return 0; } - -/* { dg-final { if [file exists a.out] \{ } } */ -/* { dg-final { pass "dg-2.c (link: produce a.out test)" } } */ -/* { dg-final { \} else \{ } } */ -/* { dg-final { fail "dg-2.c (link: produce a.out test)" } } */ -/* { dg-final { \} } } */ diff --git a/gcc/testsuite/gcc.misc-tests/dg-test.exp b/gcc/testsuite/gcc.misc-tests/dg-test.exp deleted file mode 100644 index 820e28de471..00000000000 --- a/gcc/testsuite/gcc.misc-tests/dg-test.exp +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (C) 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# Test the dg.exp driver. -# This is a testsuite tester tester. As such we *want* to test things like -# expected failure handling. But expected failures must continually be -# monitored and so in the normal case we create unnecessary work. So only -# run these tests if DG_TEST is defined to "yes". - -global DG_TEST -if { ![info exists DG_TEST] || "$DG_TEST" != "yes" } { - return -} - -# Load support procs. -load_lib gcc-dg.exp - -# Initialize harness. -dg-init - -# Main loop. -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/dg-*.c]] "" "" - -# All done. -dg-finish diff --git a/gcc/testsuite/gcc.test-framework/README b/gcc/testsuite/gcc.test-framework/README index 63fe9dc5515..3a9d4f086af 100644 --- a/gcc/testsuite/gcc.test-framework/README +++ b/gcc/testsuite/gcc.test-framework/README @@ -1,10 +1,11 @@ Check the test directives used in GCC's testsuite by generating and running tests that use combinations of those commands or that stress -the selector expressions that can be used in those directives. +the selector expressions that can be used in those directives. Also +run a few tests of specific functionality from the source directory. -Each test has two parts: a file ending in "-1.c" whose expected result -is encoded in the filename after "-exp-", and a file ending in "-2.c" -which is always expected to pass. +Each generated test has two parts: a file ending in "-1.c" whose +expected result is encoded in the filename after "-exp-", and a file +ending in "-2.c" which is always expected to pass. This test directory is normally skipped and is not meant to be run at the same time as other parts of the testsuite; it's only of interest to @@ -21,4 +22,4 @@ To check the results: awk -f ${TF}/test-framework.awk gcc/testsuite/gcc.sum The awk script prints unexpected results followed by the number of tests -that passed. +that passed and failed. diff --git a/gcc/testsuite/gcc.test-framework/dg-bogus-exp-P.c b/gcc/testsuite/gcc.test-framework/dg-bogus-exp-P.c new file mode 100644 index 00000000000..003264a72df --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-bogus-exp-P.c @@ -0,0 +1,8 @@ +/* Test the tester; previously part of gcc.misc-tests/dg-9.c. */ +/* { dg-prms-id 42 } */ +/* { dg-options "-Wall" } */ + +int main (int argc, char *argv[]) +{ + return 0; /* { dg-bogus "foobar" "bogus fail test" } */ +} diff --git a/gcc/testsuite/gcc.test-framework/dg-bogus-exp-XF.c b/gcc/testsuite/gcc.test-framework/dg-bogus-exp-XF.c new file mode 100644 index 00000000000..60c9147af6e --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-bogus-exp-XF.c @@ -0,0 +1,9 @@ +/* Test the tester; previously part of gcc.misc-tests/dg-9.c. */ +/* { dg-prms-id 42 } */ +/* { dg-options "-Wall" } */ + +main (int argc, char *argv[]) +{ /* { dg-bogus "return type" "bogus pass test" { xfail *-*-* } } */ +} + +/* { dg-excess-errors "bogus pass test" { xfail *-*-* } } */ diff --git a/gcc/testsuite/gcc.test-framework/dg-do-assemble-exp-P.c b/gcc/testsuite/gcc.test-framework/dg-do-assemble-exp-P.c new file mode 100644 index 00000000000..316572092a6 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-do-assemble-exp-P.c @@ -0,0 +1,11 @@ +/* Test the tester; previously gcc.misc-tests/dg-2.c. */ +/* { dg-prms-id 42 } */ +/* { dg-do assemble } */ + +main () { return 0; } + +/* { dg-final { if [file exists dg-do-assemble-exp-P.o] \{ } } */ +/* { dg-final { pass "dg-do-assemble-exp-P.c (assemble: produce .o test)" } } */ +/* { dg-final { \} else \{ } } */ +/* { dg-final { fail "dg-do-assemble-exp-P.c (assemble: produce .o test)" } } */ +/* { dg-final { \} } } */ diff --git a/gcc/testsuite/gcc.test-framework/dg-do-compile-exp-P.c b/gcc/testsuite/gcc.test-framework/dg-do-compile-exp-P.c new file mode 100644 index 00000000000..93857465a16 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-do-compile-exp-P.c @@ -0,0 +1,14 @@ +/* Test the tester; previously gcc.misc-tests/dg-1.c. */ +/* { dg-prms-id 42 } */ +/* { dg-do compile } */ + +main () { return 0; } + +/* { dg-final { if ![file exists dg-do-compile-exp-P.s] { fail "dg-do-compile-exp-P.c (compile)"; return; } } } */ + +/* { dg-final { set tmp [grep dg-do-compile-exp-P.s main line] } } */ +/* { dg-final { if ![string match "" $tmp] \{ } } */ +/* { dg-final { pass "dg-do-compile-exp-P.c (main function present)" } } */ +/* { dg-final { \} else \{ } } */ +/* { dg-final { fail "dg-do-compile-exp-P.c (main function not present)" } } */ +/* { dg-final { \} } } */ diff --git a/gcc/testsuite/gcc.test-framework/dg-do-link-exp-P.c b/gcc/testsuite/gcc.test-framework/dg-do-link-exp-P.c new file mode 100644 index 00000000000..254109e6526 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-do-link-exp-P.c @@ -0,0 +1,11 @@ +/* Test the tester; previously gcc.misc-tests/dg-3.c. */ +/* { dg-prms-id 42 } */ +/* { dg-do link } */ + +main () { return 0; } + +/* { dg-final { if [file exists dg-do-link-exp-P.exe] \{ } } */ +/* { dg-final { pass "dg-do-link-exp-P.c (link: produce a.out test)" } } */ +/* { dg-final { \} else \{ } } */ +/* { dg-final { fail "dg-do-link-exp-P.c (link: produce a.out test)" } } */ +/* { dg-final { \} } } */ diff --git a/gcc/testsuite/gcc.misc-tests/dg-4.c b/gcc/testsuite/gcc.test-framework/dg-do-run-exp-P.c similarity index 53% rename from gcc/testsuite/gcc.misc-tests/dg-4.c rename to gcc/testsuite/gcc.test-framework/dg-do-run-exp-P.c index 806bdfbf91a..a7f3ffa680a 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-4.c +++ b/gcc/testsuite/gcc.test-framework/dg-do-run-exp-P.c @@ -1,4 +1,4 @@ -/* Test the tester. */ +/* Test the tester; previously gcc.misc-tests/dg-4.c. */ /* { dg-prms-id 42 } */ /* { dg-do run } */ diff --git a/gcc/testsuite/gcc.misc-tests/dg-11.c b/gcc/testsuite/gcc.test-framework/dg-dot-run-exp-P.c similarity index 68% rename from gcc/testsuite/gcc.misc-tests/dg-11.c rename to gcc/testsuite/gcc.test-framework/dg-dot-run-exp-P.c index bfbba4d1216..3bbc4e1bd40 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-11.c +++ b/gcc/testsuite/gcc.test-framework/dg-dot-run-exp-P.c @@ -1,6 +1,6 @@ -/* Test the tester. */ +/* Test the tester; previously gcc.misc-tests/dg-11.c. */ /* { dg-prms-id 42 } */ -/* { dg-do run { target sparc-sun-solaris2* } } */ +/* { dg-do run { target *-*-* } } */ /* The \n is left out of the pattern because tcl's exec will remove it. */ /* { dg-output {Hello world[.]} } */ diff --git a/gcc/testsuite/gcc.misc-tests/dg-12.c b/gcc/testsuite/gcc.test-framework/dg-dot-run-exp-U.c similarity index 80% rename from gcc/testsuite/gcc.misc-tests/dg-12.c rename to gcc/testsuite/gcc.test-framework/dg-dot-run-exp-U.c index c6adbf53d95..9d79604b226 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-12.c +++ b/gcc/testsuite/gcc.test-framework/dg-dot-run-exp-U.c @@ -1,4 +1,4 @@ -/* Test the tester. */ +/* Test the tester; previously gcc.misc-tests/dg-12.c. */ /* { dg-prms-id 42 } */ /* { dg-do run { target foo-bar-eh } } */ /* The \n is left out of the pattern because tcl's exec will remove it. */ diff --git a/gcc/testsuite/gcc.misc-tests/dg-7.c b/gcc/testsuite/gcc.test-framework/dg-dox-run-exp-XF.c similarity index 67% rename from gcc/testsuite/gcc.misc-tests/dg-7.c rename to gcc/testsuite/gcc.test-framework/dg-dox-run-exp-XF.c index adde4cb60d2..69cff8bb8e3 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-7.c +++ b/gcc/testsuite/gcc.test-framework/dg-dox-run-exp-XF.c @@ -1,4 +1,4 @@ -/* Test the tester. */ +/* Test the tester; previously gcc.misc-tests/dg-7.c. */ /* { dg-prms-id 42 } */ /* { dg-do run { xfail *-*-* } } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.test-framework/dg-error-exp-P.c b/gcc/testsuite/gcc.test-framework/dg-error-exp-P.c new file mode 100644 index 00000000000..cb28e34ce95 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-error-exp-P.c @@ -0,0 +1,9 @@ +/* Test the tester; previously part of gcc.misc-tests/dg-9.c. */ +/* { dg-prms-id 42 } */ +/* { dg-options "-Wall" } */ + +int main (int argc, char *argv[]) +{ + +; /* { dg-error "syntax error" "error test" } */ + return 0; +} diff --git a/gcc/testsuite/gcc.test-framework/dg-error-exp-XP.c b/gcc/testsuite/gcc.test-framework/dg-error-exp-XP.c new file mode 100644 index 00000000000..856b7270b25 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-error-exp-XP.c @@ -0,0 +1,11 @@ +/* Test the tester; previously part of gcc.misc-tests/dg-9.c. */ +/* { dg-prms-id 42 } */ +/* { dg-options "-Wall" } */ + +int main (int argc, char *argv[]) +{ + +; + /* { dg-error "syntax error" "error test" { xfail *-*-* } 7 } */ + return 0; +} +/* { dg-excess-errors "expect failure" { xfail *-*-* } } */ diff --git a/gcc/testsuite/gcc.misc-tests/dg-8.c b/gcc/testsuite/gcc.test-framework/dg-excess-errors-exp-XF.c similarity index 69% rename from gcc/testsuite/gcc.misc-tests/dg-8.c rename to gcc/testsuite/gcc.test-framework/dg-excess-errors-exp-XF.c index 63a5b0e73fa..496c6a60d50 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-8.c +++ b/gcc/testsuite/gcc.test-framework/dg-excess-errors-exp-XF.c @@ -1,7 +1,7 @@ -/* Test the tester. */ +/* Test the tester; previously gcc.misc-tests/dg-8.c. */ /* { dg-prms-id 42 } */ /* { dg-options "-Wall" } */ -/* { dg-do run } */ +/* { dg-do compile } */ /* { dg-excess-errors "excess errors" } */ /* should get warning about defaulting return type - excess error */ diff --git a/gcc/testsuite/gcc.test-framework/dg-excess-errors-exp-XP.c b/gcc/testsuite/gcc.test-framework/dg-excess-errors-exp-XP.c new file mode 100644 index 00000000000..4aecca3ba34 --- /dev/null +++ b/gcc/testsuite/gcc.test-framework/dg-excess-errors-exp-XP.c @@ -0,0 +1,9 @@ +/* Test the tester. */ +/* { dg-prms-id 42 } */ +/* { dg-options "-Wall" } */ +/* { dg-do compile } */ +/* { dg-excess-errors "excess errors" } */ + +/* No messages, so unexpected pass. */ + +int main () { return 0; } diff --git a/gcc/testsuite/gcc.misc-tests/dg-5.c b/gcc/testsuite/gcc.test-framework/dg-output-exp-P.c similarity index 79% rename from gcc/testsuite/gcc.misc-tests/dg-5.c rename to gcc/testsuite/gcc.test-framework/dg-output-exp-P.c index 178fcb85a4d..4cec76f982c 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-5.c +++ b/gcc/testsuite/gcc.test-framework/dg-output-exp-P.c @@ -1,4 +1,4 @@ -/* Test the tester. */ +/* Test the tester; previously gcc.misc-tests/dg-5.c. */ /* { dg-prms-id 42 } */ /* { dg-do run } */ /* The \n is left out of the pattern because tcl's exec will remove it. */ diff --git a/gcc/testsuite/gcc.misc-tests/dg-6.c b/gcc/testsuite/gcc.test-framework/dg-output-exp-XF.c similarity index 82% rename from gcc/testsuite/gcc.misc-tests/dg-6.c rename to gcc/testsuite/gcc.test-framework/dg-output-exp-XF.c index 8323792c918..6606e5c932a 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-6.c +++ b/gcc/testsuite/gcc.test-framework/dg-output-exp-XF.c @@ -1,4 +1,4 @@ -/* Test the tester. */ +/* Test the tester; previously gcc.misc-tests/dg-6.c. */ /* { dg-prms-id 42 } */ /* { dg-do run { target *-*-* } } */ /* The \n is left out of the pattern because tcl's exec will remove it. */ diff --git a/gcc/testsuite/gcc.misc-tests/dg-9.c b/gcc/testsuite/gcc.test-framework/dg-warning-exp-P.c similarity index 59% rename from gcc/testsuite/gcc.misc-tests/dg-9.c rename to gcc/testsuite/gcc.test-framework/dg-warning-exp-P.c index b228fff7437..293e1194df4 100644 --- a/gcc/testsuite/gcc.misc-tests/dg-9.c +++ b/gcc/testsuite/gcc.test-framework/dg-warning-exp-P.c @@ -1,4 +1,4 @@ -/* Test the tester. */ +/* Test the tester; previously part of gcc.misc-tests/dg-9.c. */ /* { dg-prms-id 42 } */ /* { dg-options "-Wall" } */ @@ -8,8 +8,4 @@ f () main (int argc, char *argv[]) { /* { dg-warning "return type" "warning test" } */ - +; /* { dg-error "parse" "error test" } */ - /* { dg-bogus "foobar" "bogus fail test" } */ - - return a; /* { dg-bogus "undeclared|identifier|appears" "bogus pass test" { xfail *-*-* } } */ } /* { dg-warning "control reaches end" "warning test" } */ diff --git a/gcc/testsuite/gcc.test-framework/test-framework.awk b/gcc/testsuite/gcc.test-framework/test-framework.awk index 90e76ca94b4..3c7eedb954a 100644 --- a/gcc/testsuite/gcc.test-framework/test-framework.awk +++ b/gcc/testsuite/gcc.test-framework/test-framework.awk @@ -47,6 +47,10 @@ BEGIN { skip = 1; passes = 0; fails = 0; } /^PASS.*dox.*(test for excess errors)/ { ignore(); next } # Ignore lines that begin with comma. /^,/ { ignore(); next } +# For tests of dg-output, ignore successful compilation. +/^PASS.*dg-output.*(test for excess error)/ { ignore(); next } +# For tests of dg-output, ignore successful execution. +/^PASS.*dg-output.*execution test/ { ignore(); next } /^PASS/ { if (match ($0, "exp-P")) { pass(); next } } /^FAIL/ { if (match ($0, "exp-F")) { pass(); next } } /^XPASS/ { if (match ($0, "exp-XP")) { pass(); next } } diff --git a/gcc/testsuite/gcc.test-framework/test-framework.exp b/gcc/testsuite/gcc.test-framework/test-framework.exp index 21cdc1fb0b4..8bc4ae78502 100644 --- a/gcc/testsuite/gcc.test-framework/test-framework.exp +++ b/gcc/testsuite/gcc.test-framework/test-framework.exp @@ -46,8 +46,12 @@ global dg-do-what-default set save-dg-do-what-default ${dg-do-what-default} set dg-do-what-default compile -# Generate the tests. +dg-init +# Run tests from the source directory. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/dg-*.c]] "" "" + +# Generate additional tests. set tstobjdir "$tmpdir/gcc.test-framework" set generator "$srcdir/$subdir/gen_directive_tests" file delete -force $tstobjdir @@ -55,12 +59,11 @@ file mkdir $tstobjdir set status [remote_exec host "$generator $tstobjdir"] set status [lindex $status 0] if { $status == 0 } { - # Run the tests. - dg-init + # Run the generated tests. dg-runtest [lsort [find $tstobjdir *.c]] "" "-DY1 -DY2" - dg-finish } else { warning "Could not generate test framework tests" } +dg-finish set dg-do-what-default ${save-dg-do-what-default}