]>
Commit | Line | Data |
---|---|---|
cddfb1c7 | 1 | # Functional and regression tests in C++ for libstdc++. |
c66ce1f5 | 2 | |
a945c346 | 3 | # Copyright (C) 2001-2024 Free Software Foundation, Inc. |
23834577 | 4 | # |
c66ce1f5 BK |
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 | |
748086b7 | 7 | # the Free Software Foundation; either version 3 of the License, or |
c66ce1f5 | 8 | # (at your option) any later version. |
bd3d7e11 | 9 | # |
c66ce1f5 BK |
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. | |
bd3d7e11 | 14 | # |
c66ce1f5 | 15 | # You should have received a copy of the GNU General Public License |
748086b7 JJ |
16 | # along with this program; see the file COPYING3. If not see |
17 | # <http://www.gnu.org/licenses/>. | |
c66ce1f5 BK |
18 | |
19 | # libstdc++-v3 testsuite that uses the 'dg.exp' driver. | |
20 | ||
70a84160 BK |
21 | # Initialization. |
22 | dg-init | |
c66ce1f5 | 23 | |
bd3d7e11 | 24 | |
0b3deaaf | 25 | # Build the support objects. |
0b694555 | 26 | v3-build_support |
0b3deaaf | 27 | |
0b3deaaf | 28 | set tests [list] |
a53ed3de MM |
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] | |
a923c529 | 47 | verbose -log "reading test files from $tests_file" 1 |
a53ed3de MM |
48 | while { ! [eof $f] } { |
49 | set t [gets $f] | |
50 | if { [string length "$t"] != 0 } { | |
51 | lappend tests ${srcdir}/${t} | |
0b3deaaf | 52 | } |
bd3d7e11 | 53 | } |
a53ed3de MM |
54 | close $f |
55 | } else { | |
56 | # Find directories that might have tests. | |
78ef03b7 | 57 | # This list should be consistent with scripts/create_testsuite_files |
a53ed3de | 58 | set subdirs [glob "$srcdir/\[0-9\]\[0-9\]*"] |
cfc219ae | 59 | lappend subdirs "$srcdir/std" |
3c6430a3 | 60 | lappend subdirs "$srcdir/abi" |
3416d7cd | 61 | lappend subdirs "$srcdir/backward" |
3416d7cd BK |
62 | lappend subdirs "$srcdir/ext" |
63 | lappend subdirs "$srcdir/performance" | |
3c6430a3 | 64 | lappend subdirs "$srcdir/tr1" |
4daba884 | 65 | lappend subdirs "$srcdir/tr2" |
4cdc8761 | 66 | lappend subdirs "$srcdir/decimal" |
2b5ab1e4 | 67 | lappend subdirs "$srcdir/experimental" |
2be75957 | 68 | lappend subdirs "$srcdir/special_functions" |
3416d7cd BK |
69 | verbose "subdirs are $subdirs" |
70 | ||
a53ed3de MM |
71 | # Find all the tests. |
72 | foreach s $subdirs { | |
73 | set subdir_tests [find $s *.cc] | |
cddfb1c7 BK |
74 | set subdir_tests_c [find $s *.c] |
75 | foreach e $subdir_tests_c { | |
76 | lappend subdir_tests $e | |
77 | } | |
78 | ||
a53ed3de MM |
79 | # Filter out tests that should not be run. |
80 | foreach t $subdir_tests { | |
bd3d7e11 | 81 | # The DejaGNU "find" procedure sometimes returns a list |
a53ed3de MM |
82 | # containing an empty string, when it should really return |
83 | # an empty list. | |
84 | if { $t == "" } { | |
85 | continue | |
86 | } | |
87 | # Filter out: | |
3416d7cd | 88 | # 0. utilities, other parts of the testing infrastructure. |
a53ed3de MM |
89 | # 1. interactive tests. |
90 | # 2. performance tests. | |
91 | # 3. wchar_t tests, if not supported. | |
bd3d7e11 | 92 | # 4. thread tests, if not supported. |
38851a96 | 93 | # 5. *_filebuf, if file I/O is not supported. |
2bcceb6f | 94 | # 6. simd tests. |
a53ed3de MM |
95 | if { [string first _xin $t] == -1 |
96 | && [string first performance $t] == -1 | |
bd3d7e11 JW |
97 | && (${v3-wchar_t} || [string first wchar_t $t] == -1) |
98 | && (${v3-threads} || [string first thread $t] == -1) | |
38851a96 | 99 | && ([string first "_filebuf" $t] == -1 |
2bcceb6f MK |
100 | || [check_v3_target_fileio]) |
101 | && [string first "/experimental/simd/" $t] == -1 } { | |
a53ed3de MM |
102 | lappend tests $t |
103 | } | |
0b3deaaf MM |
104 | } |
105 | } | |
106 | } | |
107 | set tests [lsort $tests] | |
108 | ||
c66ce1f5 | 109 | # Main loop. |
23834577 | 110 | global DEFAULT_CXXFLAGS |
8b60fb43 | 111 | global PCH_CXXFLAGS |
3a0e01f6 JW |
112 | # Modified version of dg-runtest |
113 | v3-dg-runtest $tests "" "$DEFAULT_CXXFLAGS $PCH_CXXFLAGS" | |
c66ce1f5 | 114 | |
2bcceb6f MK |
115 | # Finally run simd tests with extra SIMD-relevant flags |
116 | global DEFAULT_VECTCFLAGS | |
117 | global EFFECTIVE_TARGETS | |
118 | set DEFAULT_VECTCFLAGS "" | |
119 | set EFFECTIVE_TARGETS "" | |
120 | ||
121 | if [check_vect_support_and_set_flags] { | |
122 | lappend DEFAULT_VECTCFLAGS "-O2" | |
123 | lappend DEFAULT_VECTCFLAGS "-Wno-psabi" | |
124 | et-dg-runtest dg-runtest [lsort \ | |
125 | [glob -nocomplain $srcdir/experimental/simd/*.cc]] \ | |
126 | "$DEFAULT_VECTCFLAGS" "$DEFAULT_CXXFLAGS $PCH_CXXFLAGS" | |
127 | } | |
128 | ||
c66ce1f5 BK |
129 | # All done. |
130 | dg-finish |