Skip to content

Exception propagation and regex matching

Latest

Choose a tag to compare

@tclune tclune released this 14 Nov 00:52
5154db4

This release adds propagate, which collects an exception that passes up a call stack into a single exception with a traceback, and @assertExceptionMatches, which catches an expected exception by regular expression rather than exact message. It also removes source files that were not part of any build.


Added

  • Add propagate(message, location) for exceptions that pass up a call stack (issue #594). If an exception is pending, location is appended to the traceback of the most recent one; otherwise propagate throws like throw. Text, XML and TAP output list the traceback when one is present. Behaviour is unchanged for code that does not call propagate.
  • Add @assertExceptionMatches(pattern) and catchMatch(pattern) to catch the first exception whose message matches a POSIX extended regular expression, searched anywhere in the message (issue #595). An invalid pattern is reported as a failure. Not supported on Windows, where it reports a failure saying so.

Removed

  • Remove unused source files that were not part of any build: src/funit/core/{Core,Arg,Mock}.F90, src/funit/core/{CodeUtilities,GeneratedSources,Utilities}.py, and the stale src/pfunit/core/{pFUnit,pfunit_main}.F90 copies

What's Changed

  • Remove unused source files not part of any build by @djkees in #592
  • Add exception propagation with traceback by @tclune in #596
  • Add regex matching for expected exceptions by @tclune in #599
  • Hand merge main into develop; prepare for 4.22.0 by @tclune in #598
  • Develop by @tclune in #600

Full Changelog: v4.21.0...v4.22.0