[PATCH] Fix PR38956 - gfortran testsuite issues on cygwin

David Billinghurst dbcygwin@gmail.com
Sun May 10 00:01:00 GMT 2009


PR PR38956 is the failure of four gfortran tests on i686-pc-cygwin.

The problem is due to a mismatch between Windows and POSIX file access models.
Under Windows, accounts with Administrator rights can write to any file
regardless of the file permission.  There is no easy way to check for this.

Some time ago - http://gcc.gnu.org/ml/gcc-patches/2009-01/msg01499.html -
I proposed a couple of different fixes.  I suggested modifying the tests
so that some functionality was tested on cygwin, but others preferred this
simpler fix.  Let's do it.

OK for trunk and 4.4?

2009-04-10  David Billinghurst (billingd@gcc.gnu.org)

	PR fortran/38956
  	* gfortran.dg/chmod_1.f90: Don't run on *-*-cygwin*.
  	* gfortran.dg/chmod_2.f90: Likewise.
  	* gfortran.dg/chmod_3.f90: Likewise.
  	* gfortran.dg/open_errors.f90: Likewise.

Index: chmod_1.f90
===================================================================
--- chmod_1.f90 (revision 147122)
+++ chmod_1.f90 (working copy)
@@ -1,5 +1,6 @@
-! { dg-do run { target { ! { *-*-mingw* spu-*-* } } } }
+! { dg-do run { target { ! { *-*-mingw* *-*-cygwin* spu-*-* } } } }
  ! { dg-options "-std=gnu" }
+! See PR38956.  Test fails on cygwin when user has Administrator rights
    implicit none
    character(len=*), parameter :: n = "foobar_file"
    integer :: i
Index: chmod_2.f90
===================================================================
--- chmod_2.f90 (revision 147122)
+++ chmod_2.f90 (working copy)
@@ -1,5 +1,6 @@
-! { dg-do run { target { ! { *-*-mingw* spu-*-* } } } }
+! { dg-do run { target { ! { *-*-mingw* *-*-cygwin* spu-*-* } } } }
  ! { dg-options "-std=gnu" }
+! See PR38956.  Test fails on cygwin when user has Administrator rights
    implicit none
    character(len=*), parameter :: n = "foobar_file"
    integer :: i
Index: chmod_3.f90
===================================================================
--- chmod_3.f90 (revision 147122)
+++ chmod_3.f90 (working copy)
@@ -1,5 +1,6 @@
-! { dg-do run { target { ! { *-*-mingw* spu-*-* } } } }
+! { dg-do run { target { ! { *-*-mingw* *-*-cygwin* spu-*-* } } } }
  ! { dg-options "-std=gnu -fdefault-integer-8" }
+! See PR38956.  Test fails on cygwin when user has Administrator rights
    implicit none
    character(len=*), parameter :: n = "foobar_file"
    integer :: i
Index: open_errors.f90
===================================================================
--- open_errors.f90     (revision 147322)
+++ open_errors.f90     (working copy)
@@ -1,6 +1,7 @@
-! { dg-do run { target { ! { *-*-mingw* spu-*-* } } } }
+! { dg-do run { target { ! { *-*-mingw* *-*-cygwin* spu-*-* } } } }
  ! PR30005 Enhanced error messages for OPEN
  ! Submitted by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+! See PR38956.  Test fails on cygwin when user has Administrator rights
  character(60) :: msg
  character(25) :: n = "temptestfile"
  logical :: there



More information about the Gcc-patches mailing list