Re: [PATCH] Copy .py files to remote host

Doug Evans
2014-08-13T03:09:20Z

On Tue, Aug 12, 2014 at 5:52 PM, Yao Qi <yao@codesourcery.com> wrote:
> On 08/13/2014 01:15 AM, Doug Evans wrote:
>> I still have an outstanding question on this topic,
>> and before this gets checked in I'd like to get it resolved.
>> Do we delete other files downloaded to the remote target?
>
> Yes, at least shared libs downloaded to target are cleaned up.
> In lib/gdb.exp, there is a list cleanfiles, to record the files
> downloaded to target, and in gdb_finish, remove files in this list.

Yeah, we keep track of files downloaded to the target.
Can we do something similar for the host?

>>
>> At one point I tried to find a place there the testsuite code was
>> taking care to delete other downloaded files, but couldn't.
>> Since we've gotten by this long without doing so
>> [and this is *still* just a hypothesis - I haven't worked with
>> remote hosts in awhile ...]
>> I would rather just punt on deleting python files as well,
>> and document that that is the convention (since for every other
>> file it already is :-)).
>> [Why treat python files differently?]
>
> Where can we document this convention? gdb/testsuite/README? I can't
> find a proper one. Existing test cases are good documentation to me,
> and people usually follow the existing tests when they create new ones.

I think gdb/testsuite/README is fine.

>>
>> If we really did want to fully clean up after each test,
>> and we should first establish that that is indeed what we want to do,
>> instead of filling every test exit point with explicit code to delete
>> only one kind of downloaded file, how about instead keep a list of all
>> downloaded files and call a routine to delete the files in that list
>> from some central cleanup point?
>
> Yeah, I also dislike writing "remote_file host delete $FOO" at the each
> test exit point explicitly. Not sure what do you want in "fully clean
> up", but at least, we can clean up python files as you said.

If we keep track of files downloaded to the host like we do for the
target, it seems like this would be enough.