1 # Copyright
(c
) 2002, 2003, 2004, 2005 Free Software Foundation
, Inc.
3 # This file is free software
; you can redistribute it and
/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation
; either version
2 of the License
, or
6 #
(at your option
) any later version.
8 # This
program is distributed in the hope that it will be useful
,
9 # but WITHOUT
ANY WARRANTY
; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License
for more details.
13 #
For a copy of the GNU General Public License
, write the the
14 # Free Software Foundation
, Inc.
, 51 Franklin Street
, Fifth Floor
,
15 # Boston
, MA
02110-1301, USA.
17 # Based
on gcc
/testsuite
/gcc.dg
/dg.exp.
19 # Don
't run these tests unless an environment variable is defined.
20 if { ![info exists env(CHECK_TEST_FRAMEWORK)] } {
21 verbose "skipping test framework tests, CHECK_TEST_FRAMEWORK is not defined" 0
27 proc dg-require-true { args } {
28 verbose "dg-require-true" 2
31 proc dg-require-false { args } {
32 verbose "dg-require-false" 2
33 upvar dg-do-what dg-do-what
34 set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
37 proc check_effective_target_yes { args } {
41 proc check_effective_target_no { args } {
45 global dg-do-what-default
46 set save-dg-do-what-default ${dg-do-what-default}
47 set dg-do-what-default compile
51 # Run tests from the source directory.
52 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/dg-*.c]] "" ""
54 # Skip generated tests unless CHECK_TEST_FRAMEWORK is 1.
55 if { $env(CHECK_TEST_FRAMEWORK) != 1 } {
56 verbose "skipping generated test framework tests, CHECK_TEST_FRAMEWORK is not 1" 0
60 # Generate additional tests.
61 set tstobjdir "$tmpdir/gcc.test-framework"
62 set generator "$srcdir/$subdir/gen_directive_tests"
63 file delete -force $tstobjdir
65 set status [remote_exec host "$generator $tstobjdir"]
66 set status [lindex $status 0]
68 # Run the generated tests.
69 dg-runtest [lsort [find $tstobjdir *.c]] "" "-DY1 -DY2"
71 warning "Could not generate test framework tests"
75 set dg-do-what-default ${save-dg-do-what-default}