]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
GAS/testsuite: Make a copy of none.s before operating on it as output
authorMaciej W. Rozycki <macro@redhat.com>
Mon, 17 Jun 2024 22:28:20 +0000 (23:28 +0100)
committerMaciej W. Rozycki <macro@redhat.com>
Mon, 17 Jun 2024 22:28:20 +0000 (23:28 +0100)
commit7c900791f218d417d9f0e4c18d2c914e24837d8d
treefb6adc98bec973df1d6b326a1e957bec2ba10e86
parent4c817355a01dce1909ea4f860741dc2080251603
GAS/testsuite: Make a copy of none.s before operating on it as output

The "Output file must be distinct from input" test in gas/all/gas.exp
operates on none.s as output.  Should the test fail it may happen that
GAS will delete the output file requested in which case none.s will be
removed.  Since the test operates directly on the source tree it will be
clobbered as a result.  It has actually been observed in the field in
the form of intermittent:

FAIL: gas/all/none

regressions in a parallel run of many configurations.

Prevent this from happening by copying none.s first to the test object
directory and operating on it instead.  It does not prevent the file
from being removed should the test fail, but the source tree won't be
clobbered in that case.

A nice side effect is that syntactically different paths will now be
used in this test for the input and the output file each, so coverage
will extend to verifying that a file is checked against itself even if
referred to via different paths.  Previously "$srcdir/$subdir/none.s"
was used for both paths and now "tmpdir/none.s" is referred to directly
and via a relative path from "$srcdir/$subdir" respectively.

I note that we have no previous use of the UNRESOLVED test result in the
GAS testsuite, but it seems the correct one should copying none.s fail,
as this is an unexpected situation that requires a human intervention
and the test proper has not been evaluated.
gas/testsuite/gas/all/gas.exp