[svn-r15054] Purpose:
Made reporting of the test status global by handling the output via a module. Cleaned-up output to the terminal. Description: Put writing the test status as a call to a subroutine instead of on a per account basis. Added the dependency of compiling in the correct order in the Makefiles for use of the Module.
This commit is contained in:
@@ -18,11 +18,56 @@
|
||||
! This file contains subroutines which are used in
|
||||
! all the hdf5 fortran tests
|
||||
!
|
||||
MODULE error_handler
|
||||
|
||||
! Controls the output style for reporting test results
|
||||
|
||||
CHARACTER(LEN=8) :: error_string
|
||||
CHARACTER(LEN=8), PARAMETER :: success = ' PASSED '
|
||||
CHARACTER(LEN=8), PARAMETER :: failure = '*FAILED*'
|
||||
CHARACTER(LEN=8), PARAMETER :: skip = '--SKIP--'
|
||||
CHARACTER(LEN=4), PARAMETER :: e_format ='(8a)'
|
||||
|
||||
CONTAINS
|
||||
|
||||
!This definition is needed for Windows DLLs
|
||||
!DEC$if defined(BUILD_HDF5_DLL)
|
||||
!DEC$attributes dllexport :: write_test_status
|
||||
!DEC$endif
|
||||
SUBROUTINE write_test_status( test_result, test_title, total_error)
|
||||
|
||||
! Writes the results of the tests
|
||||
|
||||
IMPLICIT NONE
|
||||
|
||||
INTEGER, INTENT(IN) :: test_result ! negative, --skip --
|
||||
! 0 , passed
|
||||
! positive, failed
|
||||
|
||||
CHARACTER(LEN=*), INTENT(IN) :: test_title ! Short description of test
|
||||
INTEGER, INTENT(INOUT) :: total_error ! Accumulated error
|
||||
|
||||
error_string = failure
|
||||
IF (test_result == 0) THEN
|
||||
error_string = success
|
||||
ELSE IF (test_result == -1) THEN
|
||||
error_string = skip
|
||||
ENDIF
|
||||
|
||||
WRITE(*, fmt = '(A,T72)', advance = 'no') test_title
|
||||
WRITE(*, fmt = e_format) error_string
|
||||
|
||||
IF(test_result.GT.0) total_error = total_error + test_result
|
||||
|
||||
END SUBROUTINE write_test_status
|
||||
|
||||
END MODULE error_handler
|
||||
|
||||
|
||||
!This definition is needed for Windows DLLs
|
||||
!DEC$if defined(BUILD_HDF5_DLL)
|
||||
!DEC$attributes dllexport :: check
|
||||
!DEC$endif
|
||||
|
||||
SUBROUTINE check(string,error,total_error)
|
||||
CHARACTER(LEN=*) :: string
|
||||
INTEGER :: error, total_error
|
||||
|
||||
Reference in New Issue
Block a user