OSDN Git Service

* gcc.test-framework/README: Describe tests in source directory.
authorjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Feb 2005 17:37:25 +0000 (17:37 +0000)
committerjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Feb 2005 17:37:25 +0000 (17:37 +0000)
* 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

25 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.misc-tests/dg-1.c [deleted file]
gcc/testsuite/gcc.misc-tests/dg-10.c [deleted file]
gcc/testsuite/gcc.misc-tests/dg-2.c [deleted file]
gcc/testsuite/gcc.misc-tests/dg-3.c [deleted file]
gcc/testsuite/gcc.misc-tests/dg-test.exp [deleted file]
gcc/testsuite/gcc.test-framework/README
gcc/testsuite/gcc.test-framework/dg-bogus-exp-P.c [new file with mode: 0644]
gcc/testsuite/gcc.test-framework/dg-bogus-exp-XF.c [new file with mode: 0644]
gcc/testsuite/gcc.test-framework/dg-do-assemble-exp-P.c [new file with mode: 0644]
gcc/testsuite/gcc.test-framework/dg-do-compile-exp-P.c [new file with mode: 0644]
gcc/testsuite/gcc.test-framework/dg-do-link-exp-P.c [new file with mode: 0644]
gcc/testsuite/gcc.test-framework/dg-do-run-exp-P.c [moved from gcc/testsuite/gcc.misc-tests/dg-4.c with 53% similarity]
gcc/testsuite/gcc.test-framework/dg-dot-run-exp-P.c [moved from gcc/testsuite/gcc.misc-tests/dg-11.c with 68% similarity]
gcc/testsuite/gcc.test-framework/dg-dot-run-exp-U.c [moved from gcc/testsuite/gcc.misc-tests/dg-12.c with 80% similarity]
gcc/testsuite/gcc.test-framework/dg-dox-run-exp-XF.c [moved from gcc/testsuite/gcc.misc-tests/dg-7.c with 67% similarity]
gcc/testsuite/gcc.test-framework/dg-error-exp-P.c [new file with mode: 0644]
gcc/testsuite/gcc.test-framework/dg-error-exp-XP.c [new file with mode: 0644]
gcc/testsuite/gcc.test-framework/dg-excess-errors-exp-XF.c [moved from gcc/testsuite/gcc.misc-tests/dg-8.c with 69% similarity]
gcc/testsuite/gcc.test-framework/dg-excess-errors-exp-XP.c [new file with mode: 0644]
gcc/testsuite/gcc.test-framework/dg-output-exp-P.c [moved from gcc/testsuite/gcc.misc-tests/dg-5.c with 79% similarity]
gcc/testsuite/gcc.test-framework/dg-output-exp-XF.c [moved from gcc/testsuite/gcc.misc-tests/dg-6.c with 82% similarity]
gcc/testsuite/gcc.test-framework/dg-warning-exp-P.c [moved from gcc/testsuite/gcc.misc-tests/dg-9.c with 59% similarity]
gcc/testsuite/gcc.test-framework/test-framework.awk
gcc/testsuite/gcc.test-framework/test-framework.exp

index 7a3356c..1a394f2 100644 (file)
@@ -1,5 +1,38 @@
 2005-02-01  Janis Johnson  <janis187@us.ibm.com>
 
+       * 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 (file)
index 319f8a2..0000000
+++ /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 (file)
index 6d7b344..0000000
+++ /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 (file)
index bb40387..0000000
+++ /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 (file)
index 017ab27..0000000
+++ /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 (file)
index 820e28d..0000000
+++ /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
index 63fe9dc..3a9d4f0 100644 (file)
@@ -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 (file)
index 0000000..003264a
--- /dev/null
@@ -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 (file)
index 0000000..60c9147
--- /dev/null
@@ -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 (file)
index 0000000..3165720
--- /dev/null
@@ -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 (file)
index 0000000..9385746
--- /dev/null
@@ -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 (file)
index 0000000..254109e
--- /dev/null
@@ -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 { \}                                             } } */
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 806bdfb..a7f3ffa 100644 (file)
@@ -1,4 +1,4 @@
-/* Test the tester.  */
+/* Test the tester; previously gcc.misc-tests/dg-4.c.  */
 /* { dg-prms-id 42 } */
 /* { dg-do run } */
 
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 bfbba4d..3bbc4e1 100644 (file)
@@ -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[.]} } */
 
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 c6adbf5..9d79604 100644 (file)
@@ -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.  */
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 adde4cb..69cff8b 100644 (file)
@@ -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 (file)
index 0000000..cb28e34
--- /dev/null
@@ -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 (file)
index 0000000..856b727
--- /dev/null
@@ -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 *-*-* } } */
@@ -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 (file)
index 0000000..4aecca3
--- /dev/null
@@ -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; }
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 178fcb8..4cec76f 100644 (file)
@@ -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.  */
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 8323792..6606e5c 100644 (file)
@@ -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.  */
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 b228fff..293e119 100644 (file)
@@ -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" } */
index 90e76ca..3c7eedb 100644 (file)
@@ -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 } }
index 21cdc1f..8bc4ae7 100644 (file)
@@ -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}