1 ## Makefile for the testsuite subdirectory of the GNU C++ Standard library.
3 ## Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
5 ## This file is part of the libstdc++ version 3 distribution.
6 ## Process this file with automake to produce Makefile.in.
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)
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.
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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
24 AUTOMAKE_OPTIONS = dejagnu nostdinc
26 include $(top_srcdir)/fragment.am
31 # Generated lists of files to run. All of these names are valid make
32 # targets, if you wish to generate a list manually.
35 testsuite_files_interactive \
36 testsuite_files_performance
38 # This rule generates all of the testsuite_files* lists at once.
40 ${glibcxx_srcdir}/scripts/create_testsuite_files \
41 ${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
43 # We need more things in site.exp, but automake completely controls the
44 # creation of that file; there's no way to append to it without messing up
45 # the dependancy chains. So we overrule automake. This rule is exactly
46 # what it would have generated, plus our own additions.
48 @echo 'Making a new site.exp file...'
49 @echo '## these variables are automatically generated by make ##' >site.tmp
50 @echo '# Do not edit here. If you wish to override these values' >>site.tmp
51 @echo '# edit the last section' >>site.tmp
52 @echo 'set srcdir $(srcdir)' >>site.tmp
53 @echo "set objdir `pwd`" >>site.tmp
54 @echo 'set build_alias "$(build_alias)"' >>site.tmp
55 @echo 'set build_triplet $(build_triplet)' >>site.tmp
56 @echo 'set host_alias "$(host_alias)"' >>site.tmp
57 @echo 'set host_triplet $(host_triplet)' >>site.tmp
58 @echo 'set target_alias "$(target_alias)"' >>site.tmp
59 @echo 'set target_triplet $(target_triplet)' >>site.tmp
60 @echo 'set target_triplet $(target_triplet)' >>site.tmp
61 @echo 'set libiconv "$(LIBICONV)"' >>site.tmp
62 @echo 'set baseline_file "$(baseline_file)"' >> site.tmp
63 @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
64 @test ! -f site.exp || \
65 sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
67 @test ! -f site.exp || mv site.exp site.bak
71 baseline_file = ${baseline_dir}/baseline_symbols.txt
72 extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
75 -@(output=${baseline_file}; \
76 if test ! -f $${output}; then \
77 echo "Baseline file doesn't exist."; \
78 echo "Try 'make new-abi-baseline' to create it."; \
83 -@$(mkinstalldirs) ${baseline_dir}
84 -@(output=${baseline_file}; \
85 if test -f $${output}; then \
86 output=$${output}.new; \
87 t=`echo $${output} | sed 's=.*config/abi/=='`; \
88 echo "Baseline file already exists, writing to $${t} instead."; \
90 ${extract_symvers} ../src/.libs/libstdc++.so $${output})
92 # Use 'new-abi-baseline' to create an initial symbol file. Then run
93 # 'check-abi' to test for changes against that file.
94 check-abi: site.exp baseline_symbols
95 -@runtest --tool libstdc++ abi.exp
97 # Runs the testsuite, but in compile only mode.
98 # Can be used to test sources with non-GNU FE's at various warning
99 # levels and for checking compile time across releases.
101 compile_script=${glibcxx_srcdir}/scripts/check_compile
102 check-compile: testsuite_files ${compile_script}
103 -@(chmod + ${compile_script}; \
104 ${compile_script} ${glibcxx_srcdir} ${glibcxx_builddir})
107 # Runs the testsuite/performance tests.
108 # Some of these tests create large (~75MB) files, allocate huge
109 # ammounts of memory, or otherwise tie up machine resources. Thus,
110 # running this is off by default.
111 # XXX Need to add dependency on libtestc++.a
112 check_performance_script=${glibcxx_srcdir}/scripts/check_performance
113 check-performance: testsuite_files_performance ${performance_script}
114 -@(chmod + ${check_performance_script}; \
115 ${check_performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
117 # Generates the plots and graphs for performance testing.
118 doc_performance_script=${glibcxx_srcdir}/scripts/make_graphs.py
120 -@(chmod + ${doc_performance_script}; \
121 ${doc_performance_script} ${glibcxx_srcdir} \
122 ${glibcxx_builddir}/testsuite \
123 ${glibcxx_srcdir}/testsuite/data/make_graph_htmls.xml \
124 ${glibcxx_srcdir}/testsuite/data/make_graph_test_infos.xml local g++)
126 # Runs the testsuite in parallel mode.
127 libgomp_dir=${glibcxx_builddir}/../libgomp
128 libgomp_flags=-B${glibcxx_builddir}/../libgomp \
129 -I${glibcxx_builddir}/../libgomp \
130 -L${glibcxx_builddir}/../libgomp/.libs -lgomp
132 atomic_flags=$(ATOMIC_FLAGS)
133 parallel_flags="unix/-D_GLIBCXX_PARALLEL/-fopenmp"
135 check-parallel: site.exp
136 -@(if test ! -d $${libgomp_dir}; then \
137 echo "Testing parallel mode failed as libgomp not present."; \
140 outputdir=parallel; export outputdir; \
141 if test ! -d $${outputdir}; then \
142 mkdir $${outputdir}; \
144 srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
145 EXPECT=$(EXPECT); export EXPECT; \
146 $(MAKE) CXXFLAGS="$(atomic_flags) $(libgomp_flags)" $(AM_MAKEFLAGS) RUNTESTFLAGS="$(RUNTESTFLAGS) conformance.exp --outdir $${outputdir} --objdir $${outputdir} --target_board=$(parallel_flags)" check-DEJAGNU; )
148 check-performance-parallel: testsuite_files_performance ${performance_script}
149 -@(chmod + ${check_performance_script}; \
150 CXXFLAGS="-D_GLIBCXX_PARALLEL -fopenmp $(atomic_flags) $(libgomp_flags)"; export CXXFLAGS; \
151 ${check_performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
153 .PHONY: baseline_symbols new-abi-baseline \
154 check-abi check-compile check-performance check-parallel
156 # By adding these files here, automake will remove them for 'make clean'
157 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
158 testsuite_* site.exp abi_check baseline_symbols *TEST* *.dat \
159 *.s *.o *.cc *.a *.so *.xml
161 # To remove directories.