Menu

#55 Allow use of @ macros outside of @test subroutines

open
nobody
None
5
2016-07-28
2016-06-24
Elizabeth F
No

I want to make a subroutine, called by a test, that uses @assertEqual().

Related

Feature Requests: #55

Discussion

  • Tom Clune

    Tom Clune - 2016-06-26

    In one sense one can already do this, but in another there is a fundamental limitation of Fortran that I don't see a way around.

    Currently the @assert macros issue a RETURN statement if the assertion fails. This acts as a poor-man's version of throwing an exception, but ... it can only go up one level. There needs to be logic inserted into the calling procedure that checks for the exception and also returns. On can do this manually by testing to see if the calld procedure created an exception:

    call foo() ! procedure that throws an exception
    if (anyExceptions()) return

    And additional care must be applied for the MPI case. If you see a clever way to avodi the need for the extra RETURN line, I'm quite interested.

     
  • Tom Clune

    Tom Clune - 2016-06-26
    • status: open --> wont-fix
     
  • Tom Clune

    Tom Clune - 2016-06-26
    • status: wont-fix --> open
     
  • Tom Clune

    Tom Clune - 2016-06-26

    The original requestor has suggested a package she created called fexception which might be very useful in pFUnit 4.0. If I determine that it is portable (and robust), I'll be happy to go that direction.

     
    • Elizabeth F

      Elizabeth F - 2016-06-26

      It doesn't conform to F-2003 standard :(. There might be other ways to get
      a similar effect.

      On Sun, Jun 26, 2016 at 5:08 PM, Tom Clune tom_clune@users.sf.net wrote:

      The original requestor has suggested a package she created called
      fexception which might be very useful in pFUnit 4.0. If I determine that it
      is portable (and robust), I'll be happy to go that direction.


      Status: open
      Group: Version > 4 (Future Release)
      Created: Fri Jun 24, 2016 10:50 PM UTC by Elizabeth F
      Last Updated: Sun Jun 26, 2016 08:26 PM UTC
      Owner: nobody

      I want to make a subroutine, called by a test, that uses @assertEqual().

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/pfunit/feature-requests/55/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #55

  • Elizabeth F

    Elizabeth F - 2016-07-28

    I see no obvious solutions to this issue, other than using FException. I would be personally happy with that in the short term, but uncomfortable with going beyond the F2003 standard. That's just asking for trouble.

    Any thoughts? I'd suggest we close this issue and live with the limitations.

     

Log in to post a comment.