testsuite: outputs.exp: cleanup before running tests (was: Re: [PATCH] testsuite: outputs.exp: test for skip_atsave more thoroughly)

Message ID or35fyeffu.fsf@lxoliva.fsfla.org
State Committed
Commit 7a1790ac6b475e9848e24200de9a1c44be422f5b
Headers
Series testsuite: outputs.exp: cleanup before running tests (was: Re: [PATCH] testsuite: outputs.exp: test for skip_atsave more thoroughly) |

Commit Message

Alexandre Oliva June 21, 2022, 5:47 a.m. UTC
  On Jun 21, 2022, Alexandre Oliva <oliva@adacore.com> wrote:

> 	* gcc.misc-tests/outputs.exp (outest): Introduce quiet mode,

Use the just-added dry-run infrastructure to clean up files that may
have been left over by interrupted runs of outputs.exp, which used to
lead to spurious non-repeatable (self-fixing) failures.

Regstrapped on x86_64-linux-gnu, also tested with a cross to
aarch64-rtems6.  Ok to install?


for  gcc/testsuite/ChangeLog

	* gcc.misc-tests/outputs.exp: Clean up left-overs first.
---
 gcc/testsuite/gcc.misc-tests/outputs.exp |    3 +++
 1 file changed, 3 insertions(+)
  

Comments

Richard Biener June 21, 2022, 7:35 a.m. UTC | #1
On Tue, Jun 21, 2022 at 7:47 AM Alexandre Oliva via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Jun 21, 2022, Alexandre Oliva <oliva@adacore.com> wrote:
>
> >       * gcc.misc-tests/outputs.exp (outest): Introduce quiet mode,
>
> Use the just-added dry-run infrastructure to clean up files that may
> have been left over by interrupted runs of outputs.exp, which used to
> lead to spurious non-repeatable (self-fixing) failures.
>
> Regstrapped on x86_64-linux-gnu, also tested with a cross to
> aarch64-rtems6.  Ok to install?

OK

>
> for  gcc/testsuite/ChangeLog
>
>         * gcc.misc-tests/outputs.exp: Clean up left-overs first.
> ---
>  gcc/testsuite/gcc.misc-tests/outputs.exp |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gcc/testsuite/gcc.misc-tests/outputs.exp b/gcc/testsuite/gcc.misc-tests/outputs.exp
> index a63ce66693b97..ab919db1ccb2d 100644
> --- a/gcc/testsuite/gcc.misc-tests/outputs.exp
> +++ b/gcc/testsuite/gcc.misc-tests/outputs.exp
> @@ -304,6 +304,9 @@ if { "$aout" != "" } then {
>      set oaout "-o $aout"
>  }
>
> +# Clean up any left-overs from an earlier interrupted run.
> +outest "$b-cleanup?" $sing "$oaout" {alt/ dir/ o/ od/ obj/} {{} {} {} {} {} {$aout}}
> +
>  # Sometimes the -I or -L flags that cause the compiler driver to save
>  # .args.[01], instead of leaving it for the linker to save .ld1_args,
>  # is hiding in driver self specs.
>
>
> --
> Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
>    Free Software Activist                       GNU Toolchain Engineer
> Disinformation flourishes because many people care deeply about injustice
> but very few check the facts.  Ask me about <https://stallmansupport.org>
  

Patch

diff --git a/gcc/testsuite/gcc.misc-tests/outputs.exp b/gcc/testsuite/gcc.misc-tests/outputs.exp
index a63ce66693b97..ab919db1ccb2d 100644
--- a/gcc/testsuite/gcc.misc-tests/outputs.exp
+++ b/gcc/testsuite/gcc.misc-tests/outputs.exp
@@ -304,6 +304,9 @@  if { "$aout" != "" } then {
     set oaout "-o $aout"
 }
 
+# Clean up any left-overs from an earlier interrupted run.
+outest "$b-cleanup?" $sing "$oaout" {alt/ dir/ o/ od/ obj/} {{} {} {} {} {} {$aout}}
+
 # Sometimes the -I or -L flags that cause the compiler driver to save
 # .args.[01], instead of leaving it for the linker to save .ld1_args,
 # is hiding in driver self specs.