summaryrefslogtreecommitdiffstats
path: root/fortran/test/fflush1.f90
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2002-11-26 00:43:15 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2002-11-26 00:43:15 (GMT)
commitf5f61bf7832273bf3701002377659a4e98c404b3 (patch)
tree3cab5efd9113f3587f1bd56485e9bae8e39adbb5 /fortran/test/fflush1.f90
parent8333adf8ffc1265440aefad62e0cd9ab33175bd7 (diff)
downloadhdf5-f5f61bf7832273bf3701002377659a4e98c404b3.zip
hdf5-f5f61bf7832273bf3701002377659a4e98c404b3.tar.gz
hdf5-f5f61bf7832273bf3701002377659a4e98c404b3.tar.bz2
[svn-r6138] Purpose:
Improvement Description: The fortran test code did not exit with error like C programs do. Without the appropriate exit code, make or shell could not tell the fortran test program has encountered errors. So, make continues on even when some fortran tests have failed. Solution: Consultant advised to use "CALL exit(code)" to simulate what C programs do. Though this is not standard Fortran, he has not seen it failed to work in most fortran compilers thought some of them, like intel compiler, may need to link in an extra library. Platforms tested: Tested on burrwhite (linux 2.4), eirene (linux 2.2), sol (Solaris 8, serial and mpich parallel), modi4. Did not use the standard commit test since this is a purely fortran fix.
Diffstat (limited to 'fortran/test/fflush1.f90')
-rw-r--r--fortran/test/fflush1.f904
1 files changed, 4 insertions, 0 deletions
diff --git a/fortran/test/fflush1.f90 b/fortran/test/fflush1.f90
index a529eef..998ee5a 100644
--- a/fortran/test/fflush1.f90
+++ b/fortran/test/fflush1.f90
@@ -144,6 +144,10 @@
CALL H5fflush_f(file_id, H5F_SCOPE_GLOBAL_F, error)
CALL check("h5fflush_f",error,total_error)
+ ! if errors detected, exit with non-zero code. This is not truly fortran
+ ! standard but likely supported by most fortran compilers.
+ IF (total_error .ne. 0) CALL exit (total_error)
+
001 STOP