Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why the unit test frameworks in Fortran rely on Ruby instead of Fortran itself?

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?

like image 1000
SOUser Avatar asked Mar 11 '11 09:03

SOUser


People also ask

What is the testing framework for Ruby?

test-unit (Test::Unit) is unit testing framework for Ruby, based on xUnit principles. These were originally designed by Kent Beck, creator of extreme programming software development methodology, for Smalltalk's SUnit. It allows writing tests, checking results and automated testing in Ruby.

Is unit testing a framework?

What are unit test frameworks and how are they used? Simply stated, they are software tools to support writing and running unit tests, including a foundation on which to build tests and the functionality to execute the tests and report their results.


2 Answers

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

like image 160
Andrew Chen Avatar answered Sep 27 '22 20:09

Andrew Chen


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.

like image 20
David Heffernan Avatar answered Sep 27 '22 22:09

David Heffernan