OSDN Git Service

* testsuite/lib/libstdc++.exp: Load target-supports-dg.exp.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / Makefile.am
1 ## Makefile for the testsuite subdirectory of the GNU C++ Standard library.
2 ##
3 ## Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
4 ##
5 ## This file is part of the libstdc++ version 3 distribution.
6 ## Process this file with automake to produce Makefile.in.
7
8 ## This file is part of the GNU ISO C++ Library.  This library is free
9 ## software; you can redistribute it and/or modify it under the
10 ## terms of the GNU General Public License as published by the
11 ## Free Software Foundation; either version 2, or (at your option)
12 ## any later version.
13
14 ## This library is distributed in the hope that it will be useful,
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ## GNU General Public License for more details.
18
19 ## You should have received a copy of the GNU General Public License along
20 ## with this library; see the file COPYING.  If not, write to the Free
21 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
22 ## USA.
23
24 AUTOMAKE_OPTIONS = dejagnu nostdinc
25
26 include $(top_srcdir)/fragment.am
27
28 AM_MAKEFLAGS = -j1
29 AM_RUNTESTFLAGS =
30
31 ## CXX is actually a "C" compiler. These are real C++ programs.
32 testsuite_flags_script=${glibcxx_builddir}/scripts/testsuite_flags
33 CXX         = $(shell ${testsuite_flags_script} --build-cxx)
34 GLIBCXX_INCLUDES = $(shell ${testsuite_flags_script} --build-includes)
35 AM_CXXFLAGS = $(shell ${testsuite_flags_script} --cxxflags)
36
37 GLIBGCC_DIR=`$(CC) -print-libgcc-file-name | sed 's,/[^/]*$$,,'`
38 GLIBCXX_DIR=${glibcxx_builddir}/src/.libs
39
40 CXXLINK = \
41         $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
42         -R $(GLIBGCC_DIR) -R $(GLIBCXX_DIR) \
43         $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -lv3test -L. -o $@
44
45 ## Build support library.
46 noinst_LIBRARIES = libv3test.a
47 libv3test_a_SOURCES = \
48         testsuite_abi.cc \
49         testsuite_allocator.cc \
50         testsuite_hooks.cc 
51
52 ## Build support utilities.
53 if GLIBCXX_TEST_ABI
54 noinst_PROGRAMS = abi_check
55 else
56 noinst_PROGRAMS =
57 endif
58 abi_check_SOURCES = abi_check.cc
59 abi_check_DEPENDENCIES = libv3test.a
60
61 all-local: stamp_wchar stamp_thread testsuite_files
62
63 # Enable wchar_t tests if capable.
64 if GLIBCXX_TEST_WCHAR_T
65 stamp_wchar:
66         touch testsuite_wchar_t
67 else
68 stamp_wchar:
69 endif
70
71 # Enable thread tests if capable.
72 if GLIBCXX_TEST_THREAD
73 stamp_thread:
74         touch testsuite_thread
75 else
76 stamp_thread:
77 endif
78
79 # Generated lists of files to run.  All of these names are valid make
80 # targets, if you wish to generate a list manually.
81 lists_of_files = \
82    testsuite_files \
83    testsuite_files_interactive \
84    testsuite_files_performance
85
86
87 # We need more things in site.exp, but automake completely controls the
88 # creation of that file; there's no way to append to it without messing up
89 # the dependancy chains.  So we overrule automake.  This rule is exactly
90 # what it would have generated, plus our own additions.
91 site.exp: Makefile
92         @echo 'Making a new site.exp file...'
93         @echo '## these variables are automatically generated by make ##' >site.tmp
94         @echo '# Do not edit here.  If you wish to override these values' >>site.tmp
95         @echo '# edit the last section' >>site.tmp
96         @echo 'set srcdir $(srcdir)' >>site.tmp
97         @echo "set objdir `pwd`" >>site.tmp
98         @echo 'set build_alias "$(build_alias)"' >>site.tmp
99         @echo 'set build_triplet $(build_triplet)' >>site.tmp
100         @echo 'set host_alias "$(host_alias)"' >>site.tmp
101         @echo 'set host_triplet $(host_triplet)' >>site.tmp
102         @echo 'set target_alias "$(target_alias)"' >>site.tmp
103         @echo 'set target_triplet $(target_triplet)' >>site.tmp
104         @echo 'set target_triplet $(target_triplet)' >>site.tmp
105         @echo 'set libiconv "$(LIBICONV)"' >>site.tmp
106         @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
107         @test ! -f site.exp || \
108           sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
109         @-rm -f site.bak
110         @test ! -f site.exp || mv site.exp site.bak
111         @mv site.tmp site.exp
112
113 # This is automatically run after the generated check-DEJAGNU rule.
114 check-local: check-abi
115
116 baseline_file = ${baseline_dir}/baseline_symbols.txt
117 extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
118
119 current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
120           -@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
121
122 baseline_symbols:
123         -@(output=${baseline_file}; \
124           if test ! -f $${output}; then \
125             echo "Baseline file doesn't exist."; \
126             echo "Try 'make new-abi-baseline' to create it."; \
127             exit 1; \
128           fi; true)
129
130 new-abi-baseline:
131         -@$(mkinstalldirs) ${baseline_dir}
132         -@(output=${baseline_file}; \
133           if test -f $${output}; then \
134             output=$${output}.new; \
135             t=`echo $${output} | sed 's=.*config/abi/=='`; \
136             echo "Baseline file already exists, writing to $${t} instead."; \
137           fi; \
138           ${extract_symvers} ../src/.libs/libstdc++.so $${output})
139
140 if GLIBCXX_TEST_ABI
141 # Use 'new-abi-baseline' to create an initial symbol file.  Then run
142 # 'check-abi' to test for changes against that file.
143 check-abi: abi_check baseline_symbols current_symbols.txt
144         -@./abi_check --check ./current_symbols.txt ${baseline_file} \
145           2>&1 | tee libstdc++-abi.sum
146         -@cp libstdc++-abi.sum libstdc++-abi.log
147
148 check-abi-verbose: abi_check baseline_symbols current_symbols.txt
149         -@./abi_check --check-verbose ./current_symbols.txt ${baseline_file} \
150           2>&1 | tee libstdc++-abi.sum
151         -@cp libstdc++-abi.sum libstdc++-abi.log
152
153 else
154 check-abi:
155 check-abi-verbose:
156 endif
157
158
159 # These two special 'check-script' rules use the bash script
160 # 'check_survey' to do testing. This script is not as portable as the
161 # dejagnu test harness, and is thus off by default. It does produce
162 # interesting output however, including various performance analysis
163 # items like compile time, execution time, and binary size.
164 survey_script = ${glibcxx_builddir}/scripts/check_survey
165 check-script: ${survey_script}
166         -@(chmod + ${survey_script}; \
167           ${survey_script} 0)
168
169 check-script-install: ${survey_script}
170         -@(chmod + ${survey_script}; \
171           ${survey_script} 0)
172
173
174 # Runs the testsuite/performance tests.
175 # Some of these tests create large (~75MB) files, allocate huge
176 # ammounts of memory, or otherwise tie up machine resources. Thus,
177 # running this is off by default.
178 performance_script=${glibcxx_srcdir}/scripts/check_performance
179 check-performance: testsuite_files_performance ${performance_script}
180         -@(chmod + ${performance_script}; \
181           ${performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
182
183 # Runs the testsuite, but in compile only mode, and times it.
184 # See script.
185 compile_script=${glibcxx_srcdir}/scripts/check_compile
186 check-compile: testsuite_files ${compile_script}
187         -@(chmod + ${compile_script}; \
188           ${compile_script} ${glibcxx_srcdir} ${glibcxx_builddir})
189
190 # This rule generates all of the testsuite_files* lists at once.
191 ${lists_of_files}:
192         ${glibcxx_srcdir}/scripts/create_testsuite_files \
193           ${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
194
195
196 .PHONY: baseline_symbols new-abi-baseline check-abi check-abi-verbose \
197 check-script check-script-install check-performance
198
199 # By adding these files here, automake will remove them for 'make clean'
200 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
201              testsuite_* site.exp abi_check baseline_symbols *TEST*