mlo...@gmail.com
unread,Jul 21, 2012, 3:41:20 PM7/21/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Maybe not the right term, but from the pFUnit user guide:
**
One complicating factor for assembling suites of tests in Fortran as opposed to some languages such as python and Java is the lack of “reflection”. Language features in Java and python allow a procedure to dynamically inquire about what methods are available in a given class, and therefore to automatically create a list of procedures that follow some naming convention for unit tests. The analogous feature in Fortran would be to use the language to create a list of procedures that are made available by a given Fortran module. In the absence of this convenience, we must use some external source-code analysis script to automatically detect and assemble our unit tests. (Or, of course, simply assemble them manually.) Note that even with the extensions from the 2003 Fortran standard, developers will need to assemble tests via some non-Fortran mechanism.
**
As it stands in pFUnit, you're required to either write your unit tests in a source file, and then also manually reference them in the main testing program (not ideal, because you may write some test and then forget to put it into the main routine as well), or equivalently use a sequence of shell scripts they've provided that automates this (also not ideal, makes the build system a little weird, and dependent on external scripts outside of the language itself).
With gtest in c++ on the other hand, you simply write your test routines, and those get implicitly registered with the main testing routine. I *think* it does this through preprocessor macros, so it seems like it'd be possible to do the same thing in fortran, but I really have no idea.
On Saturday, July 21, 2012 2:46:46 PM UTC-4, dpb wrote:
> OK, I'll bite...what, precisely, is a "lack of inspection" that Fortran
> apparently lacks??
>
> --