* [PATCH] testsuite: Allow setting gpp_std_list in configuration files
@ 2022-03-29 12:43 Jonathan Wakely
2022-03-29 12:55 ` Jason Merrill
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2022-03-29 12:43 UTC (permalink / raw)
To: gcc-patches
Tested powerpc64le-linux, OK for trunk?
-- >8 --
This allows the gpp_std_list variable to be set in ~/.dejagnurc instead
of using the GXX_TESTSUITE_STDS environment variable. This is
consistent with how other defaults such as tool_timeout can be set.
The environment variable can still be used to override the default.
gcc/testsuite/ChangeLog:
* lib/g++-dg.exp: Update comments.
* lib/g++.exp (gpp_std_list): Check for an existing value before
setting it to an empty list.
---
gcc/testsuite/lib/g++-dg.exp | 7 ++++---
gcc/testsuite/lib/g++.exp | 6 +++++-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp
index a1bc37074b5..59e8081a29d 100644
--- a/gcc/testsuite/lib/g++-dg.exp
+++ b/gcc/testsuite/lib/g++-dg.exp
@@ -27,8 +27,8 @@ proc g++-dg-prune { system text } {
return [gcc-dg-prune $system $text]
}
-# Modified dg-runtest that runs tests in both C++98 and C++11 modes
-# unless they specifically specify one or the other.
+# Modified dg-runtest that runs tests in multiple standard modes,
+# unless they specifically specify one standard.
proc g++-dg-runtest { testcases flags default-extra-flags } {
global runtests
@@ -39,7 +39,7 @@ proc g++-dg-runtest { testcases flags default-extra-flags } {
}
# If the testcase specifies a standard, use that one.
- # If not, run it under both standards, allowing GNU extensions
+ # If not, run it under several standards, allowing GNU extensions
# if there's a dg-options line.
if ![search_for $test "-std=*++"] {
if [search_for $test "dg-options"] {
@@ -48,6 +48,7 @@ proc g++-dg-runtest { testcases flags default-extra-flags } {
set std_prefix "-std=c++"
}
+ # See g++.exp for the initial value of this list.
global gpp_std_list
if { [llength $gpp_std_list] > 0 } {
set std_list $gpp_std_list
diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp
index 3744ebe4b44..24ef068b239 100644
--- a/gcc/testsuite/lib/g++.exp
+++ b/gcc/testsuite/lib/g++.exp
@@ -32,7 +32,11 @@ load_lib target-libpath.exp
set gpp_compile_options ""
-set gpp_std_list { }
+# Allow gpp_std_list to be set in configuration files, e.g., ~/.dejagnurc
+if ![info exists gpp_std_list] {
+ set gpp_std_list { }
+}
+# Allow gpp_std_list to be set from the environment.
if [info exists env(GXX_TESTSUITE_STDS)] {
set gpp_std_list [split $env(GXX_TESTSUITE_STDS) ","]
}
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] testsuite: Allow setting gpp_std_list in configuration files
2022-03-29 12:43 [PATCH] testsuite: Allow setting gpp_std_list in configuration files Jonathan Wakely
@ 2022-03-29 12:55 ` Jason Merrill
0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2022-03-29 12:55 UTC (permalink / raw)
To: Jonathan Wakely, gcc-patches
On 3/29/22 08:43, Jonathan Wakely wrote:
> Tested powerpc64le-linux, OK for trunk?
OK.
> -- >8 --
>
> This allows the gpp_std_list variable to be set in ~/.dejagnurc instead
> of using the GXX_TESTSUITE_STDS environment variable. This is
> consistent with how other defaults such as tool_timeout can be set.
>
> The environment variable can still be used to override the default.
>
> gcc/testsuite/ChangeLog:
>
> * lib/g++-dg.exp: Update comments.
> * lib/g++.exp (gpp_std_list): Check for an existing value before
> setting it to an empty list.
> ---
> gcc/testsuite/lib/g++-dg.exp | 7 ++++---
> gcc/testsuite/lib/g++.exp | 6 +++++-
> 2 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp
> index a1bc37074b5..59e8081a29d 100644
> --- a/gcc/testsuite/lib/g++-dg.exp
> +++ b/gcc/testsuite/lib/g++-dg.exp
> @@ -27,8 +27,8 @@ proc g++-dg-prune { system text } {
> return [gcc-dg-prune $system $text]
> }
>
> -# Modified dg-runtest that runs tests in both C++98 and C++11 modes
> -# unless they specifically specify one or the other.
> +# Modified dg-runtest that runs tests in multiple standard modes,
> +# unless they specifically specify one standard.
> proc g++-dg-runtest { testcases flags default-extra-flags } {
> global runtests
>
> @@ -39,7 +39,7 @@ proc g++-dg-runtest { testcases flags default-extra-flags } {
> }
>
> # If the testcase specifies a standard, use that one.
> - # If not, run it under both standards, allowing GNU extensions
> + # If not, run it under several standards, allowing GNU extensions
> # if there's a dg-options line.
> if ![search_for $test "-std=*++"] {
> if [search_for $test "dg-options"] {
> @@ -48,6 +48,7 @@ proc g++-dg-runtest { testcases flags default-extra-flags } {
> set std_prefix "-std=c++"
> }
>
> + # See g++.exp for the initial value of this list.
> global gpp_std_list
> if { [llength $gpp_std_list] > 0 } {
> set std_list $gpp_std_list
> diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp
> index 3744ebe4b44..24ef068b239 100644
> --- a/gcc/testsuite/lib/g++.exp
> +++ b/gcc/testsuite/lib/g++.exp
> @@ -32,7 +32,11 @@ load_lib target-libpath.exp
>
>
> set gpp_compile_options ""
> -set gpp_std_list { }
> +# Allow gpp_std_list to be set in configuration files, e.g., ~/.dejagnurc
> +if ![info exists gpp_std_list] {
> + set gpp_std_list { }
> +}
> +# Allow gpp_std_list to be set from the environment.
> if [info exists env(GXX_TESTSUITE_STDS)] {
> set gpp_std_list [split $env(GXX_TESTSUITE_STDS) ","]
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-29 12:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 12:43 [PATCH] testsuite: Allow setting gpp_std_list in configuration files Jonathan Wakely
2022-03-29 12:55 ` Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).