Update Copyright years for files modified in 2011 and/or 2012.
[gcc.git] / libstdc++-v3 / testsuite / libstdc++-dg / conformance.exp
1 # Functional and regression tests in C++ for libstdc++.
2
3 # Copyright (C) 2001, 2002, 2003, 2004, 2009, 2010, 2011
4 # Free Software Foundation, Inc.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; see the file COPYING3. If not see
18 # <http://www.gnu.org/licenses/>.
19
20 # libstdc++-v3 testsuite that uses the 'dg.exp' driver.
21
22 # Initialization.
23 dg-init
24
25 # Build the support objects.
26 v3-build_support
27
28 set tests [list]
29
30 # If there is a "testsuite_files" file, use it.
31 #
32 # This is a workaround for problems reported with using:
33 #
34 # runtest normal.exp="`cat testsuite_files`"
35 #
36 # See:
37 # http://gcc.gnu.org/ml/libstdc++/2005-03/msg00278.html
38 # for discussion of the problem.
39 #
40 # If that worked consistently, we could modify "make check" to
41 # pass that option, and then remove this code.
42 if {[info exists blddir]} {
43 set tests_file "${blddir}/testsuite/testsuite_files"
44 }
45 if {[info exists tests_file] && [file exists $tests_file]} {
46 set f [open $tests_file]
47 while { ! [eof $f] } {
48 set t [gets $f]
49 if { [string length "$t"] != 0 } {
50 lappend tests ${srcdir}/${t}
51 }
52 }
53 close $f
54 } else {
55 # Find directories that might have tests.
56 set subdirs [glob "$srcdir/\[0-9\]\[0-9\]*"]
57 lappend subdirs "$srcdir/abi"
58 lappend subdirs "$srcdir/backward"
59 lappend subdirs "$srcdir/ext"
60 lappend subdirs "$srcdir/performance"
61 lappend subdirs "$srcdir/tr1"
62 lappend subdirs "$srcdir/tr2"
63 lappend subdirs "$srcdir/decimal"
64 verbose "subdirs are $subdirs"
65
66 # Find all the tests.
67 foreach s $subdirs {
68 set subdir_tests [find $s *.cc]
69 set subdir_tests_c [find $s *.c]
70 foreach e $subdir_tests_c {
71 lappend subdir_tests $e
72 }
73
74 # Filter out tests that should not be run.
75 foreach t $subdir_tests {
76 # The DejaGNU "find" procedure sometimes returns a list
77 # containing an empty string, when it should really return
78 # an empty list.
79 if { $t == "" } {
80 continue
81 }
82 # Filter out:
83 # 0. utilities, other parts of the testing infrastructure.
84 # 1. interactive tests.
85 # 2. performance tests.
86 # 3. wchar_t tests, if not supported.
87 # 4. thread tests, if not supported.
88 # 5. *_filebuf, if file I/O is not supported.
89 if { [string first _xin $t] == -1
90 && [string first performance $t] == -1
91 && (${v3-wchar_t} || [string first wchar_t $t] == -1)
92 && (${v3-threads} || [string first thread $t] == -1)
93 && ([string first "_filebuf" $t] == -1
94 || [check_v3_target_fileio]) } {
95 lappend tests $t
96 }
97 }
98 }
99 }
100 set tests [lsort $tests]
101
102 # Main loop.
103 global DEFAULT_CXXFLAGS
104 global PCH_CXXFLAGS
105 dg-runtest $tests "" "$DEFAULT_CXXFLAGS $PCH_CXXFLAGS"
106
107 # All done.
108 dg-finish