gcc/libstdc++-v3
Jonathan Wakely 3a0e01f6bb libstdc++: Add support for running tests with multiple -std options
This copies the code from the compiler's gcc/testsuite/lib/g++-dg.exp so
that each test can be run multiple times, with different -std options.
This means that we can remove most { dg-options "-std=gnu++20" }
directives from tests, because the testsuite will automatically select
a set of -std options that includes that version.

Tests that should only run for a specific standard (e.g. ones that use
something like { dg-do run { target c++11_only } }) should still specify
that standard with { dg-options "-std=gnu++11" }, which overrides the
automatic selection. But a dg-options that selects a newer standard than
the default can be removed, because that standard will be selected
automatically based on a selector like { target c++20 } in the dg-do
directive. This will allow those tests to be run for more than just the
one they currently hardcode, so that e.g. std::format tests can be run
for all of C++20, C++23 and C++26. Currently that has to be done by
adding a second test file that uses a different dg-options line.

By default most tests will continue to run with only the default dialect
(currently -std=gnu++17) so that the time to run the entire testsuite is
not increased. We can revisit this later if increasing the testsuite
time (and coverage) is acceptable. Libstdc++ developers can easily
override the defaults to run for multiple versions. To test all
versions, either add 'set v3_std_list { 98 11 14 17 20 23 26 }' to
~/.dejagnurc or define GLIBCXX_TESTSUITE_STDS="98,11,14,17,20,23,26" in
the environment.

This should be more efficient than the current way to test with multple
standards, i.e. --target_board=unix{-std=c++14,-std=c++17,-std=c++20},
because today all tests with an explicit -std option hardcoded in them
get run for each target board variation but using the exact same
hardcoded -std every time. With the new approach you can just use the
default --target_board=unix and set GLIBCXX_TESTSUITE_STDS="14,17,20"
and now a test that has { target c++20 } will only run once (and be
UNSUPPORTED twice), instead of running with identical options three
times.

In order to support ~/.dejagnurc and $DEJAGNU files that need to work
with versions of GCC without this change, a new variable is added to
site.tmp to detect whether v3_std_list is supported. That allows e.g.

if { [info exists v3-use-std-list] } {
  set v3_std_list { 11 17 23 }
  set target_list { "unix{,-m32}" }
} else {
  set target_list { "unix{,-std=gnu++2b,-std=gnu++11,-m32}" }
}

libstdc++-v3/ChangeLog:

	* doc/xml/manual/test.xml: Update documentation on running and
	writing tests.
	* doc/html/manual/test.html: Regenerate.
	* testsuite/Makefile.am: Add v3-use-std-list to site.tmp
	* testsuite/Makefile.in: Regenerate.
	* testsuite/lib/dg-options.exp (add_options_for_strict_std): New
	proc.
	* testsuite/lib/libstdc++.exp (search_for): New utility proc.
	(v3-dg-runtest): New proc to replace dg-runtest.
	* testsuite/libstdc++-dg/conformance.exp: Use v3-dg-runtest.
2023-09-15 21:57:38 +01:00
..
config LoongArch: Adjust C++ multilib header layout. 2023-09-08 17:51:06 +08:00
doc libstdc++: Add support for running tests with multiple -std options 2023-09-15 21:57:38 +01:00
include libstdc++: Use C++20 constraints in <bit> 2023-09-15 15:26:26 -04:00
libsupc++ libstdc++: Simplify C++20 poison pill overloads (P2602R2) 2023-09-07 08:08:12 +01:00
po
python libstdc++: Format Python code according to PEP8 2023-09-12 12:41:27 +01:00
scripts libstdc++: Add Filesystem TS and std::stacktrace symbols to libstdc++exp.a 2023-09-08 18:04:12 +01:00
src libstdc++: Remove some more unconditional uses of atomics 2023-09-14 13:58:34 +01:00
testsuite libstdc++: Add support for running tests with multiple -std options 2023-09-15 21:57:38 +01:00
acinclude.m4 libstdc++: Add Filesystem TS and std::stacktrace symbols to libstdc++exp.a 2023-09-08 18:04:12 +01:00
aclocal.m4
ChangeLog Daily bump. 2023-09-15 00:18:10 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
ChangeLog-2021
ChangeLog-2022
config.h.in libstdc++: Add autoconf checks for mkdir, chmod, chdir, and getcwd 2023-09-07 17:03:40 +01:00
configure libstdc++: Add Filesystem TS and std::stacktrace symbols to libstdc++exp.a 2023-09-08 18:04:12 +01:00
configure.ac Revert "libstdc++: Use GLIBCXX_CHECK_LINKER_FEATURES for cross-builds (PR111238)" 2023-09-04 20:44:20 +00:00
configure.host LoongArch: Adjust C++ multilib header layout. 2023-09-08 17:51:06 +08:00
crossconfig.m4
fragment.am
linkage.m4
Makefile.am
Makefile.in
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.