This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC dejagnu testsuite: how to check for non-zero exit code?


I'd like to include cases in the gfortran testsuite to check that we correctly issue a run-time error, and exit with non-zero code.

I have the following example:

$ cat runtime_error.f90
! { dg-do run }
! { dg-options "-fbounds-check" }
integer :: x(5), y(5)
x = y((/0,2,3,4,6/))
end
$ gfortran runtime_error.f90 -fbounds-check
$ ./a.out ; echo $?
Fortran runtime error: Array reference out of bounds for array 'y', lower bound of dimension 1 exceeded (in file 'runtime_error.f90', at line 4)
2



I'd like to be able to check that this code indeed issue the error message on stderr and indicate to dejagnu that non-zero exit codes does not mean that the test FAILed). How can I do that?


Thanks for any help,
FX


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]