annotate libstdc++-v3/testsuite/Makefile.am @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ## Makefile for the testsuite subdirectory of the GNU C++ Standard library.
kono
parents:
diff changeset
2 ##
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3 ## Copyright (C) 2001-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
4 ##
kono
parents:
diff changeset
5 ## This file is part of the libstdc++ version 3 distribution.
kono
parents:
diff changeset
6 ## Process this file with automake to produce Makefile.in.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 ## This file is part of the GNU ISO C++ Library. This library is free
kono
parents:
diff changeset
9 ## software; you can redistribute it and/or modify it under the
kono
parents:
diff changeset
10 ## terms of the GNU General Public License as published by the
kono
parents:
diff changeset
11 ## Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
12 ## any later version.
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 ## This library is distributed in the hope that it will be useful,
kono
parents:
diff changeset
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
17 ## GNU General Public License for more details.
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 ## You should have received a copy of the GNU General Public License along
kono
parents:
diff changeset
20 ## with this library; see the file COPYING3. If not see
kono
parents:
diff changeset
21 ## <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 AUTOMAKE_OPTIONS = nostdinc
kono
parents:
diff changeset
24 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
kono
parents:
diff changeset
25 EXPECT = expect
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 include $(top_srcdir)/fragment.am
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 # Generated lists of files to run. All of these names are valid make
kono
parents:
diff changeset
30 # targets, if you wish to generate a list manually.
kono
parents:
diff changeset
31 lists_of_files = \
kono
parents:
diff changeset
32 testsuite_files \
kono
parents:
diff changeset
33 testsuite_files_interactive \
kono
parents:
diff changeset
34 testsuite_files_performance
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 # This rule generates all of the testsuite_files* lists at once.
kono
parents:
diff changeset
37 ${lists_of_files}:
kono
parents:
diff changeset
38 ${glibcxx_srcdir}/scripts/create_testsuite_files \
kono
parents:
diff changeset
39 ${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 # We need more things in site.exp, but automake completely controls the
kono
parents:
diff changeset
42 # creation of that file; there's no way to append to it without messing up
kono
parents:
diff changeset
43 # the dependancy chains. So we overrule automake. This rule is exactly
kono
parents:
diff changeset
44 # what it would have generated, plus our own additions.
kono
parents:
diff changeset
45 site.exp: Makefile
kono
parents:
diff changeset
46 @echo 'Making a new site.exp file...'
kono
parents:
diff changeset
47 @echo '## these variables are automatically generated by make ##' >site.tmp
kono
parents:
diff changeset
48 @echo '# Do not edit here. If you wish to override these values' >>site.tmp
kono
parents:
diff changeset
49 @echo '# edit the last section' >>site.tmp
kono
parents:
diff changeset
50 @echo 'set srcdir $(srcdir)' >>site.tmp
kono
parents:
diff changeset
51 @echo "set objdir `pwd`" >>site.tmp
kono
parents:
diff changeset
52 @echo 'set build_alias "$(build_alias)"' >>site.tmp
kono
parents:
diff changeset
53 @echo 'set build_triplet $(build_triplet)' >>site.tmp
kono
parents:
diff changeset
54 @echo 'set host_alias "$(host_alias)"' >>site.tmp
kono
parents:
diff changeset
55 @echo 'set host_triplet $(host_triplet)' >>site.tmp
kono
parents:
diff changeset
56 @echo 'set target_alias "$(target_alias)"' >>site.tmp
kono
parents:
diff changeset
57 @echo 'set target_triplet $(target_triplet)' >>site.tmp
kono
parents:
diff changeset
58 @echo 'set target_triplet $(target_triplet)' >>site.tmp
kono
parents:
diff changeset
59 @echo 'set libiconv "$(LIBICONV)"' >>site.tmp
kono
parents:
diff changeset
60 @echo 'set baseline_dir "$(baseline_dir)"' >> site.tmp
kono
parents:
diff changeset
61 @echo 'set baseline_subdir_switch "$(baseline_subdir_switch)"' >> site.tmp
kono
parents:
diff changeset
62 @echo 'set TEST_GCC_EXEC_PREFIX "$(libdir)/gcc/"' >> site.tmp
kono
parents:
diff changeset
63 @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
kono
parents:
diff changeset
64 @test ! -f site.exp || \
kono
parents:
diff changeset
65 sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
kono
parents:
diff changeset
66 @-rm -f site.bak
kono
parents:
diff changeset
67 @test ! -f site.exp || mv site.exp site.bak
kono
parents:
diff changeset
68 @mv site.tmp site.exp
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 extract_symvers = $(glibcxx_builddir)/scripts/extract_symvers
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 baseline_subdir := $(shell $(CXX) $(baseline_subdir_switch))
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 baseline_symbols:
kono
parents:
diff changeset
76 -@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \
kono
parents:
diff changeset
77 if test ! -f $${output}; then \
kono
parents:
diff changeset
78 echo "Baseline file doesn't exist."; \
kono
parents:
diff changeset
79 echo "Try 'make new-abi-baseline' to create it."; \
kono
parents:
diff changeset
80 exit 1; \
kono
parents:
diff changeset
81 fi; true)
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 new-abi-baseline:
kono
parents:
diff changeset
84 -@$(mkinstalldirs) ${baseline_dir}/${baseline_subdir}
kono
parents:
diff changeset
85 -@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \
kono
parents:
diff changeset
86 if test -f $${output}; then \
kono
parents:
diff changeset
87 output=$${output}.new; \
kono
parents:
diff changeset
88 t=`echo $${output} | sed 's=.*config/abi/=='`; \
kono
parents:
diff changeset
89 echo "Baseline file already exists, writing to $${t} instead."; \
kono
parents:
diff changeset
90 fi; \
kono
parents:
diff changeset
91 ${extract_symvers} ../src/.libs/libstdc++.so $${output})
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 %/site.exp: site.exp
kono
parents:
diff changeset
94 -@test -d $* || mkdir $*
kono
parents:
diff changeset
95 @srcdir=`cd $(srcdir); ${PWD_COMMAND}`;
kono
parents:
diff changeset
96 @objdir=`${PWD_COMMAND}`/$*; \
kono
parents:
diff changeset
97 sed -e "s|^set srcdir .*$$|set srcdir $$srcdir|" \
kono
parents:
diff changeset
98 -e "s|^set objdir .*$$|set objdir $$objdir|" \
kono
parents:
diff changeset
99 site.exp > $*/site.exp.tmp
kono
parents:
diff changeset
100 @-rm -f $*/site.bak
kono
parents:
diff changeset
101 @test ! -f $*/site.exp || mv $*/site.exp $*/site.bak
kono
parents:
diff changeset
102 @mv $*/site.exp.tmp $*/site.exp
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 check_p_numbers0:=1 2 3 4 5 6 7 8 9
kono
parents:
diff changeset
105 check_p_numbers1:=0 $(check_p_numbers0)
kono
parents:
diff changeset
106 check_p_numbers2:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers1)))
kono
parents:
diff changeset
107 check_p_numbers3:=$(addprefix 0,$(check_p_numbers1)) $(check_p_numbers2)
kono
parents:
diff changeset
108 check_p_numbers4:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers3)))
kono
parents:
diff changeset
109 check_p_numbers5:=$(addprefix 0,$(check_p_numbers3)) $(check_p_numbers4)
kono
parents:
diff changeset
110 check_p_numbers6:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers5)))
kono
parents:
diff changeset
111 check_p_numbers:=$(check_p_numbers0) $(check_p_numbers2) $(check_p_numbers4) $(check_p_numbers6)
kono
parents:
diff changeset
112 check_p_subdirs=$(wordlist 1,$(if $(GCC_TEST_PARALLEL_SLOTS),$(GCC_TEST_PARALLEL_SLOTS),128),$(check_p_numbers))
kono
parents:
diff changeset
113 check_DEJAGNU_normal_targets = $(addprefix check-DEJAGNUnormal,$(check_p_subdirs))
kono
parents:
diff changeset
114 $(check_DEJAGNU_normal_targets): check-DEJAGNUnormal%: normal%/site.exp
kono
parents:
diff changeset
115
kono
parents:
diff changeset
116 # Run the testsuite in normal mode.
kono
parents:
diff changeset
117 check-DEJAGNU $(check_DEJAGNU_normal_targets): check-DEJAGNU%: site.exp
kono
parents:
diff changeset
118 $(if $*,@)AR="$(AR)"; export AR; \
kono
parents:
diff changeset
119 RANLIB="$(RANLIB)"; export RANLIB; \
kono
parents:
diff changeset
120 if [ -z "$*" ] && [ -n "$(filter -j%, $(MFLAGS))" ]; then \
kono
parents:
diff changeset
121 rm -rf normal-parallel || true; \
kono
parents:
diff changeset
122 mkdir normal-parallel; \
kono
parents:
diff changeset
123 $(MAKE) $(AM_MAKEFLAGS) $(check_DEJAGNU_normal_targets); \
kono
parents:
diff changeset
124 rm -rf normal-parallel || true; \
kono
parents:
diff changeset
125 for idx in $(check_p_subdirs); do \
kono
parents:
diff changeset
126 if [ -d normal$$idx ]; then \
kono
parents:
diff changeset
127 mv -f normal$$idx/libstdc++.sum normal$$idx/libstdc++.sum.sep; \
kono
parents:
diff changeset
128 mv -f normal$$idx/libstdc++.log normal$$idx/libstdc++.log.sep; \
kono
parents:
diff changeset
129 fi; \
kono
parents:
diff changeset
130 done; \
kono
parents:
diff changeset
131 $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh \
kono
parents:
diff changeset
132 normal[0-9]*/libstdc++.sum.sep > libstdc++.sum; \
kono
parents:
diff changeset
133 $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh -L \
kono
parents:
diff changeset
134 normal[0-9]*/libstdc++.log.sep > libstdc++.log; \
kono
parents:
diff changeset
135 exit 0; \
kono
parents:
diff changeset
136 fi; \
kono
parents:
diff changeset
137 srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
kono
parents:
diff changeset
138 EXPECT=$(EXPECT); export EXPECT; \
kono
parents:
diff changeset
139 runtest=$(RUNTEST); \
kono
parents:
diff changeset
140 if [ -z "$$runtest" ]; then runtest=runtest; fi; \
kono
parents:
diff changeset
141 tool=libstdc++; \
kono
parents:
diff changeset
142 if [ -n "$*" ]; then \
kono
parents:
diff changeset
143 if [ -f normal-parallel/finished ]; then rm -rf "$*"; exit 0; fi; \
kono
parents:
diff changeset
144 GCC_RUNTEST_PARALLELIZE_DIR=`${PWD_COMMAND}`/normal-parallel; \
kono
parents:
diff changeset
145 export GCC_RUNTEST_PARALLELIZE_DIR; \
kono
parents:
diff changeset
146 cd "$*"; \
kono
parents:
diff changeset
147 fi; \
kono
parents:
diff changeset
148 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
kono
parents:
diff changeset
149 $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) \
kono
parents:
diff changeset
150 $(RUNTESTFLAGS); \
kono
parents:
diff changeset
151 if [ -n "$*" ]; then \
kono
parents:
diff changeset
152 touch $$GCC_RUNTEST_PARALLELIZE_DIR/finished; \
kono
parents:
diff changeset
153 fi; \
kono
parents:
diff changeset
154 else \
kono
parents:
diff changeset
155 echo "WARNING: could not find \`runtest'" 1>&2; :;\
kono
parents:
diff changeset
156 fi
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 check-am:
kono
parents:
diff changeset
159 $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
kono
parents:
diff changeset
160 .PHONY: check-DEJAGNU
kono
parents:
diff changeset
161
kono
parents:
diff changeset
162 # Use 'new-abi-baseline' to create an initial symbol file. Then run
kono
parents:
diff changeset
163 # 'check-abi' to test for changes against that file.
kono
parents:
diff changeset
164 check-abi: site.exp baseline_symbols
kono
parents:
diff changeset
165 -@runtest $(AM_RUNTESTFLAGS) --tool libstdc++ $(RUNTESTFLAGS) abi.exp
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 # Runs the testsuite, but in compile only mode.
kono
parents:
diff changeset
168 # Can be used to test sources with non-GNU FE's at various warning
kono
parents:
diff changeset
169 # levels and for checking compile time across releases.
kono
parents:
diff changeset
170 # See script.
kono
parents:
diff changeset
171 compile_script=${glibcxx_srcdir}/scripts/check_compile
kono
parents:
diff changeset
172 check-compile: testsuite_files ${compile_script}
kono
parents:
diff changeset
173 -@(chmod + ${compile_script}; \
kono
parents:
diff changeset
174 ${compile_script} ${glibcxx_srcdir} ${glibcxx_builddir})
kono
parents:
diff changeset
175
kono
parents:
diff changeset
176
kono
parents:
diff changeset
177 # Runs the testsuite/performance tests.
kono
parents:
diff changeset
178 # Some of these tests create large (~75MB) files, allocate huge
kono
parents:
diff changeset
179 # ammounts of memory, or otherwise tie up machine resources. Thus,
kono
parents:
diff changeset
180 # running this is off by default.
kono
parents:
diff changeset
181 # XXX Need to add dependency on libtestc++.a
kono
parents:
diff changeset
182 check_performance_script=${glibcxx_srcdir}/scripts/check_performance
kono
parents:
diff changeset
183 check-performance: testsuite_files_performance ${performance_script}
kono
parents:
diff changeset
184 -@(chmod + ${check_performance_script}; \
kono
parents:
diff changeset
185 ${check_performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
kono
parents:
diff changeset
186
kono
parents:
diff changeset
187 # Runs the testsuite in debug mode.
kono
parents:
diff changeset
188 debug_flags = "unix/-D_GLIBCXX_DEBUG"
kono
parents:
diff changeset
189
kono
parents:
diff changeset
190 # Runs the testsuite in parallel mode.
kono
parents:
diff changeset
191 libgomp_dir=${glibcxx_builddir}/../libgomp
kono
parents:
diff changeset
192 libgomp_flags=-B${glibcxx_builddir}/../libgomp \
kono
parents:
diff changeset
193 -I${glibcxx_builddir}/../libgomp \
kono
parents:
diff changeset
194 -L${glibcxx_builddir}/../libgomp/.libs -lgomp
kono
parents:
diff changeset
195
kono
parents:
diff changeset
196 atomic_flags=$(ATOMIC_FLAGS)
kono
parents:
diff changeset
197 parallel_flags="unix/-D_GLIBCXX_PARALLEL/-fopenmp"
kono
parents:
diff changeset
198
kono
parents:
diff changeset
199 check-debug: site.exp
kono
parents:
diff changeset
200 outputdir=debug; export outputdir; \
kono
parents:
diff changeset
201 if test ! -d $${outputdir}; then \
kono
parents:
diff changeset
202 mkdir $${outputdir}; \
kono
parents:
diff changeset
203 fi; \
kono
parents:
diff changeset
204 srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
kono
parents:
diff changeset
205 EXPECT=$(EXPECT); export EXPECT; \
kono
parents:
diff changeset
206 $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) conformance.exp --outdir $${outputdir} --objdir $${outputdir} --target_board=$(debug_flags)" check-DEJAGNU;
kono
parents:
diff changeset
207
kono
parents:
diff changeset
208 check-parallel: site.exp
kono
parents:
diff changeset
209 -@(if test ! -d $${libgomp_dir}; then \
kono
parents:
diff changeset
210 echo "Testing parallel mode failed as libgomp not present."; \
kono
parents:
diff changeset
211 exit 1; \
kono
parents:
diff changeset
212 fi; \
kono
parents:
diff changeset
213 outputdir=parallel; export outputdir; \
kono
parents:
diff changeset
214 if test ! -d $${outputdir}; then \
kono
parents:
diff changeset
215 mkdir $${outputdir}; \
kono
parents:
diff changeset
216 fi; \
kono
parents:
diff changeset
217 srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
kono
parents:
diff changeset
218 EXPECT=$(EXPECT); export EXPECT; \
kono
parents:
diff changeset
219 $(MAKE) CXXFLAGS="$(atomic_flags) $(libgomp_flags)" RUNTESTFLAGS="$(RUNTESTFLAGS) conformance.exp --outdir $${outputdir} --objdir $${outputdir} --target_board=$(parallel_flags)" check-DEJAGNU; )
kono
parents:
diff changeset
220
kono
parents:
diff changeset
221 check-performance-parallel: testsuite_files_performance ${performance_script}
kono
parents:
diff changeset
222 -@(chmod + ${check_performance_script}; \
kono
parents:
diff changeset
223 CXXFLAGS="-D_GLIBCXX_PARALLEL -fopenmp $(atomic_flags) $(libgomp_flags)"; export CXXFLAGS; \
kono
parents:
diff changeset
224 ${check_performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
kono
parents:
diff changeset
225
kono
parents:
diff changeset
226 .PHONY: baseline_symbols new-abi-baseline \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
227 check-abi check-compile check-performance check-parallel
111
kono
parents:
diff changeset
228
kono
parents:
diff changeset
229 # By adding these files here, automake will remove them for 'make clean'
kono
parents:
diff changeset
230 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
kono
parents:
diff changeset
231 testsuite_* site.exp abi_check baseline_symbols *TEST* *.dat \
kono
parents:
diff changeset
232 *.ii *.s *.o *.cc *.x *.a *.so *.xml *.raw *.out *.gdb
kono
parents:
diff changeset
233
kono
parents:
diff changeset
234 # To remove directories.
kono
parents:
diff changeset
235 clean-local:
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
236 rm -rf de fr debug parallel binaries normal*