OSDN Git Service

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