1 ## Makefile for the testsuite subdirectory of the GNU C++ Standard library.
3 ## Copyright (C) 2001, 2002, 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
24 AUTOMAKE_OPTIONS = dejagnu
26 include $(top_srcdir)/fragment.am
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 AM_CXXFLAGS = $(shell ${testsuite_flags_script} --cxxflags)
36 GLIBGCC_DIR=`$(CC) -print-libgcc-file-name | sed 's,/[^/]*$$,,'`
37 GLIBCXX_DIR=${glibcxx_builddir}/src/.libs
40 $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
41 -R $(GLIBGCC_DIR) -R $(GLIBCXX_DIR) \
42 $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -lv3test -L. -o $@
44 ## Build support library.
45 noinst_LIBRARIES = libv3test.a
46 libv3test_a_SOURCES = \
48 testsuite_allocator.cc \
51 ## Build support utilities.
53 noinst_PROGRAMS = abi_check
57 abi_check_SOURCES = abi_check.cc
58 abi_check_DEPENDENCIES = libv3test.a
60 all-local: stamp_wchar testsuite_files
62 # Enable wchar_t tests if capable.
63 if GLIBCXX_TEST_WCHAR_T
65 touch testsuite_wchar_t
70 # Generated lists of files to run. All of these names are valid make
71 # targets, if you wish to generate a list manually.
74 testsuite_files_interactive \
75 testsuite_files_performance
78 # This is automatically run after the generated check-DEJAGNU rule.
79 check-local: check-abi
81 baseline_file = ${baseline_dir}/baseline_symbols.txt
82 extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
84 current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
85 -@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
88 -@(output=${baseline_file}; \
89 if test ! -f $${output}; then \
90 echo "Baseline file doesn't exist."; \
91 echo "Try 'make new-abi-baseline' to create it."; \
96 -@$(mkinstalldirs) ${baseline_dir}
97 -@(output=${baseline_file}; \
98 if test -f $${output}; then \
99 output=$${output}.new; \
100 t=`echo $${output} | sed 's=.*config/abi/=='`; \
101 echo "Baseline file already exists, writing to $${t} instead."; \
103 ${extract_symvers} ../src/.libs/libstdc++.so $${output})
106 # Use 'new-abi-baseline' to create an initial symbol file. Then run
107 # 'check-abi' to test for changes against that file.
108 check-abi: abi_check baseline_symbols current_symbols.txt
109 -@./abi_check --check ./current_symbols.txt ${baseline_file} \
110 2>&1 | tee libstdc++-abi.sum
111 -@cp libstdc++-abi.sum libstdc++-abi.log
113 check-abi-verbose: abi_check baseline_symbols current_symbols.txt
114 -@./abi_check --check-verbose ./current_symbols.txt ${baseline_file} \
115 2>&1 | tee libstdc++-abi.sum
116 -@cp libstdc++-abi.sum libstdc++-abi.log
124 # These two special 'check-script' rules use the bash script
125 # 'check_survey' to do testing. This script is not as portable as the
126 # dejagnu test harness, and is thus off by default. It does produce
127 # interesting output however, including various performance analysis
128 # items like compile time, execution time, and binary size.
129 survey_script = ${glibcxx_builddir}/scripts/check_survey
130 check-script: ${survey_script}
131 -@(chmod + ${survey_script}; \
134 check-script-install: ${survey_script}
135 -@(chmod + ${survey_script}; \
139 # Runs the testsuite/performance tests.
140 # Some of these tests create large (~75MB) files, allocate huge
141 # ammounts of memory, or otherwise tie up machine resources. Thus,
142 # running this is off by default.
143 performance_script=${glibcxx_srcdir}/scripts/check_performance
144 check-performance: testsuite_files_performance ${performance_script}
145 -@(chmod + ${performance_script}; \
146 ${performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
149 # This rule generates all of the testsuite_files* lists at once.
151 ${glibcxx_srcdir}/scripts/create_testsuite_files \
152 ${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
155 .PHONY: baseline_symbols new-abi-baseline check-abi check-abi-verbose \
156 check-script check-script-install check-performance
158 # By adding these files here, automake will remove them for 'make clean'
159 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
160 testsuite_* site.exp abi_check baseline_symbols