]> gcc.gnu.org Git - gcc.git/commit
gfortran.dg/read_dir.f90: Make PASS on Windows
authorTobias Burnus <tobias@codesourcery.com>
Wed, 21 Dec 2022 07:06:29 +0000 (08:06 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Wed, 21 Dec 2022 07:14:32 +0000 (08:14 +0100)
commit18fc70aa9c753d17c00211cea9fa5bd843fe94fd
tree6f034de60c1f27c842a404c1ef74ea5e62a1afdd
parent2b1a604a9b28fbf4f382060bebd04adb83acc2f9
gfortran.dg/read_dir.f90: Make PASS on Windows

On non-Cygwin Windows, use '.' and expect the documented fail when opening
a directory (EACCESS).  As gfortran does not set __WIN32__ this check is
done on the C side. (On __CYGWIN__, __WIN32__ is not set - but to make it
clear, !__CYGWIN__ is used in #if.)

On non-Windows, replace the 'call system' shell call by the POSIX functions
stat/mkdir/rmdir for better compatibility, especially on embedded systems;
additionally add some more checks. In particular, confirm that 'close' with
status='delete' indeed deleted the directory.

gcc/testsuite/ChangeLog:

* gfortran.dg/read_dir-aux.c: New; provides my_mkdir, my_rmdir,
my_verify_not_exists and expect_open_to_fail.
* gfortran.dg/read_dir.f90: Call those; expect that opening a
directory fails on Windows.
gcc/testsuite/gfortran.dg/read_dir-aux.c [new file with mode: 0644]
gcc/testsuite/gfortran.dg/read_dir.f90
This page took 0.065926 seconds and 5 git commands to generate.