test.html: Update.
2005-04-06 Benjamin Kosnik <bkoz@redhat.com> * docs/html/test.html: Update. * testsuite/printnow.c: Remove. * scripts/check_survey.in: Remove. * testsuite/abi_check.cc: To... * testuite/testsuite_abi_check.cc: ...here. * testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to testsuite_abi_check.cc. * testsuite/testsuite_hooks.h: Move character related bits to... * testsuite/testsuite_character.h: ...here. * testsuite/testsuite_character.cc: ... and here. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-in.cc: Use testsuite_character.h. * testsuite/21_strings/basic_string/inserters_extractors/pod/ 10081-out.cc: Same. * testsuite/22_locale/numpunct/members/pod/1.cc: Same. * testsuite/22_locale/numpunct/members/pod/2.cc: Same. * testsuite/27_io/basic_filebuf/2.cc: Same. * testsuite/27_io/basic_fstream/2.cc: Same. * testsuite/27_io/basic_istream/2.cc: Same. * testsuite/27_io/basic_istream/extractors_arithmetic/pod/ 3983-1.cc: Same. * testsuite/27_io/basic_istream/extractors_character/char/ 9826.cc: Same. * testsuite/27_io/basic_istream/extractors_character/pod/ 3983-2.cc: Same. * testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same. * testsuite/27_io/basic_istream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_ostream/2.cc: Same. * testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same. * testsuite/27_io/basic_streambuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/2.cc: Same. * testsuite/27_io/basic_stringbuf/4.cc: Same. * testsuite/27_io/basic_stringstream/2.cc: Same. * testsuite/27_io/fpos/1.cc: Same. * testsuite/ext/mt_allocator/tune-1.cc: Same. * testsuite/ext/mt_allocator/tune-2.cc: Same. * testsuite/ext/stdio_filebuf/char/1.cc: Same. * testsuite/lib/libstdc++.exp (v3-build_support): Add testsuite_character.cc. * testsuite/Makefile.am (libv3test_a_SOURCES): Add testsuite_character.cc. * testsuite/Makefile.in: Regenerate. * configure.ac: Remove use of check_survey. * configure: Regenerate. * testsuite/Makefile.am: Remove check-script and check-script-install rules. * testsuite/Makefile.in: Regenerate. From-SVN: r97772
This commit is contained in:
parent
2d6106a3ef
commit
5305b1ae1b
44 changed files with 1048 additions and 3620 deletions
|
@ -1,3 +1,56 @@
|
|||
2005-04-06 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
* docs/html/test.html: Update.
|
||||
* testsuite/printnow.c: Remove.
|
||||
* scripts/check_survey.in: Remove.
|
||||
|
||||
* testsuite/abi_check.cc: To...
|
||||
* testuite/testsuite_abi_check.cc: ...here.
|
||||
* testsuite/libstdc++-abi/abi.exp: Change abi_check.cc to
|
||||
testsuite_abi_check.cc.
|
||||
|
||||
* testsuite/testsuite_hooks.h: Move character related bits to...
|
||||
* testsuite/testsuite_character.h: ...here.
|
||||
* testsuite/testsuite_character.cc: ... and here.
|
||||
* testsuite/21_strings/basic_string/inserters_extractors/pod/
|
||||
10081-in.cc: Use testsuite_character.h.
|
||||
* testsuite/21_strings/basic_string/inserters_extractors/pod/
|
||||
10081-out.cc: Same.
|
||||
* testsuite/22_locale/numpunct/members/pod/1.cc: Same.
|
||||
* testsuite/22_locale/numpunct/members/pod/2.cc: Same.
|
||||
* testsuite/27_io/basic_filebuf/2.cc: Same.
|
||||
* testsuite/27_io/basic_fstream/2.cc: Same.
|
||||
* testsuite/27_io/basic_istream/2.cc: Same.
|
||||
* testsuite/27_io/basic_istream/extractors_arithmetic/pod/
|
||||
3983-1.cc: Same.
|
||||
* testsuite/27_io/basic_istream/extractors_character/char/
|
||||
9826.cc: Same.
|
||||
* testsuite/27_io/basic_istream/extractors_character/pod/
|
||||
3983-2.cc: Same.
|
||||
* testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc: Same.
|
||||
* testsuite/27_io/basic_istream/sentry/pod/1.cc: Same.
|
||||
* testsuite/27_io/basic_ostream/2.cc: Same.
|
||||
* testsuite/27_io/basic_ostream/sentry/pod/1.cc: Same.
|
||||
* testsuite/27_io/basic_streambuf/2.cc: Same.
|
||||
* testsuite/27_io/basic_stringbuf/2.cc: Same.
|
||||
* testsuite/27_io/basic_stringbuf/4.cc: Same.
|
||||
* testsuite/27_io/basic_stringstream/2.cc: Same.
|
||||
* testsuite/27_io/fpos/1.cc: Same.
|
||||
* testsuite/ext/mt_allocator/tune-1.cc: Same.
|
||||
* testsuite/ext/mt_allocator/tune-2.cc: Same.
|
||||
* testsuite/ext/stdio_filebuf/char/1.cc: Same.
|
||||
* testsuite/lib/libstdc++.exp (v3-build_support): Add
|
||||
testsuite_character.cc.
|
||||
* testsuite/Makefile.am (libv3test_a_SOURCES): Add
|
||||
testsuite_character.cc.
|
||||
* testsuite/Makefile.in: Regenerate.
|
||||
|
||||
* configure.ac: Remove use of check_survey.
|
||||
* configure: Regenerate.
|
||||
* testsuite/Makefile.am: Remove check-script and
|
||||
check-script-install rules.
|
||||
* testsuite/Makefile.in: Regenerate.
|
||||
|
||||
2005-04-06 Ulrich Weigand <uweigand@de.ibm.com>
|
||||
|
||||
* config/cpu/s390/atomicity.h (__exchange_and_add): Add "memory"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -42,20 +42,18 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/../config.guess \
|
|||
$(srcdir)/../mkinstalldirs $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/configure $(top_srcdir)/fragment.am \
|
||||
$(top_srcdir)/scripts/check_survey.in \
|
||||
$(top_srcdir)/scripts/testsuite_flags.in ChangeLog acconfig.h
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
|
||||
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/crossconfig.m4 $(top_srcdir)/linkage.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno configure.status.lineno
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = scripts/check_survey scripts/testsuite_flags
|
||||
CONFIG_CLEAN_FILES = scripts/testsuite_flags
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
SOURCES =
|
||||
|
@ -377,8 +375,6 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir
|
|||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
scripts/check_survey: $(top_builddir)/config.status $(top_srcdir)/scripts/check_survey.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
scripts/testsuite_flags: $(top_builddir)/config.status $(top_srcdir)/scripts/testsuite_flags.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
|
@ -503,7 +499,7 @@ distclean-tags:
|
|||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkdir_p) $(distdir)/.. $(distdir)/../config $(distdir)/scripts
|
||||
$(mkdir_p) $(distdir)/.. $(distdir)/scripts
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
|
|
5
libstdc++-v3/aclocal.m4
vendored
5
libstdc++-v3/aclocal.m4
vendored
|
@ -1,4 +1,4 @@
|
|||
# generated automatically by aclocal 1.9.3 -*- Autoconf -*-
|
||||
# generated automatically by aclocal 1.9.2 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
# Free Software Foundation, Inc.
|
||||
|
@ -40,7 +40,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
|
|||
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.9.3])])
|
||||
[AM_AUTOMAKE_VERSION([1.9.2])])
|
||||
|
||||
# AM_AUX_DIR_EXPAND
|
||||
|
||||
|
@ -817,7 +817,6 @@ AC_SUBST([am__tar])
|
|||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([../config/no-executables.m4])
|
||||
m4_include([../libtool.m4])
|
||||
m4_include([crossconfig.m4])
|
||||
m4_include([linkage.m4])
|
||||
|
|
3028
libstdc++-v3/configure
vendored
3028
libstdc++-v3/configure
vendored
File diff suppressed because it is too large
Load diff
|
@ -311,7 +311,6 @@ AC_CONFIG_FILES( \
|
|||
Makefile \
|
||||
AC_FOREACH([DIR], glibcxx_SUBDIRS, [DIR/Makefile ])
|
||||
)
|
||||
AC_CONFIG_FILES([scripts/check_survey],[chmod +x scripts/check_survey])
|
||||
AC_CONFIG_FILES([scripts/testsuite_flags],[chmod +x scripts/testsuite_flags])
|
||||
|
||||
dnl These commands are run at the end of config.status:
|
||||
|
|
|
@ -45,13 +45,16 @@
|
|||
|
||||
<h2><a name="org">Testsuite organization and naming conventions</a></h2>
|
||||
<p>
|
||||
The directory <em>libsrcdir/testsuite</em> contains the test
|
||||
files, test harness, and utility information for verifying the
|
||||
correctness of C++ library on a given host. It includes the
|
||||
following directories, each named after a specific chapter of
|
||||
the C++ standard, and each containing test files or
|
||||
subdirectories of test files that test for that particular part
|
||||
of the standard.
|
||||
The directory <em>libsrcdir/testsuite</em> contains the
|
||||
individual test cases organized in sub-directories corresponding
|
||||
to chapters of the C++ standard (detailed below), the dejagnu
|
||||
test harness support files, and sources to various testsuite
|
||||
utilities that are packaged in a separate testing library.
|
||||
</p>
|
||||
|
||||
<p> All test cases for functionality required by the runtime
|
||||
components of the C++ standard (ISO 14882) are files within the
|
||||
following directories.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
|
@ -72,6 +75,7 @@
|
|||
</p>
|
||||
|
||||
<pre>
|
||||
tr1 Tests for components as described by the Technical Report on Standard Library Extensions (TR1).
|
||||
backward Tests for backwards compatibility and deprecated features.
|
||||
demangle Tests for __cxa_demangle, the IA 64 C++ ABI demangler
|
||||
ext Tests for extensions.
|
||||
|
@ -93,12 +97,12 @@ data Sample text files for testing input and output.
|
|||
|
||||
<p>
|
||||
Within a directory that includes test files, there may be
|
||||
additional subdirectories, or files: this particular point is in
|
||||
flux. Originally, test cases were appended to one file that
|
||||
represented a particular section of the chapter under test, and
|
||||
was named accordingly. For instance, to test items related to
|
||||
<code> 21.3.6.1 - basic_string::find [lib.string::find]</code>
|
||||
in the standard, the following was used:
|
||||
additional subdirectories, or files. Originally, test cases
|
||||
were appended to one file that represented a particular section
|
||||
of the chapter under test, and was named accordingly. For
|
||||
instance, to test items related to <code> 21.3.6.1 -
|
||||
basic_string::find [lib.string::find]</code> in the standard,
|
||||
the following was used:
|
||||
</p>
|
||||
<pre>
|
||||
21_strings/find.cc
|
||||
|
@ -109,10 +113,10 @@ data Sample text files for testing input and output.
|
|||
functionality (like wide characters or named locales) became
|
||||
frustrating, leading to aggressive pruning of test cases on some
|
||||
platforms that covered up implementation errors. Now, the test
|
||||
suite is converging on a policy of one file, one test case,
|
||||
which solves the above issues and gives finer grained results
|
||||
and more manageable error debugging. As an example, the test case
|
||||
quoted above becomes:
|
||||
suite has a policy of one file, one test case, which solves the
|
||||
above issues and gives finer grained results and more manageable
|
||||
error debugging. As an example, the test case quoted above
|
||||
becomes:
|
||||
</p>
|
||||
<pre>
|
||||
21_strings/basic_string/find/char/1.cc
|
||||
|
@ -125,10 +129,7 @@ data Sample text files for testing input and output.
|
|||
|
||||
<p>
|
||||
All new tests should be written with the policy of one test
|
||||
case, one file in mind. At some point the entire testsuite will
|
||||
be converted: the current status is that the 21_string,
|
||||
22_locale, 23_containers, 27_io, and demangle directories have all been
|
||||
transitioned.
|
||||
case, one file in mind.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
@ -184,6 +185,15 @@ cat 27_io/objects/char/3_xin.in | a.out
|
|||
be run.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<em>thread</em>
|
||||
<p>
|
||||
This can either be a directory name or part of a longer file
|
||||
name, and indicates that this file, or the files within this
|
||||
directory are testing situations where multiple threads are
|
||||
being used.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<em>performance</em>
|
||||
<p>
|
||||
|
@ -197,15 +207,15 @@ cat 27_io/objects/char/3_xin.in | a.out
|
|||
</ul>
|
||||
|
||||
<hr />
|
||||
<h2><a name="util">Utilities: abicheck and libv3test</a></h2>
|
||||
<h2><a name="util">Utilities: abi_check and libv3test</a></h2>
|
||||
<p>
|
||||
The testsuite directory also contains some files that implement
|
||||
functionality that is intended to make writing test cases easier,
|
||||
or to avoid duplication, or to provide error checking in a way that
|
||||
is consistent across platforms and test harnesses. A stand-alone
|
||||
executable, called <em>abi_check</em>, and a static library called
|
||||
<em>libv3test</em> are constructed during the build. Both of these
|
||||
items are not installed, and only used during testing.
|
||||
<em>libv3test</em> are constructed. Both of these items are not
|
||||
installed, and only used during testing.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
@ -214,24 +224,38 @@ cat 27_io/objects/char/3_xin.in | a.out
|
|||
|
||||
<ul>
|
||||
<li>
|
||||
<em>abi_check.cc</em>
|
||||
<em>testsuite_abi.h</em>,
|
||||
<em>testsuite_abi.cc</em>,
|
||||
<em>testsuite_abi_check.cc</em>
|
||||
<p>
|
||||
Creates the executable <em>abi_check</em>.
|
||||
Used to check correctness of symbol versioning, visibility of
|
||||
exported symbols, and compatibility on symbols in the shared
|
||||
library, for hosts that support this feature. More information
|
||||
can be found in the ABI documentation <a href="abi.txt"> here</a>
|
||||
can be found in the ABI documentation <a href="abi.html"> here</a>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<em>testsuite_allocator.h and </em>
|
||||
<em>testsuite_allocator.h</em>,
|
||||
<em>testsuite_allocator.cc</em>
|
||||
<p>
|
||||
Specialized allocators that keep track of construction and destruction
|
||||
Contains specialized allocators that keep track of construction
|
||||
and destruction. Also, support for overriding global new and
|
||||
delete operators, including verification that new and delete
|
||||
are called during execution, and that allocation over max_size
|
||||
fails.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<em>testsuite_hooks.h and </em>
|
||||
<em>testsuite_character.h</em>
|
||||
<p>
|
||||
Contains <code>std::char_traits</code> and
|
||||
<code>std::codecvt</code> specializations for a user-defined
|
||||
POD.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<em>testsuite_hooks.h</em>,
|
||||
<em>testsuite_hooks.cc</em>
|
||||
<p>
|
||||
A large number of utilities, including:
|
||||
|
@ -243,15 +267,30 @@ cat 27_io/objects/char/3_xin.in | a.out
|
|||
<li>run_tests_wrapped_locale</li>
|
||||
<li>run_tests_wrapped_env</li>
|
||||
<li>try_named_locale</li>
|
||||
<li>try_mkfifo</li>
|
||||
<li>func_callback</li>
|
||||
<li>counter</li>
|
||||
<li>copy_tracker</li>
|
||||
<li>copy_constructor</li>
|
||||
<li>assignment_operator</li>
|
||||
<li>destructor</li>
|
||||
<li>copy_tracker</li>
|
||||
<li>pod_char, pod_int and associated char_traits specializations</li>
|
||||
</ul>
|
||||
<p></p>
|
||||
</li>
|
||||
<li>
|
||||
<em>testsuite_io.h</em>
|
||||
<p>
|
||||
Error, exception, and constraint checking for
|
||||
<code>std::streambuf, std::basic_stringbuf, std::basic_filebuf</code>.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<em>testsuite_iterators.h</em>
|
||||
<p>
|
||||
Wrappers for various iterators.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<em>testsuite_performance.h</em>
|
||||
<p>
|
||||
|
@ -265,13 +304,6 @@ cat 27_io/objects/char/3_xin.in | a.out
|
|||
</ul>
|
||||
<p></p>
|
||||
</li>
|
||||
<li>
|
||||
<em>printnow.c</em>
|
||||
<p>
|
||||
A cross-platform timer for use in one of the older harnesses
|
||||
to determine compilation and link time.
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<hr />
|
||||
|
@ -407,9 +439,11 @@ normal.exp file.
|
|||
<hr />
|
||||
<h2><a name="check">Options for running the tests</a></h2>
|
||||
|
||||
<p> There are several ways to run the testsuite. There are two
|
||||
harnesses, one using dejagnu and one using bash. In addition, there
|
||||
is a special rule for checking the ABI of the shared library.
|
||||
<p> There are several options for running tests, including testing
|
||||
the regression tests, testing a subset of the regression tests,
|
||||
testing the performance tests, testing just compilation, testing
|
||||
installed tools, etc. In addition, there is a special rule for
|
||||
checking the exported symbols of the shared library.
|
||||
</p>
|
||||
|
||||
<p>You can check the status of the build without installing it
|
||||
|
@ -421,17 +455,74 @@ normal.exp file.
|
|||
<p>in the <em>gccbuilddir</em> directory.</p>
|
||||
|
||||
<p>
|
||||
These commands are equivalent and will create a 'testsuite'
|
||||
directory underneath <em>libbuilddir</em> containing the results
|
||||
of the tests. Two results files will be generated: <em>
|
||||
libstdc++-v3.sum</em>, which is a PASS/FAIL summary for each
|
||||
These commands are functionally equivalent and will create a
|
||||
'testsuite' directory underneath <em>libbuilddir</em> containing
|
||||
the results of the tests. Two results files will be generated:
|
||||
<em> libstdc++.sum</em>, which is a PASS/FAIL summary for each
|
||||
test, and <em>libstdc++.log</em> which is a log of the exact
|
||||
command line passed to the compiler, the compiler output, and
|
||||
the executable output (if any). In addition, four files are
|
||||
generated that determine what test files are run. These files
|
||||
are:
|
||||
the executable output (if any).
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
To debug the dejagnu test harness during runs, try invoking with a
|
||||
specific argument to the variable RUNTESTFLAGS, as below.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS="-v"
|
||||
</pre>
|
||||
or
|
||||
<pre>
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS="-v -v"
|
||||
</pre>
|
||||
|
||||
<p> To run a subset of the library tests, try using a command like the
|
||||
following from the <em>libbuilddir/testsuite</em> directory:
|
||||
</p>
|
||||
<pre>
|
||||
runtest --tool libstdc++ normal.exp="`find $srcdir/17_intro -name *.cc`"
|
||||
</pre>
|
||||
|
||||
|
||||
<p>
|
||||
There are two ways to run on a simulator: set up DEJAGNU to point to a
|
||||
specially crafted site.exp, or pass down --target_board flags.
|
||||
</p>
|
||||
Example flags to pass down for various embedded builds are as follows:
|
||||
<pre>
|
||||
--target=powerpc-eabism (libgloss/sim)
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=powerpc-sim"
|
||||
|
||||
--target=calmrisc32 (libgloss/sid)
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=calmrisc32-sid"
|
||||
|
||||
--target=xscale-elf (newlib/sim)
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=arm-sim"
|
||||
</pre>
|
||||
|
||||
<p> Also, here is an example of how to run the libstdc++ testsuite for a
|
||||
multilibed build directory with different ABI settings:
|
||||
</p>
|
||||
<pre>
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS='--target_board \"unix{-mabi=32,,-mabi=64}\"'
|
||||
</pre>
|
||||
|
||||
|
||||
<p> In addition, there are some testing options that are mostly of
|
||||
interest to library maintainers and system integrators. As such,
|
||||
these tests may not work on all cpu and host combinations, and may need to
|
||||
be executed in the <em>libbuilddir/testsuite</em> directory. These options
|
||||
include, but are not necessarily limited to, the following:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
make testsuite_files</pre>
|
||||
<p>
|
||||
Five files are generated that determine what test files
|
||||
are run. These files are:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<em>testsuite_files </em>
|
||||
|
@ -456,7 +547,14 @@ normal.exp file.
|
|||
</li>
|
||||
|
||||
<li>
|
||||
<em>testsuite_wchar_t </em>
|
||||
<em>testsuite_thread</em>
|
||||
<p> This file indicates that the host system can run tests which
|
||||
incolved multiple threads.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<em>testsuite_wchar_t</em>
|
||||
<p> This file indicates that the host system can run the wchar_t
|
||||
tests, and corresponds to the macro definition <code>
|
||||
_GLIBCXX_USE_WCHAR_T</code> in the file c++config.h.
|
||||
|
@ -464,83 +562,15 @@ normal.exp file.
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
To debug the dejagnu test harness during runs, try invoking with a
|
||||
specific argument to the variable RUNTESTFLAGS, as below.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS="-v"
|
||||
</pre>
|
||||
or
|
||||
<pre>
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS="-v -v"
|
||||
</pre>
|
||||
|
||||
|
||||
There are two ways to run on a simulator: set up DEJAGNU to point to a
|
||||
specially crafted site.exp, or pass down --target_board flags.
|
||||
|
||||
Example flags to pass down for various embedded builds are as follows:
|
||||
<pre>
|
||||
--target=powerpc-eabism (libgloss/sim)
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=powerpc-sim"
|
||||
|
||||
--target=calmrisc32 (libgloss/sid)
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=calmrisc32-sid"
|
||||
|
||||
--target=xscale-elf (newlib/sim)
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=arm-sim"
|
||||
</pre>
|
||||
|
||||
<p> Also, here is an example of how to run the libstdc++ testsuite for a
|
||||
multilibed build directory with different ABI settings:
|
||||
</p>
|
||||
<pre>
|
||||
make check-target-libstdc++-v3 RUNTESTFLAGS='--target_board \"unix{-mabi=32,,-mabi=64}\"'
|
||||
</pre>
|
||||
|
||||
<p> To run a subset of the library tests, simply edit the generated
|
||||
file, <em>testsuite_files </em>, to include only the files that are
|
||||
desired instead of all available test cases.
|
||||
</p>
|
||||
|
||||
<p> In addition, there are some testing options that are mostly of
|
||||
interest to library maintainers and system integrators. As such,
|
||||
these tests may not work on all cpu and host combinations, and must
|
||||
be executed in the <em>libbuilddir/testsuite</em> directory. These options
|
||||
include, but are not necessarily limited to, the following:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The library can also be tested using a bash script, instead of
|
||||
the default dejagnu test harness.
|
||||
</p>
|
||||
<pre>
|
||||
make check-script</pre>
|
||||
<p>
|
||||
These commands use the generated test_file lists as above, but
|
||||
run all the tests using both shared and static linking, and in
|
||||
addition provide some additional diffing of expected output
|
||||
files for the input/output tests. (This added diff may or may
|
||||
not be useful or necessary at the moment.) In addition, these
|
||||
tests provide size information for all the generated test cases,
|
||||
so that size data for new compiler or linker features can be
|
||||
collected. At one time timing information was attempted, so that
|
||||
compile speeds, link speeds, etc. could be measured, however at
|
||||
the moment all timing information is currently disabled.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
make check-script-install</pre>
|
||||
<p> As directly above, but tests an installed library, not the
|
||||
library and compiler in the build tree.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
make check-abi</pre>
|
||||
<p>The library ABI can be tested. This involves testing the shared
|
||||
library against an ABI-defining previous version. </p>
|
||||
library against an ABI-defining previous version of symbol exports. </p>
|
||||
|
||||
<pre>
|
||||
make check-compile</pre>
|
||||
<p>This rule compiles, but does not link or execute, the
|
||||
<em>testsuite_files</em> test cases and displays the output on stdout.</p>
|
||||
|
||||
<pre>
|
||||
make check-performance</pre>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -40,10 +40,9 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
|||
$(top_srcdir)/fragment.am
|
||||
subdir = include
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
|
||||
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/crossconfig.m4 $(top_srcdir)/linkage.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -42,10 +42,9 @@ target_triplet = @target@
|
|||
subdir = libmath
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
|
||||
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/crossconfig.m4 $(top_srcdir)/linkage.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -44,10 +44,9 @@ DIST_COMMON = $(glibcxxinstall_HEADERS) $(srcdir)/Makefile.am \
|
|||
$(srcdir)/Makefile.in $(top_srcdir)/fragment.am
|
||||
subdir = libsupc++
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
|
||||
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/crossconfig.m4 $(top_srcdir)/linkage.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -40,10 +40,9 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
|||
$(top_srcdir)/fragment.am
|
||||
subdir = po
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
|
||||
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/crossconfig.m4 $(top_srcdir)/linkage.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
|
|
|
@ -1,449 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Script to do automated testing and data collection for various test
|
||||
# files, so that we don't have to do this by hand on every test file.
|
||||
# It attempts to collect some diagnostic info about size and speed that
|
||||
# should be useful in the future as the library gets tuned for size
|
||||
# and speed. In addition, it tests static and shared linkage, iff each
|
||||
# has been enabled.
|
||||
|
||||
# Invocation
|
||||
# check_survey [01]
|
||||
|
||||
# 1: variables
|
||||
#
|
||||
# WHICH determines if you are
|
||||
# (0) testing the build binary and headers, or
|
||||
# (1) testing the installed binary and headers, or
|
||||
WHICH=$1
|
||||
if [ "$WHICH"x = 0x ]; then
|
||||
echo "running check_survey"
|
||||
echo "$0: testing the build directory"
|
||||
elif [ "$WHICH"x = 1x ]; then
|
||||
echo "running check_survey"
|
||||
echo "$0: testing the install directory"
|
||||
else
|
||||
echo 'Usage: check_survey 0 /* test the build directory */'
|
||||
echo ' check_survey 1 /* test the install directory */'
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
# Now that we've successfully translated the numerical option into
|
||||
# a symbolic one, we can safely ignore it.
|
||||
shift
|
||||
|
||||
# This has been true all along. Found out about it the hard way...
|
||||
case $BASH_VERSION in
|
||||
1*) echo 'You need bash 2.x to run check_survey. Exiting.'; exit 1 ;;
|
||||
*) ;; # ??
|
||||
esac
|
||||
|
||||
BUILD_DIR=@glibcxx_builddir@
|
||||
SRC_DIR=@glibcxx_srcdir@
|
||||
PREFIX_DIR=@glibcxx_prefixdir@
|
||||
if [ "$WHICH"x = 0x ]; then
|
||||
CXX=`$BUILD_DIR/scripts/testsuite_flags --build-cxx`
|
||||
INCLUDES=`$BUILD_DIR/scripts/testsuite_flags --build-includes`
|
||||
else
|
||||
CXX=`$BUILD_DIR/scripts/testsuite_flags --install-cxx`
|
||||
INCLUDES=`$BUILD_DIR/scripts/testsuite_flags --install-includes`
|
||||
fi
|
||||
CXXFLAGS=`$BUILD_DIR/scripts/testsuite_flags --cxxflags`
|
||||
LIBTOOL="$BUILD_DIR/libtool"
|
||||
LTEXE="$LIBTOOL --mode=execute"
|
||||
LTCXX="$CXX $CXXFLAGS $INCLUDES"
|
||||
|
||||
# specific libtool flag(s) to use shared libraries, if any
|
||||
SH_FLAG="-Wl,--rpath -Wl,$BUILD_DIR/../../gcc -Wl,--rpath -Wl,$BUILD_DIR/src/.libs"
|
||||
|
||||
# specific libtool flag(s) to use static libraries, if any
|
||||
ST_FLAG="-static"
|
||||
|
||||
# Set up the testing directory, which should be in a directory called
|
||||
# "testsuite" in the root level of the build directory.
|
||||
TEST_DIR="$BUILD_DIR/testsuite"
|
||||
# help libtool keep quiet
|
||||
if [ ! -d ${TEST_DIR}/.libs ]; then
|
||||
mkdir $TEST_DIR/.libs
|
||||
fi
|
||||
|
||||
# the name of the file that will collect and hold all this useful data:
|
||||
RESULTS_FILE="$TEST_DIR/$(date +%Y%m%d)-check_survey.txt"
|
||||
|
||||
# the name of the log file that will append compiler diagnostics:
|
||||
LOG_FILE="$TEST_DIR/$(date +%Y%m%d)-check_survey_log.txt"
|
||||
|
||||
#
|
||||
# 2: clean, make files, append general test info
|
||||
#
|
||||
|
||||
# Remove old executables.
|
||||
rm -rf "$TEST_DIR"/*exe
|
||||
rm -rf "$TEST_DIR"/compile.out
|
||||
|
||||
# Remove old core files (which now get left in cwd, not $TEST_DIR).
|
||||
rm -rf ./*core*
|
||||
|
||||
if [ -f $RESULTS_FILE ]; then
|
||||
rm $RESULTS_FILE
|
||||
fi
|
||||
if [ -f $LOG_FILE ]; then
|
||||
rm $LOG_FILE
|
||||
fi
|
||||
|
||||
# the names of the specific test files to be run
|
||||
TESTS_FILE="$TEST_DIR/$(date +%Y%m%d)-check_survey_files.txt"
|
||||
|
||||
# Make a list of the files we're going to run, or use an old one if it exists.
|
||||
if [ ! -f "$TESTS_FILE" ]; then
|
||||
if [ -f "$TEST_DIR/testsuite_files" ]; then
|
||||
cp $TEST_DIR/testsuite_files $TESTS_FILE
|
||||
else
|
||||
echo "making file $TESTS_FILE"
|
||||
for LONG_NAME in $SRC_DIR/testsuite/*/*.cc
|
||||
do
|
||||
DIR_NAME=$(dirname $LONG_NAME)
|
||||
SHORT_NAME="`basename $DIR_NAME`/`basename $LONG_NAME`"
|
||||
echo "$SHORT_NAME" >> $TESTS_FILE
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
# Nasty solution to replace GNU date(1)'s %s time_t output function.
|
||||
TIMER_COMMAND=$TEST_DIR/printnow.exe
|
||||
if [ ! -x "$TIMER_COMMAND" ]; then
|
||||
echo "making utility $TIMER_COMMAND"
|
||||
gcc -o "$TIMER_COMMAND" "$SRC_DIR/testsuite/printnow.c"
|
||||
strip "$TIMER_COMMAND"
|
||||
fi
|
||||
|
||||
# Copy over the data files for filebufs
|
||||
cp $SRC_DIR/testsuite/27_io/*.txt $TEST_DIR
|
||||
cp $SRC_DIR/testsuite/27_io/*.tst $TEST_DIR
|
||||
chmod u+w $TEST_DIR/*.txt
|
||||
chmod u+w $TEST_DIR/*.tst
|
||||
|
||||
# Emit useful info about compiler and platform
|
||||
echo "host: $(uname -mrsv)" >> $RESULTS_FILE
|
||||
echo "compiler: $($CXX -v 2>&1)" >> $RESULTS_FILE
|
||||
echo "compiler flags: $CXXFLAGS" >> $RESULTS_FILE
|
||||
echo "date: $(date +%Y%m%d)" >> $RESULTS_FILE
|
||||
echo "" >> $RESULTS_FILE
|
||||
|
||||
explanation='+: pass, -b: build failure, -r: run failure, x: disabled'
|
||||
printf "%s\n %s\n" 'p == pass/fail execution test' "$explanation" \
|
||||
>> $RESULTS_FILE
|
||||
echo "ctime == time to compile and link" >> $RESULTS_FILE
|
||||
echo "etime == time for executable to run" >> $RESULTS_FILE
|
||||
echo "text == size of the executable text section" >> $RESULTS_FILE
|
||||
echo "data == size of the executable data section" >> $RESULTS_FILE
|
||||
echo "total == size of the executable" >> $RESULTS_FILE
|
||||
echo "" >> $RESULTS_FILE
|
||||
|
||||
echo "p" | awk '{printf("%s ", $1)}' >> $RESULTS_FILE
|
||||
echo "ctime" "etime" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
|
||||
echo "text" "data" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
|
||||
echo "total" "name" | awk '{printf("%s\t%s\t", $1, $2)}' >> $RESULTS_FILE
|
||||
echo "" >> $RESULTS_FILE
|
||||
|
||||
# Counters. These could be members of an array, but they'd all have to
|
||||
# become individuals anyhow if we ever change this script to super-portable sh.
|
||||
shared_pass=0
|
||||
shared_fail=0
|
||||
static_pass=0
|
||||
static_fail=0
|
||||
|
||||
|
||||
#
|
||||
# 2.5: support functions
|
||||
#
|
||||
|
||||
# Figure out how to extract size information from binaries. We take
|
||||
# the text of the value we want as an argument, and leave the size in
|
||||
# the appropriate variable.
|
||||
#
|
||||
# We discover what kind of size(1) we are using *once* and build a shell
|
||||
# function named 'size_command' to wrap it. (The "function" keyword is
|
||||
# redundant here, but helps me read it, so there.) Previously we were
|
||||
# re-discovering the size(1) arguments three times for each test; sloooow.
|
||||
#
|
||||
# It is VERY IMPORTANT not to compare these numbers across platforms.
|
||||
# Different size(1)'s extract section information differently. For
|
||||
# example, using the native Sun size(1) and GNU size(1) built for Suns
|
||||
# on the exact same binary will give very different numbers, due to all
|
||||
# the variance in command-line options and arbitrary names of ELF sections.
|
||||
#
|
||||
# and suddenly we go to 2-space indentations...
|
||||
setup_size_command()
|
||||
{
|
||||
if size --version 2> /dev/null | grep -c GNU > /dev/null;
|
||||
then # Then we're using a GNU size(1) built for this platform.
|
||||
# We lose .rodata and .data1 and who knows what else... kludge.
|
||||
function size_command()
|
||||
{
|
||||
case $1 in
|
||||
TEXT) TEXT=$(size -B $EXENAME | tail -1 | awk '{print $1}') ;;
|
||||
DATA) DATA=$(size -B $EXENAME | tail -1 | awk '{print $2}') ;;
|
||||
SIZE) SIZE=$(size -B $EXENAME | tail -1 | awk '{print $4}') ;;
|
||||
esac
|
||||
}
|
||||
else
|
||||
# Not using GNU size; check for platform. These numbers seem to match
|
||||
# up to text/data/total, although their meanings seem to be different.
|
||||
# THIS TABLE IS SORTED. KEEP IT THAT WAY.
|
||||
case @host_os@ in
|
||||
*aix*)
|
||||
function size_command()
|
||||
{
|
||||
case $1 in
|
||||
TEXT) TEXT=$(size -X32_64 $EXENAME | awk '{print $2}') ;;
|
||||
DATA) DATA=$(size -X32_64 $EXENAME | awk '{print $4}') ;;
|
||||
SIZE) SIZE=$(size -X32_64 $EXENAME | awk '{print $12}') ;;
|
||||
esac
|
||||
}
|
||||
;;
|
||||
*hpux*)
|
||||
function size_command()
|
||||
{
|
||||
case $1 in
|
||||
TEXT) TEXT=$(size $EXENAME | awk '{print $1}') ;;
|
||||
DATA) DATA=$(size $EXENAME | awk '{print $3}') ;;
|
||||
SIZE) SIZE=$(size $EXENAME | awk '{print $7}') ;;
|
||||
esac
|
||||
}
|
||||
;;
|
||||
*irix*)
|
||||
function size_command()
|
||||
{
|
||||
case $1 in
|
||||
TEXT) TEXT=$(size -4 $EXENAME | awk '{print $1}') ;;
|
||||
DATA) DATA=$(size -4 $EXENAME | awk '{print $3}') ;;
|
||||
SIZE) SIZE=$(size -4 $EXENAME | awk '{print $7}') ;;
|
||||
esac
|
||||
}
|
||||
;;
|
||||
*solaris*)
|
||||
function size_command()
|
||||
{
|
||||
case $1 in
|
||||
TEXT) TEXT=$(size $EXENAME | awk '{print $1}') ;;
|
||||
DATA) DATA=$(size $EXENAME | awk '{print $3}') ;;
|
||||
SIZE) SIZE=$(size $EXENAME | awk '{print $7}') ;;
|
||||
esac
|
||||
}
|
||||
;;
|
||||
*)
|
||||
echo ' * Warning! Skipping section sizes!' 1>&2
|
||||
function size_command()
|
||||
{
|
||||
case $1 in
|
||||
TEXT) TEXT=0 ;;
|
||||
DATA) DATA=0 ;;
|
||||
SIZE) SIZE=0 ;;
|
||||
esac
|
||||
}
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
# Test for file output
|
||||
test_for_output()
|
||||
{
|
||||
# This checks for emitted output files, which is useful when
|
||||
# testing file-related output. The rules for this working are as
|
||||
# follows: the emitted file must have the ".txt" extension, and be
|
||||
# based on the actual *.cc file's name. For example, 27/filbuf.cc
|
||||
# currently outputs files named 27/filebuf-2.txt and 27/filebuf-3.txt.
|
||||
# Also, the first emitted file must be in the form $NAME-1.txt.
|
||||
# The control file must follow the same constraints, but have a
|
||||
# ".tst" extension. Thus, you have 27/filebuf-2.tst, etc.
|
||||
|
||||
# NAME contains the source name, like 27/filebuf.cc
|
||||
# From that NAME, we want to generate some possible names, using
|
||||
# ls on MATCH, a pattern description generated with sed.
|
||||
|
||||
# this is the name of the resulting diff file, if any
|
||||
DIFF_FILE="`echo $TEST_NAME | sed 's/cc$/diff/'`"
|
||||
# construct wildcard names, ie for $NAME=filebuf.cc, makes "filebuf*.tst"
|
||||
DATA_FILES="`echo $TEST_NAME | sed 's/\.cc/\*\.tst/g'`"
|
||||
# make sure there is at least one, then go
|
||||
ST_E="`echo $TEST_NAME | sed 's/\.cc/\-1\.tst/g'`"
|
||||
if [ -f $ST_E ]; then
|
||||
# list of actual files that match the wildcard above, ie
|
||||
# "filebuf-1.tst"
|
||||
ST_MATCH_LIST="`ls $DATA_FILES`"
|
||||
for i in $ST_MATCH_LIST; do
|
||||
# ST_OUT_FILE is generated in the build directory.
|
||||
PRE_NAME2="$TEST_DIR/`basename $i`"
|
||||
ST_OUT_FILE="`echo $PRE_NAME2 | sed 's/tst$/txt/'`"
|
||||
diff $ST_OUT_FILE $i > $DIFF_FILE
|
||||
if [ -s $DIFF_FILE ]; then
|
||||
RESULT="-r"
|
||||
else
|
||||
RESULT="+"
|
||||
fi
|
||||
rm $DIFF_FILE
|
||||
done
|
||||
else
|
||||
# the file does no output, and didn't abnormally
|
||||
# terminate, so assume passed.
|
||||
RESULT="+"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# 3: compile, link, execute, time
|
||||
#
|
||||
# Abstract out the common code for compiling, linking, executing and printing.
|
||||
test_file()
|
||||
{
|
||||
# NB: S_FLAG has to be last argument because it may be null, and
|
||||
# error checking hasn't been invented yet.
|
||||
NAME=$1
|
||||
EXENAME=$2
|
||||
S_FLAG=$3
|
||||
|
||||
SRC_NAME="$SRC_DIR/testsuite/$1"
|
||||
TEST_NAME="$TEST_DIR/`basename $NAME`"
|
||||
|
||||
# This would be deliciously easy if GNU date's %s were always around.
|
||||
# There are three ways to do this: 1) use the builtin 'time' like we
|
||||
# do later; then getting compiler errors into LOG_FILE is a nightmare.
|
||||
# 2) Grab the output of a formatted date(1) and do the math; harder
|
||||
# and harder as we try compiling at, say, top of the hour; we would
|
||||
# eventually have to calculate time_t anyhow. Or 3) just grab two
|
||||
# time_t's (no more overhead than grabbing two date(1)'s).
|
||||
our_libs="-L$TEST_DIR -lv3test"
|
||||
compiler_invocation="$LTCXX $S_FLAG $SRC_NAME -o $EXENAME $our_libs"
|
||||
echo $compiler_invocation >> compile.out 2>&1
|
||||
COMP_TIME_START=$($TIMER_COMMAND)
|
||||
$compiler_invocation >> compile.out 2>&1
|
||||
COMP_TIME_END=$($TIMER_COMMAND)
|
||||
|
||||
if [ $COMP_TIME_START -lt $COMP_TIME_END ]; then
|
||||
C_TIME=$[ $COMP_TIME_END - $COMP_TIME_START ]
|
||||
else
|
||||
C_TIME="0"
|
||||
fi
|
||||
|
||||
if [ -f $EXENAME ]; then
|
||||
# rm compile.out
|
||||
size_command TEXT
|
||||
size_command DATA
|
||||
size_command SIZE
|
||||
|
||||
# Actually run the executable and time it. Note that output
|
||||
# printed by the executable will be lost and cannot be redirected,
|
||||
# because we need to capture the output of 'time'. Bummer.
|
||||
TIMEFORMAT='timemark %R'
|
||||
E_TIME_TEXT="$(exec 2>&1; time $LTEXE $EXENAME)"
|
||||
E_ABNORMAL_TERMINATION=$?
|
||||
|
||||
if [ "$E_ABNORMAL_TERMINATION" -ne 0 ]; then
|
||||
RESULT='-r'
|
||||
E_TIME="0"
|
||||
rm -f ./*core
|
||||
# sometimes you want to save all core files for review:
|
||||
#mv ./core $EXENAME.core
|
||||
# sometimes the OS allows you to name core files yourself:
|
||||
#mv ./*core $EXENAME.core
|
||||
#mv ./core* $EXENAME.core
|
||||
else
|
||||
test_for_output
|
||||
# XXX This doesn't always result in a number.
|
||||
# E_TIME="$(echo $E_TIME_TEXT | awk '{print $2}')"
|
||||
E_TIME="0"
|
||||
fi
|
||||
|
||||
# sometimes you want to save all failing exe files for review:
|
||||
if [ "$RESULT" = '+' ]; then
|
||||
rm "$EXENAME"
|
||||
fi
|
||||
else
|
||||
# the file did not compile/link.
|
||||
printf "\n" >> $LOG_FILE
|
||||
`cat compile.out >> $LOG_FILE`
|
||||
rm compile.out
|
||||
RESULT="-b"
|
||||
TEXT="0"
|
||||
DATA="0"
|
||||
SIZE="0"
|
||||
fi
|
||||
|
||||
# update the counters
|
||||
if test "$RESULT" = "+" ; then
|
||||
if test x"$S_FLAG" = x"$ST_FLAG"; then
|
||||
static_pass=`expr $static_pass + 1`
|
||||
else
|
||||
shared_pass=`expr $shared_pass + 1`
|
||||
fi
|
||||
else
|
||||
if test x"$S_FLAG" = x"$ST_FLAG"; then
|
||||
static_fail=`expr $static_fail + 1`
|
||||
else
|
||||
shared_fail=`expr $shared_fail + 1`
|
||||
fi
|
||||
fi
|
||||
|
||||
printf "%s\t" "$RESULT"
|
||||
printf "%-2s %d\t%.3f\t%s\t%s\t%s\t%s %s\n" \
|
||||
"$RESULT" $C_TIME $E_TIME $TEXT $DATA $SIZE $NAME >> $RESULTS_FILE
|
||||
}
|
||||
|
||||
setup_size_command
|
||||
echo ""
|
||||
echo "Detailed test results in .${RESULTS_FILE/$BUILD_DIR}"
|
||||
echo $explanation
|
||||
echo "------------------------------------------------------------------------"
|
||||
printf "static\tshared\ttest\n"
|
||||
echo "------------------------------------------------------------------------"
|
||||
|
||||
TEST_TIME_START=$($TIMER_COMMAND)
|
||||
for NAME in `cat $TESTS_FILE`
|
||||
do
|
||||
PRE_NAME="$TEST_DIR/`basename $NAME`"
|
||||
ST_NAME="`echo $PRE_NAME | sed 's/cc$/st-exe/'`"
|
||||
SH_NAME="`echo $PRE_NAME | sed 's/cc$/sh-exe/'`"
|
||||
|
||||
if test @enable_static@ = yes; then
|
||||
test_file $NAME $ST_NAME "$ST_FLAG"
|
||||
else
|
||||
printf "x\t"
|
||||
printf "static skipped\n" >> $RESULTS_FILE
|
||||
fi
|
||||
if test @enable_shared@ = yes; then
|
||||
test_file $NAME $SH_NAME "$SH_FLAG"
|
||||
else
|
||||
printf "x\t"
|
||||
printf "shared skipped\n" >> $RESULTS_FILE
|
||||
fi
|
||||
printf "%s\n" "$NAME"
|
||||
|
||||
echo "" >> $RESULTS_FILE
|
||||
done
|
||||
TEST_TIME_END=$($TIMER_COMMAND)
|
||||
|
||||
|
||||
#
|
||||
# 4: summary
|
||||
#
|
||||
# grep can count faster than we can...
|
||||
total_failures=`expr ${shared_fail} + ${static_fail}`
|
||||
total_successes=`expr ${shared_pass} + ${static_pass}`
|
||||
resultstext="pass/fail results: ${static_pass}/${static_fail} static + ${shared_pass}/${shared_fail} shared = ${total_successes}/${total_failures} total"
|
||||
if [ $total_failures -eq 0 ]; then
|
||||
resultstext="${resultstext}, WIN WIN"
|
||||
fi
|
||||
sed -e "/^date:/a\\
|
||||
$resultstext" $RESULTS_FILE > ${RESULTS_FILE}.tmp
|
||||
mv ${RESULTS_FILE}.tmp $RESULTS_FILE
|
||||
|
||||
if [ $TEST_TIME_START -lt $TEST_TIME_END ]; then
|
||||
TEST_TIME=$[ $TEST_TIME_END - $TEST_TIME_START ]
|
||||
echo "testrun == $TEST_TIME seconds"
|
||||
echo "testrun == $TEST_TIME seconds" >> $RESULTS_FILE
|
||||
fi
|
||||
|
||||
exit 0
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -42,10 +42,9 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
|||
$(top_srcdir)/fragment.am
|
||||
subdir = src
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
|
||||
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/crossconfig.m4 $(top_srcdir)/linkage.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -32,6 +32,7 @@
|
|||
#include <sstream>
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
void test01()
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -32,6 +32,7 @@
|
|||
#include <sstream>
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
void test01()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2003-07-09 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -22,9 +22,8 @@
|
|||
#include <sstream>
|
||||
#include <ostream>
|
||||
#include <stdexcept>
|
||||
#include <ext/pod_char_traits.h>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// Check for numpunct and ctype dependencies. Make sure that numpunct
|
||||
// can be created without ctype.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2003-07-09 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -22,8 +22,8 @@
|
|||
#include <sstream>
|
||||
#include <ostream>
|
||||
#include <stdexcept>
|
||||
#include <ext/pod_char_traits.h>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// Check for numpunct and ctype dependencies. Make sure that numpunct
|
||||
// can be created without ctype.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
// Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <fstream>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include <fstream>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 1999-09-20 bkoz
|
||||
|
||||
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
|
||||
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
// Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include <istream>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2001-06-05 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -32,6 +32,7 @@
|
|||
#include <sstream>
|
||||
#include <typeinfo>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// libstdc++/3983
|
||||
// Sentry uses locale info, so have to try one formatted input/output.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include <sstream>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2001-06-05 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -32,6 +32,7 @@
|
|||
#include <sstream>
|
||||
#include <typeinfo>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// libstdc++/3983
|
||||
// Sentry uses locale info, so have to try one formatted input/output.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2001-06-05 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -32,6 +32,7 @@
|
|||
#include <sstream>
|
||||
#include <typeinfo>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// libstdc++/3983
|
||||
// Sentry uses locale info, so have to try one formatted input/output.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 1999-10-14 bkoz
|
||||
|
||||
// Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -33,6 +33,7 @@
|
|||
#include <sstream>
|
||||
#include <ext/pod_char_traits.h>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
void test01()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 1999-09-20 bkoz
|
||||
|
||||
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
|
||||
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
// Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include <ostream>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 1999-10-14 bkoz
|
||||
|
||||
// Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -33,6 +33,7 @@
|
|||
#include <sstream>
|
||||
#include <ext/pod_char_traits.h>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
void test01()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include <streambuf>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 1999-01-17 bkoz test functionality of basic_filebuf for char_type == char
|
||||
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
// Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <sstream>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2003-04-07 bkoz
|
||||
|
||||
// Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -24,6 +24,7 @@
|
|||
#include <sstream>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_allocator.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2002-07-25 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
// Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include <sstream>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003, 2004
|
||||
// Copyright (C) 2003, 2004, 2005
|
||||
// Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <ios>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
## Makefile for the testsuite subdirectory of the GNU C++ Standard library.
|
||||
##
|
||||
## Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
##
|
||||
## This file is part of the libstdc++ version 3 distribution.
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
|
@ -48,6 +48,7 @@ noinst_LIBRARIES = libv3test.a
|
|||
libv3test_a_SOURCES = \
|
||||
testsuite_abi.cc \
|
||||
testsuite_allocator.cc \
|
||||
testsuite_character.cc \
|
||||
testsuite_hooks.cc
|
||||
|
||||
all-local: stamp_wchar stamp_thread
|
||||
|
@ -75,6 +76,10 @@ lists_of_files = \
|
|||
testsuite_files_interactive \
|
||||
testsuite_files_performance
|
||||
|
||||
# This rule generates all of the testsuite_files* lists at once.
|
||||
${lists_of_files}:
|
||||
${glibcxx_srcdir}/scripts/create_testsuite_files \
|
||||
${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
|
||||
|
||||
# We need more things in site.exp, but automake completely controls the
|
||||
# creation of that file; there's no way to append to it without messing up
|
||||
|
@ -103,6 +108,7 @@ site.exp: Makefile
|
|||
@test ! -f site.exp || mv site.exp site.bak
|
||||
@mv site.tmp site.exp
|
||||
|
||||
|
||||
baseline_file = ${baseline_dir}/baseline_symbols.txt
|
||||
extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
|
||||
|
||||
|
@ -133,20 +139,14 @@ else
|
|||
check-abi:
|
||||
endif
|
||||
|
||||
|
||||
# These two special 'check-script' rules use the bash script
|
||||
# 'check_survey' to do testing. This script is not as portable as the
|
||||
# dejagnu test harness, and is thus off by default. It does produce
|
||||
# interesting output however, including various performance analysis
|
||||
# items like compile time, execution time, and binary size.
|
||||
survey_script = ${glibcxx_builddir}/scripts/check_survey
|
||||
check-script: ${survey_script}
|
||||
-@(chmod + ${survey_script}; \
|
||||
${survey_script} 0)
|
||||
|
||||
check-script-install: ${survey_script}
|
||||
-@(chmod + ${survey_script}; \
|
||||
${survey_script} 0)
|
||||
# Runs the testsuite, but in compile only mode.
|
||||
# Can be used to test sources with non-GNU FE's at various warning
|
||||
# levels and for checking compile time across releases.
|
||||
# See script.
|
||||
compile_script=${glibcxx_srcdir}/scripts/check_compile
|
||||
check-compile: testsuite_files ${compile_script}
|
||||
-@(chmod + ${compile_script}; \
|
||||
${compile_script} ${glibcxx_srcdir} ${glibcxx_builddir})
|
||||
|
||||
|
||||
# Runs the testsuite/performance tests.
|
||||
|
@ -158,21 +158,9 @@ check-performance: testsuite_files_performance ${performance_script}
|
|||
-@(chmod + ${performance_script}; \
|
||||
${performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
|
||||
|
||||
# Runs the testsuite, but in compile only mode, and times it.
|
||||
# See script.
|
||||
compile_script=${glibcxx_srcdir}/scripts/check_compile
|
||||
check-compile: testsuite_files ${compile_script}
|
||||
-@(chmod + ${compile_script}; \
|
||||
${compile_script} ${glibcxx_srcdir} ${glibcxx_builddir})
|
||||
|
||||
# This rule generates all of the testsuite_files* lists at once.
|
||||
${lists_of_files}:
|
||||
${glibcxx_srcdir}/scripts/create_testsuite_files \
|
||||
${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
|
||||
|
||||
|
||||
.PHONY: baseline_symbols new-abi-baseline check-abi check-abi-verbose \
|
||||
check-script check-script-install check-performance
|
||||
.PHONY: baseline_symbols new-abi-baseline \
|
||||
check-abi check-compile check-performance
|
||||
|
||||
# By adding these files here, automake will remove them for 'make clean'
|
||||
CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
|
@ -43,10 +43,9 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
|||
$(top_srcdir)/fragment.am
|
||||
subdir = testsuite
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \
|
||||
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/crossconfig.m4 $(top_srcdir)/linkage.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
|
@ -56,7 +55,8 @@ ARFLAGS = cru
|
|||
libv3test_a_AR = $(AR) $(ARFLAGS)
|
||||
libv3test_a_LIBADD =
|
||||
am_libv3test_a_OBJECTS = testsuite_abi.$(OBJEXT) \
|
||||
testsuite_allocator.$(OBJEXT) testsuite_hooks.$(OBJEXT)
|
||||
testsuite_allocator.$(OBJEXT) testsuite_character.$(OBJEXT) \
|
||||
testsuite_hooks.$(OBJEXT)
|
||||
libv3test_a_OBJECTS = $(am_libv3test_a_OBJECTS)
|
||||
DEFAULT_INCLUDES =
|
||||
depcomp =
|
||||
|
@ -280,6 +280,7 @@ noinst_LIBRARIES = libv3test.a
|
|||
libv3test_a_SOURCES = \
|
||||
testsuite_abi.cc \
|
||||
testsuite_allocator.cc \
|
||||
testsuite_character.cc \
|
||||
testsuite_hooks.cc
|
||||
|
||||
|
||||
|
@ -293,12 +294,11 @@ lists_of_files = \
|
|||
baseline_file = ${baseline_dir}/baseline_symbols.txt
|
||||
extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
|
||||
|
||||
# These two special 'check-script' rules use the bash script
|
||||
# 'check_survey' to do testing. This script is not as portable as the
|
||||
# dejagnu test harness, and is thus off by default. It does produce
|
||||
# interesting output however, including various performance analysis
|
||||
# items like compile time, execution time, and binary size.
|
||||
survey_script = ${glibcxx_builddir}/scripts/check_survey
|
||||
# Runs the testsuite, but in compile only mode.
|
||||
# Can be used to test sources with non-GNU FE's at various warning
|
||||
# levels and for checking compile time across releases.
|
||||
# See script.
|
||||
compile_script = ${glibcxx_srcdir}/scripts/check_compile
|
||||
|
||||
# Runs the testsuite/performance tests.
|
||||
# Some of these tests create large (~75MB) files, allocate huge
|
||||
|
@ -306,10 +306,6 @@ survey_script = ${glibcxx_builddir}/scripts/check_survey
|
|||
# running this is off by default.
|
||||
performance_script = ${glibcxx_srcdir}/scripts/check_performance
|
||||
|
||||
# Runs the testsuite, but in compile only mode, and times it.
|
||||
# See script.
|
||||
compile_script = ${glibcxx_srcdir}/scripts/check_compile
|
||||
|
||||
# By adding these files here, automake will remove them for 'make clean'
|
||||
CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
|
||||
testsuite_* site.exp abi_check baseline_symbols *TEST*
|
||||
|
@ -577,6 +573,11 @@ all-local: stamp_wchar stamp_thread
|
|||
@GLIBCXX_TEST_THREAD_TRUE@ touch testsuite_thread
|
||||
@GLIBCXX_TEST_THREAD_FALSE@stamp_thread:
|
||||
|
||||
# This rule generates all of the testsuite_files* lists at once.
|
||||
${lists_of_files}:
|
||||
${glibcxx_srcdir}/scripts/create_testsuite_files \
|
||||
${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
|
||||
|
||||
# We need more things in site.exp, but automake completely controls the
|
||||
# creation of that file; there's no way to append to it without messing up
|
||||
# the dependancy chains. So we overrule automake. This rule is exactly
|
||||
|
@ -627,27 +628,15 @@ new-abi-baseline:
|
|||
@GLIBCXX_TEST_ABI_TRUE@check-abi: baseline_symbols site.exp
|
||||
@GLIBCXX_TEST_ABI_TRUE@ -@runtest --tool libstdc++ abi.exp
|
||||
@GLIBCXX_TEST_ABI_FALSE@check-abi:
|
||||
check-script: ${survey_script}
|
||||
-@(chmod + ${survey_script}; \
|
||||
${survey_script} 0)
|
||||
|
||||
check-script-install: ${survey_script}
|
||||
-@(chmod + ${survey_script}; \
|
||||
${survey_script} 0)
|
||||
check-performance: testsuite_files_performance ${performance_script}
|
||||
-@(chmod + ${performance_script}; \
|
||||
${performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
|
||||
check-compile: testsuite_files ${compile_script}
|
||||
-@(chmod + ${compile_script}; \
|
||||
${compile_script} ${glibcxx_srcdir} ${glibcxx_builddir})
|
||||
check-performance: testsuite_files_performance ${performance_script}
|
||||
-@(chmod + ${performance_script}; \
|
||||
${performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
|
||||
|
||||
# This rule generates all of the testsuite_files* lists at once.
|
||||
${lists_of_files}:
|
||||
${glibcxx_srcdir}/scripts/create_testsuite_files \
|
||||
${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
|
||||
|
||||
.PHONY: baseline_symbols new-abi-baseline check-abi check-abi-verbose \
|
||||
check-script check-script-install check-performance
|
||||
.PHONY: baseline_symbols new-abi-baseline \
|
||||
check-abi check-compile check-performance
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2004-08-25 Benjamin Kosnik <bkoz@redhat.com>
|
||||
//
|
||||
// Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -18,9 +18,10 @@
|
|||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
#include <memory>
|
||||
#include <ext/mt_allocator.h>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// Tune characteristics.
|
||||
// __common_pool_policy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2004-08-25 Benjamin Kosnik <bkoz@redhat.com>
|
||||
//
|
||||
// Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -18,9 +18,10 @@
|
|||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
|
||||
#include <testsuite_hooks.h>
|
||||
#include <memory>
|
||||
#include <ext/mt_allocator.h>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// Tune characteristics.
|
||||
// __per_type_pool_policy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// 2003-02-11 Paolo Carlini <pcarlini@unitus.it>
|
||||
|
||||
// Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <ext/stdio_filebuf.h>
|
||||
#include <testsuite_hooks.h>
|
||||
#include <testsuite_character.h>
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
|
|
|
@ -86,7 +86,8 @@ proc libstdc++_init { testfile } {
|
|||
global ld_library_path
|
||||
global target_triplet
|
||||
|
||||
# We set LC_ALL and LANG to C so that we get the same error messages as expected.
|
||||
# We set LC_ALL and LANG to C so that we get the same error
|
||||
# messages as expected.
|
||||
setenv LC_ALL C
|
||||
setenv LANG C
|
||||
|
||||
|
@ -295,6 +296,10 @@ proc v3_target_compile { source dest type options } {
|
|||
return [target_compile $source $dest $type $options]
|
||||
}
|
||||
|
||||
|
||||
# XXX Fix me.
|
||||
# This is a complete hack: why do we build libv3test.a and then not use it?
|
||||
# This duplicates all the make logic. Boo: pick one way to do it, not two.
|
||||
# Build the support objects linked in with the libstdc++ tests. In
|
||||
# addition, set v3-wchar_t, v3-threads, and v3-test_objs
|
||||
# appropriately.
|
||||
|
@ -327,7 +332,7 @@ proc v3-build_support {} {
|
|||
|
||||
# Build the support objects.
|
||||
set source_files \
|
||||
[list testsuite_abi.cc testsuite_allocator.cc testsuite_hooks.cc]
|
||||
[list testsuite_abi.cc testsuite_allocator.cc testsuite_character.cc testsuite_hooks.cc]
|
||||
foreach f $source_files {
|
||||
set object_file [file rootname $f].o
|
||||
# Compile with "-w" so that warnings issued by the compiler
|
||||
|
|
|
@ -30,9 +30,9 @@ remote_exec "build" "$srcdir/../scripts/extract_symvers" \
|
|||
v3-build_support
|
||||
|
||||
# Build the abi_check program.
|
||||
if { [v3_target_compile "$srcdir/abi_check.cc" "abi_check" \
|
||||
if { [v3_target_compile "$srcdir/testsuite_abi_check.cc" "abi_check" \
|
||||
"executable" [list "additional_flags=-w"]] != "" } {
|
||||
error "could not compile abi_check.cc"
|
||||
error "could not compile testsuite_abi_check.cc"
|
||||
}
|
||||
|
||||
remote_download "target" $baseline_file "baseline_symbols.txt"
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
/* Prints the current time_t to stdout. Equivalent to the
|
||||
* nonstandard %s format option to GNU date(1).
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
printf ("%lu\n", time(NULL));
|
||||
exit(0);
|
||||
}
|
187
libstdc++-v3/testsuite/testsuite_character.cc
Normal file
187
libstdc++-v3/testsuite/testsuite_character.cc
Normal file
|
@ -0,0 +1,187 @@
|
|||
// -*- C++ -*-
|
||||
|
||||
// Utility subroutines for the C++ library testsuite.
|
||||
//
|
||||
// Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
// terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2, or (at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along
|
||||
// with this library; see the file COPYING. If not, write to the Free
|
||||
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
// As a special exception, you may use this file as part of a free software
|
||||
// library without restriction. Specifically, if other files instantiate
|
||||
// templates or use macros or inline functions from this file, or you compile
|
||||
// this file and link it with other files to produce an executable, this
|
||||
// file does not by itself cause the resulting executable to be covered by
|
||||
// the GNU General Public License. This exception does not however
|
||||
// invalidate any other reasons why the executable file might be covered by
|
||||
// the GNU General Public License.
|
||||
|
||||
#include <testsuite_character.h>
|
||||
|
||||
namespace std
|
||||
{
|
||||
locale::id
|
||||
codecvt<__gnu_test::character, char, __gnu_test::conversion_state>::id;
|
||||
|
||||
// Member specializations for the existing facet classes.
|
||||
// NB: This isn't especially portable. Perhaps a better way would be
|
||||
// to just specialize all of numpunct and ctype.
|
||||
using __gnu_test::int_type;
|
||||
using __gnu_test::value_type;
|
||||
using __gnu_test::pod_type;
|
||||
|
||||
template<>
|
||||
bool
|
||||
ctype<pod_type>::
|
||||
do_is(mask, char_type) const { return true; }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_is(const char_type* __lo, const char_type*, mask*) const
|
||||
{ return __lo; }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_scan_is(mask, const char_type* __lo, const char_type*) const
|
||||
{ return __lo; }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_scan_not(mask, const char_type* __lo, const char_type*) const
|
||||
{ return __lo; }
|
||||
|
||||
template<>
|
||||
pod_type
|
||||
ctype<pod_type>::
|
||||
do_toupper(char_type __c) const
|
||||
{ return __c; }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_toupper(char_type*, const char_type* __hi) const
|
||||
{ return __hi; }
|
||||
|
||||
template<>
|
||||
pod_type
|
||||
ctype<pod_type>::
|
||||
do_tolower(char_type __c) const
|
||||
{ return __c; }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_tolower(char_type*, const char_type* __hi) const
|
||||
{ return __hi; }
|
||||
|
||||
template<>
|
||||
pod_type
|
||||
ctype<pod_type>::
|
||||
do_widen(char __c) const
|
||||
{
|
||||
char_type ret = { value_type(__c) };
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<>
|
||||
const char*
|
||||
ctype<pod_type>::
|
||||
do_widen(const char* __lo, const char* __hi, char_type* __dest) const
|
||||
{
|
||||
while (__lo < __hi)
|
||||
{
|
||||
*__dest = this->do_widen(*__lo);
|
||||
++__lo;
|
||||
++__dest;
|
||||
}
|
||||
return __hi;
|
||||
}
|
||||
|
||||
template<>
|
||||
char
|
||||
ctype<pod_type>::
|
||||
do_narrow(char_type __wc, char) const
|
||||
{ return static_cast<char>(__wc.value); }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_narrow(const pod_type* __lo, const pod_type* __hi,
|
||||
char, char* __dest) const
|
||||
{
|
||||
while (__lo < __hi)
|
||||
{
|
||||
*__dest = this->do_narrow(*__lo, char());
|
||||
++__lo;
|
||||
++__dest;
|
||||
}
|
||||
return __hi;
|
||||
}
|
||||
|
||||
template<>
|
||||
ctype<pod_type>::~ctype() { }
|
||||
|
||||
template<>
|
||||
void
|
||||
numpunct<pod_type>::_M_initialize_numpunct(__c_locale)
|
||||
{
|
||||
if (!_M_data)
|
||||
_M_data = new __numpunct_cache<pod_type>;
|
||||
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_use_grouping = false;
|
||||
|
||||
_M_data->_M_decimal_point.value = value_type('.');
|
||||
_M_data->_M_thousands_sep.value = value_type(',');
|
||||
|
||||
for (size_t i = 0; i < __num_base::_S_oend; ++i)
|
||||
{
|
||||
value_type v = __num_base::_S_atoms_out[i];
|
||||
_M_data->_M_atoms_out[i].value = v;
|
||||
}
|
||||
_M_data->_M_atoms_out[__num_base::_S_oend] = pod_type();
|
||||
|
||||
for (size_t j = 0; j < __num_base::_S_iend; ++j)
|
||||
_M_data->_M_atoms_in[j].value = value_type(__num_base::_S_atoms_in[j]);
|
||||
_M_data->_M_atoms_in[__num_base::_S_iend] = pod_type();
|
||||
|
||||
// "true"
|
||||
pod_type* __truename = new pod_type[4 + 1];
|
||||
__truename[0].value = value_type('t');
|
||||
__truename[1].value = value_type('r');
|
||||
__truename[2].value = value_type('u');
|
||||
__truename[3].value = value_type('e');
|
||||
__truename[4] = pod_type();
|
||||
_M_data->_M_truename = __truename;
|
||||
|
||||
// "false"
|
||||
pod_type* __falsename = new pod_type[5 + 1];
|
||||
__falsename[0].value = value_type('f');
|
||||
__falsename[1].value = value_type('a');
|
||||
__falsename[2].value = value_type('l');
|
||||
__falsename[3].value = value_type('s');
|
||||
__falsename[4].value = value_type('e');
|
||||
__falsename[5] = pod_type();
|
||||
_M_data->_M_falsename = __falsename;
|
||||
}
|
||||
|
||||
template<>
|
||||
numpunct<pod_type>::~numpunct()
|
||||
{ delete _M_data; }
|
||||
} // namespace std
|
|
@ -1,8 +1,9 @@
|
|||
// -*- C++ -*-
|
||||
|
||||
// Testing character type and state type with char_traits and codecvt
|
||||
// specializations for the C++ library testsuite.
|
||||
//
|
||||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -32,9 +33,10 @@
|
|||
#ifndef _GLIBCXX_TESTSUITE_CHARACTER_H
|
||||
#define _GLIBCXX_TESTSUITE_CHARACTER_H
|
||||
|
||||
#include <climits>
|
||||
#include <string> // for char_traits
|
||||
#include <locale> // for codecvt
|
||||
#include <climits>
|
||||
#include <ext/pod_char_traits.h>
|
||||
|
||||
namespace __gnu_test
|
||||
{
|
||||
|
@ -60,12 +62,37 @@ namespace __gnu_test
|
|||
{
|
||||
unsigned int state;
|
||||
};
|
||||
|
||||
// Test data types.
|
||||
struct pod_char
|
||||
{
|
||||
unsigned char c;
|
||||
};
|
||||
|
||||
inline bool
|
||||
operator==(const pod_char& lhs, const pod_char& rhs)
|
||||
{ return lhs.c == rhs.c; }
|
||||
|
||||
struct pod_int
|
||||
{
|
||||
int i;
|
||||
};
|
||||
|
||||
struct state
|
||||
{
|
||||
unsigned long l;
|
||||
unsigned long l2;
|
||||
};
|
||||
|
||||
typedef unsigned short value_type;
|
||||
typedef unsigned int int_type;
|
||||
typedef __gnu_cxx::character<value_type, int_type> pod_type;
|
||||
}; // namespace __gnu_test
|
||||
|
||||
namespace std
|
||||
{
|
||||
// char_traits specialization. Meets the additional requirements for
|
||||
// basic_filebuf.
|
||||
// A std::char_traits specialization. Meets the additional
|
||||
// requirements for basic_filebuf.
|
||||
template<>
|
||||
struct char_traits<__gnu_test::character>
|
||||
{
|
||||
|
@ -411,8 +438,99 @@ namespace std
|
|||
{ return 11; }
|
||||
};
|
||||
|
||||
locale::id
|
||||
codecvt<__gnu_test::character, char, __gnu_test::conversion_state>::id;
|
||||
|
||||
// A std::char_traits specialization with POD types for char_type,
|
||||
// int_type, and state_type.
|
||||
template<>
|
||||
struct char_traits<__gnu_test::pod_char>
|
||||
{
|
||||
typedef __gnu_test::pod_char char_type;
|
||||
typedef __gnu_test::pod_int int_type;
|
||||
typedef __gnu_test::state state_type;
|
||||
typedef fpos<state_type> pos_type;
|
||||
typedef streamoff off_type;
|
||||
|
||||
static void
|
||||
assign(char_type& c1, const char_type& c2)
|
||||
{ c1.c = c2.c; }
|
||||
|
||||
static bool
|
||||
eq(const char_type& c1, const char_type& c2)
|
||||
{ return c1.c == c2.c; }
|
||||
|
||||
static bool
|
||||
lt(const char_type& c1, const char_type& c2)
|
||||
{ return c1.c < c2.c; }
|
||||
|
||||
static int
|
||||
compare(const char_type* s1, const char_type* s2, size_t n)
|
||||
{ return memcmp(s1, s2, n); }
|
||||
|
||||
static size_t
|
||||
length(const char_type* s)
|
||||
{ return strlen(reinterpret_cast<const char*>(s)); }
|
||||
|
||||
static const char_type*
|
||||
find(const char_type* s, size_t n, const char_type& a)
|
||||
{ return static_cast<const char_type*>(memchr(s, a.c, n)); }
|
||||
|
||||
static char_type*
|
||||
move(char_type* s1, const char_type* s2, size_t n)
|
||||
{
|
||||
memmove(s1, s2, n);
|
||||
return s1;
|
||||
}
|
||||
|
||||
static char_type*
|
||||
copy(char_type* s1, const char_type* s2, size_t n)
|
||||
{
|
||||
memcpy(s1, s2, n);
|
||||
return s1;
|
||||
}
|
||||
|
||||
static char_type*
|
||||
assign(char_type* s, size_t n, char_type a)
|
||||
{
|
||||
memset(s, a.c, n);
|
||||
return s;
|
||||
}
|
||||
|
||||
static char_type
|
||||
to_char_type(const int_type& c)
|
||||
{
|
||||
char_type ret;
|
||||
ret.c = static_cast<unsigned char>(c.i);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int_type
|
||||
to_int_type(const char_type& c)
|
||||
{
|
||||
int_type ret;
|
||||
ret.i = c.c;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool
|
||||
eq_int_type(const int_type& c1, const int_type& c2)
|
||||
{ return c1.i == c2.i; }
|
||||
|
||||
static int_type
|
||||
eof()
|
||||
{
|
||||
int_type n;
|
||||
n.i = -10;
|
||||
return n;
|
||||
}
|
||||
|
||||
static int_type
|
||||
not_eof(const int_type& c)
|
||||
{
|
||||
if (eq_int_type(c, eof()))
|
||||
return int_type();
|
||||
return c;
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
#endif // _GLIBCXX_TESTSUITE_CHARACTER_H
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// -*- C++ -*-
|
||||
|
||||
// Utility subroutines for the C++ library testsuite.
|
||||
//
|
||||
// Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
@ -332,155 +333,3 @@ namespace __gnu_test
|
|||
#endif
|
||||
}
|
||||
}; // namespace __gnu_test
|
||||
|
||||
namespace std
|
||||
{
|
||||
// Member specializations for the existing facet classes.
|
||||
// NB: This isn't especially portable. Perhaps a better way would be
|
||||
// to just specialize all of numpunct and ctype.
|
||||
using __gnu_test::int_type;
|
||||
using __gnu_test::value_type;
|
||||
using __gnu_test::pod_type;
|
||||
|
||||
template<>
|
||||
bool
|
||||
ctype<pod_type>::
|
||||
do_is(mask, char_type) const { return true; }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_is(const char_type* __lo, const char_type*, mask*) const
|
||||
{ return __lo; }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_scan_is(mask, const char_type* __lo, const char_type*) const
|
||||
{ return __lo; }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_scan_not(mask, const char_type* __lo, const char_type*) const
|
||||
{ return __lo; }
|
||||
|
||||
template<>
|
||||
pod_type
|
||||
ctype<pod_type>::
|
||||
do_toupper(char_type __c) const
|
||||
{ return __c; }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_toupper(char_type*, const char_type* __hi) const
|
||||
{ return __hi; }
|
||||
|
||||
template<>
|
||||
pod_type
|
||||
ctype<pod_type>::
|
||||
do_tolower(char_type __c) const
|
||||
{ return __c; }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_tolower(char_type*, const char_type* __hi) const
|
||||
{ return __hi; }
|
||||
|
||||
template<>
|
||||
pod_type
|
||||
ctype<pod_type>::
|
||||
do_widen(char __c) const
|
||||
{
|
||||
char_type ret = { value_type(__c) };
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<>
|
||||
const char*
|
||||
ctype<pod_type>::
|
||||
do_widen(const char* __lo, const char* __hi, char_type* __dest) const
|
||||
{
|
||||
while (__lo < __hi)
|
||||
{
|
||||
*__dest = this->do_widen(*__lo);
|
||||
++__lo;
|
||||
++__dest;
|
||||
}
|
||||
return __hi;
|
||||
}
|
||||
|
||||
template<>
|
||||
char
|
||||
ctype<pod_type>::
|
||||
do_narrow(char_type __wc, char) const
|
||||
{ return static_cast<char>(__wc.value); }
|
||||
|
||||
template<>
|
||||
const pod_type*
|
||||
ctype<pod_type>::
|
||||
do_narrow(const pod_type* __lo, const pod_type* __hi,
|
||||
char, char* __dest) const
|
||||
{
|
||||
while (__lo < __hi)
|
||||
{
|
||||
*__dest = this->do_narrow(*__lo, char());
|
||||
++__lo;
|
||||
++__dest;
|
||||
}
|
||||
return __hi;
|
||||
}
|
||||
|
||||
template<>
|
||||
ctype<pod_type>::~ctype() { }
|
||||
|
||||
template<>
|
||||
void
|
||||
numpunct<pod_type>::_M_initialize_numpunct(__c_locale)
|
||||
{
|
||||
if (!_M_data)
|
||||
_M_data = new __numpunct_cache<pod_type>;
|
||||
|
||||
_M_data->_M_grouping = "";
|
||||
_M_data->_M_use_grouping = false;
|
||||
|
||||
_M_data->_M_decimal_point.value = value_type('.');
|
||||
_M_data->_M_thousands_sep.value = value_type(',');
|
||||
|
||||
for (size_t i = 0; i < __num_base::_S_oend; ++i)
|
||||
{
|
||||
value_type v = __num_base::_S_atoms_out[i];
|
||||
_M_data->_M_atoms_out[i].value = v;
|
||||
}
|
||||
_M_data->_M_atoms_out[__num_base::_S_oend] = pod_type();
|
||||
|
||||
for (size_t j = 0; j < __num_base::_S_iend; ++j)
|
||||
_M_data->_M_atoms_in[j].value = value_type(__num_base::_S_atoms_in[j]);
|
||||
_M_data->_M_atoms_in[__num_base::_S_iend] = pod_type();
|
||||
|
||||
// "true"
|
||||
pod_type* __truename = new pod_type[4 + 1];
|
||||
__truename[0].value = value_type('t');
|
||||
__truename[1].value = value_type('r');
|
||||
__truename[2].value = value_type('u');
|
||||
__truename[3].value = value_type('e');
|
||||
__truename[4] = pod_type();
|
||||
_M_data->_M_truename = __truename;
|
||||
|
||||
// "false"
|
||||
pod_type* __falsename = new pod_type[5 + 1];
|
||||
__falsename[0].value = value_type('f');
|
||||
__falsename[1].value = value_type('a');
|
||||
__falsename[2].value = value_type('l');
|
||||
__falsename[3].value = value_type('s');
|
||||
__falsename[4].value = value_type('e');
|
||||
__falsename[5] = pod_type();
|
||||
_M_data->_M_falsename = __falsename;
|
||||
}
|
||||
|
||||
template<>
|
||||
numpunct<pod_type>::~numpunct()
|
||||
{ delete _M_data; }
|
||||
} // namespace std
|
||||
|
|
|
@ -52,9 +52,6 @@
|
|||
// 4) copy_tracker, from Stephen M. Webb <stephen@bregmasoft.com>.
|
||||
// A class with nontrivial ctor/dtor that provides the ability to track the
|
||||
// number of copy ctors and dtors, and will throw on demand during copy.
|
||||
//
|
||||
// 5) pod_char, pod_int, , abstract character classes and
|
||||
// char_traits specializations for testing instantiations.
|
||||
|
||||
#ifndef _GLIBCXX_TESTSUITE_HOOKS_H
|
||||
#define _GLIBCXX_TESTSUITE_HOOKS_H
|
||||
|
@ -63,7 +60,6 @@
|
|||
#include <bits/functexcept.h>
|
||||
#include <cstddef>
|
||||
#include <locale>
|
||||
#include <ext/pod_char_traits.h>
|
||||
#ifdef _GLIBCXX_HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
@ -171,31 +167,6 @@ namespace __gnu_test
|
|||
int
|
||||
try_mkfifo (const char* filename, mode_t mode);
|
||||
|
||||
// Test data types.
|
||||
struct pod_char
|
||||
{
|
||||
unsigned char c;
|
||||
};
|
||||
|
||||
inline bool
|
||||
operator==(const pod_char& lhs, const pod_char& rhs)
|
||||
{ return lhs.c == rhs.c; }
|
||||
|
||||
struct pod_int
|
||||
{
|
||||
int i;
|
||||
};
|
||||
|
||||
struct state
|
||||
{
|
||||
unsigned long l;
|
||||
unsigned long l2;
|
||||
};
|
||||
|
||||
typedef unsigned short value_type;
|
||||
typedef unsigned int int_type;
|
||||
typedef __gnu_cxx::character<value_type, int_type> pod_type;
|
||||
|
||||
|
||||
// Counting.
|
||||
struct counter
|
||||
|
@ -407,103 +378,5 @@ namespace __gnu_test
|
|||
};
|
||||
} // namespace __gnu_test
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<class _CharT>
|
||||
struct char_traits;
|
||||
|
||||
// char_traits specialization
|
||||
template<>
|
||||
struct char_traits<__gnu_test::pod_char>
|
||||
{
|
||||
typedef __gnu_test::pod_char char_type;
|
||||
typedef __gnu_test::pod_int int_type;
|
||||
typedef __gnu_test::state state_type;
|
||||
typedef fpos<state_type> pos_type;
|
||||
typedef streamoff off_type;
|
||||
|
||||
static void
|
||||
assign(char_type& c1, const char_type& c2)
|
||||
{ c1.c = c2.c; }
|
||||
|
||||
static bool
|
||||
eq(const char_type& c1, const char_type& c2)
|
||||
{ return c1.c == c2.c; }
|
||||
|
||||
static bool
|
||||
lt(const char_type& c1, const char_type& c2)
|
||||
{ return c1.c < c2.c; }
|
||||
|
||||
static int
|
||||
compare(const char_type* s1, const char_type* s2, size_t n)
|
||||
{ return memcmp(s1, s2, n); }
|
||||
|
||||
static size_t
|
||||
length(const char_type* s)
|
||||
{ return strlen(reinterpret_cast<const char*>(s)); }
|
||||
|
||||
static const char_type*
|
||||
find(const char_type* s, size_t n, const char_type& a)
|
||||
{ return static_cast<const char_type*>(memchr(s, a.c, n)); }
|
||||
|
||||
static char_type*
|
||||
move(char_type* s1, const char_type* s2, size_t n)
|
||||
{
|
||||
memmove(s1, s2, n);
|
||||
return s1;
|
||||
}
|
||||
|
||||
static char_type*
|
||||
copy(char_type* s1, const char_type* s2, size_t n)
|
||||
{
|
||||
memcpy(s1, s2, n);
|
||||
return s1;
|
||||
}
|
||||
|
||||
static char_type*
|
||||
assign(char_type* s, size_t n, char_type a)
|
||||
{
|
||||
memset(s, a.c, n);
|
||||
return s;
|
||||
}
|
||||
|
||||
static char_type
|
||||
to_char_type(const int_type& c)
|
||||
{
|
||||
char_type ret;
|
||||
ret.c = static_cast<unsigned char>(c.i);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int_type
|
||||
to_int_type(const char_type& c)
|
||||
{
|
||||
int_type ret;
|
||||
ret.i = c.c;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool
|
||||
eq_int_type(const int_type& c1, const int_type& c2)
|
||||
{ return c1.i == c2.i; }
|
||||
|
||||
static int_type
|
||||
eof()
|
||||
{
|
||||
int_type n;
|
||||
n.i = -10;
|
||||
return n;
|
||||
}
|
||||
|
||||
static int_type
|
||||
not_eof(const int_type& c)
|
||||
{
|
||||
if (eq_int_type(c, eof()))
|
||||
return int_type();
|
||||
return c;
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
#endif // _GLIBCXX_TESTSUITE_HOOKS_H
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue