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