[PATCH] Remove symlinks created in argv0-symlink.exp and general cleanup

Pedro Alves palves@redhat.com
Mon Aug 3 14:23:00 GMT 2015


On 07/30/2015 09:13 PM, Simon Marchi wrote:
> When running argv0-symlink.exp, symlinks are left in the test output
> directory.  One of them is a recursive symlink.  This causes the same tests
> to be found multiple times and disturbs subsequent test runs.
> 
> To witness it simply, just run
> 
>   $ make check RUNTESTFLAGS="argv0-symlink.exp"
> 
> twice in a row.  The second run will find and run argv0-symlink.exp
> multiple times because of the recursive symlink left by the first run.  Note
> that this only happens when building in tree.  The simple fix is to
> remove the links when we are done.
> 
> At the same time, I did a general cleanup of the test:
> 
>   - Add and use a create_link proc.

>   - Bail out early if target does not support argv[0].

What's the rationale for that?  It seems that'd skip the
tests that ensure that "info inferiors" shows the $filelink; those
aren't currently guarded by $has_argv.  AFAICS, that was done
on purpose.  See:

 git show 673dc4a0
 git show 673dc4a0:gdb/testsuite/gdb.base/argv0-symlink.exp

>   - Of course, remove created symlinks before returning.

I think you should leave them, actually.  That's a general direction
we've been following -- leaving build/test artifacts in place in case
the test fails and we need to debug what happened.
So instead what we do is remove any leftover from a previous run
that could interfere, when we start a new run.  (I think the patch
is already doing that too.)

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list