This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Removing an output file when test case has terminate
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: gcc mailing list <gcc at gcc dot gnu dot org>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Sun, 29 Mar 2015 14:50:27 +0300
- Subject: Re: Removing an output file when test case has terminate
- Authentication-results: sourceware.org; auth=none
- References: <5517E1EE dot 7010101 at netcologne dot de>
On Sun, Mar 29, 2015 at 2:28 PM, Thomas Koenig <tkoenig@netcologne.de> wrote:
> I want to add a test case to the gfortran testsuite for PR 65563.
> If all goes right, running the test case will
>
> a) terminate the program with an error message (to be checked for)
>
> b) create a file, which needs to be cleaned up after the test case
> is run.
>
> a) is clear, but how do I do b)? I haven't found anything in the
> list of dg-final actions for this. (Due to the specifics of the test
> case, I also cannot name my file "foo.mod" and let the automatic module
> cleanup do the job for me :-)
>
> Any ideas?
What I did for PR 64770, were the testcase created a file
"pr64770test.dat", was to add a line
! { dg-final { remote_file build delete "pr64770test.dat" } }
to the end of the testcase. See gfortran.dg/open_new_segv.f90 for the
whole testcase.
Don't know if this is the correct way to do it, but it seems to work.
--
Janne Blomqvist