* gcc.target/i386/387-3.c, gcc.target/i386/387-4.c,
[official-gcc.git] / gcc / testsuite / gcc.test-framework / test-framework.exp
blob7fbfecf37b2c0092c4d7dc42e837923a12b98753
1 # Copyright (C) 2002-2014 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 3 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 # You should have received a copy of the GNU General Public License
14 # along with GCC; see the file COPYING3. If not see
15 # <http://www.gnu.org/licenses/>.
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
22 return
25 load_lib gcc-dg.exp
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 } {
38 return 1
41 proc check_effective_target_no { args } {
42 return 0
45 proc check_effective_target_def_nocache { } {
46 return [check_no_compiler_messages_nocache def_nocache object {
47 #ifdef DEFINED
48 int dummy;
49 #else
50 #error DEFINED is not defined
51 #endif
52 } [current_compiler_flags]]
55 global dg-do-what-default
56 set save-dg-do-what-default ${dg-do-what-default}
57 set dg-do-what-default compile
59 dg-init
61 # Run tests from the source directory.
62 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/dg-*.c]] "" ""
64 # Skip generated tests unless CHECK_TEST_FRAMEWORK is 1.
65 if { $env(CHECK_TEST_FRAMEWORK) != 1 } {
66 verbose "skipping generated test framework tests, CHECK_TEST_FRAMEWORK is not 1" 0
67 return
70 # Generate additional tests.
71 set tstobjdir "$tmpdir/gcc.test-framework"
72 set generator "$srcdir/$subdir/gen_directive_tests"
73 file delete -force $tstobjdir
74 file mkdir $tstobjdir
75 set status [remote_exec host "$generator $tstobjdir"]
76 set status [lindex $status 0]
77 if { $status == 0 } {
78 # Run the generated tests.
79 dg-runtest [lsort [find $tstobjdir *.c]] "" "-DY1 -DY2"
80 } else {
81 warning "Could not generate test framework tests"
84 dg-finish
85 set dg-do-what-default ${save-dg-do-what-default}