Reputation: 3852
Summarization: FRUIT can be used only with Fortran compilers, although its functionality can be enhanced by using Ruby. Check the answer below from its author Andrew Chen.
===========================================
It seems that the available unit test frameworks (XUnit) for Fortran include:
funit
http://nasarb.rubyforge.org/
fruit
http://sourceforge.net/projects/fortranxunit/
flibs
http://flibs.sourceforge.net/
ObjexxFTK (commercial)
http://www.objexx.com/ObjexxFTK.html
In their webpages, funit, fruit, and flibs mention they rely on Ruby to function. I have no idea about ObjexxFTK. It seems to me that XUnit frameworks in Java, C#, and Delphi and so forth only rely on the corresponding language itself. Then why do the Fortran frameworks choose to rely on Ruby instead of Fortran itself?
Upvotes: 13
Views: 2902
Reputation: 211
Xichen,
This is Andrew Chen, the author of Fruit.
In the core of FRUIT, it is in pure FORTRAN. The core capability include assert, fixture setup, summary, error counting and report. The design goal is to have the testing capability in the own language.
FRUIT 1.0 was developed about 8 years ago, with pure FORTRAN. Then Ruby was added, Rake was added in 2008, I think.
This is especially important in FORTRAN, because introducing another language or compiler in the build environment may be prohibitive.
However, to make the testing framework flexible, elegant and rich in information, other more flexible language is the right tool (even my co-workers still think FORTRAN can do everything, and the world is run by FORTRAN). Ruby is chosen because of its readability, and easy to modify.
As far as I know, funit cannot run without Ruby, but FRUIT can run with only FORTRAN compilers. It has been tested by Intel F95, and g95.
Please check out the 2 tutorials, in FRUIT Wiki: 1. Add FRUIT into your diet in 3 minutes (pure FORTRAN) 2. Add FRUIT into your diet in 20 minutes (with Ruby)
http://sourceforge.net/apps/mediawiki/fortranxunit/index.php?title=Main_Page
Hope it helps.
Andrew Hang Chen 陈航 http://blog.sina.com.cn/foreopen
Upvotes: 21
Reputation: 41
That depends also on what you expect from a unit test framework. if you want a GUI, or it to be a plugin for an IDE then fortran is maybe not the easiest way to do so, even if it is feasible of course. this is why other languages are often preferred.
I have written a simple unit test framework for fortran in fortran, a la nose for python. console based, but it does its job. it all depends on your needs. (makes me think that i should maybe adapt it to more general use and release it.)
as you seem to be using delphi, you can put your file objects in dlls and plug them to dunit for example.
Upvotes: 1
Reputation: 613163
Writing a unit testing framework with the complexity, capability and dynamic nature of a true XUnit clone would be utterly horrendous in Fortran which is really designed for numerical analysis.
Upvotes: 11