a2eaef
From 88f6669fa358bf4670d91e379f469e3cd3016543 Mon Sep 17 00:00:00 2001
a2eaef
From: William Cohen <wcohen@redhat.com>
a2eaef
Date: Tue, 21 Jun 2016 10:53:32 -0400
a2eaef
Subject: [PATCH 1/2] Have Fortran test support code report errors more clearly
a2eaef
a2eaef
When a Fortran test called the ftest_skip or ftest_fail the support
a2eaef
code would attempt to print out error strings.  However, this support
a2eaef
code would print out gibberish because the string was not properly
a2eaef
initialized.  There doesn't seem to be a easy way in Fortran to get
a2eaef
the error string, for the time being just print out the error number
a2eaef
and people will need to manually map it back to the string.
a2eaef
a2eaef
Signed-off-by: William Cohen <wcohen@redhat.com>
a2eaef
---
a2eaef
 src/ftests/ftests_util.F | 14 ++++++--------
a2eaef
 1 file changed, 6 insertions(+), 8 deletions(-)
a2eaef
a2eaef
diff --git a/src/ftests/ftests_util.F b/src/ftests/ftests_util.F
a2eaef
index 83433f9..8de2bd1 100644
a2eaef
--- a/src/ftests/ftests_util.F
a2eaef
+++ b/src/ftests/ftests_util.F
a2eaef
@@ -108,7 +108,6 @@ C     And also to make the test code read cleaner
a2eaef
       integer line
a2eaef
       character*(*) callstr
a2eaef
       integer retval,ilen
a2eaef
-      character*(PAPI_MAX_STR_LEN) papi_errstr
a2eaef
       integer last_char
a2eaef
       external last_char
a2eaef
 
a2eaef
@@ -134,10 +133,10 @@ C     And also to make the test code read cleaner
a2eaef
       else if(retval.eq.0)then
a2eaef
         write(*,*) 'SGI requires root permissions for this test'
a2eaef
       else
a2eaef
-        call PAPIF_perror( )
a2eaef
+C Just printing the error number because of difficulty getting error string.
a2eaef
         ilen=last_char(callstr)
a2eaef
-        write(*,'(T2,3a)') 'PAPI error in ', callstr(1:ilen), 
a2eaef
-     *       ': '// papi_errstr(1:last_char(papi_errstr))
a2eaef
+        write(*,'(T2,3a,I3)') 'PAPI error in ', callstr(1:ilen),
a2eaef
+     *       ': ', retval
a2eaef
       end if
a2eaef
       call pause()
a2eaef
       stop
a2eaef
@@ -153,7 +152,6 @@ C     And also to make the test code read cleaner
a2eaef
       integer quiet
a2eaef
       common quiet
a2eaef
 
a2eaef
-      character*(PAPI_MAX_STR_LEN) papi_errstr
a2eaef
       integer last_char
a2eaef
       external last_char
a2eaef
 
a2eaef
@@ -165,10 +163,10 @@ C     And also to make the test code read cleaner
a2eaef
         else if (retval.gt.0) then
a2eaef
           write(*,*) "Error calculating: ", callstr
a2eaef
         else
a2eaef
-          call PAPIF_perror( )
a2eaef
+C Just printing the error number because of difficulty getting error string.
a2eaef
           ilen=last_char(callstr)
a2eaef
-          write(*,'(T2,3a)') 'Error in ', callstr(1:ilen),
a2eaef
-     *         ': ' // papi_errstr(1:last_char(papi_errstr))
a2eaef
+          write(*,'(T2,3a,I3)') 'Error in ', callstr(1:ilen),
a2eaef
+     *         ': ', retval
a2eaef
         end if
a2eaef
       end if
a2eaef
       call pause()
a2eaef
-- 
a2eaef
1.8.3.1
a2eaef