Clicky

Fortran Wiki
FUnit (Rev #2, changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #1 to #2: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

FUnit is a Fortran unit testing framework developed by engineers at NASA. It requires a Fortran 95 compiler and it is designed for testing routines contained in modules. FUnit is written in Ruby and is distributed as a Ruby Gem at RubyForge.

Installing FUnit

If you have rubygems installed, simply running

sudo gem install funit

will install fUnit. You must also have the FC environment variable set to your Fortran compiler:

export FC="gfortran"

Tests and Assertions

Tests are simple Fortran fragments stored in a .fun file of the same name as the module. Each unit test file can contain multiple tests as well as setup and teardown commands that are executed once for each test. Tests may make six types of assertions:

  • assert_true(expression)
  • assert_false(expression)
  • assert_equal(a, b)
  • assert_real_equal(a, b)
  • assert_equal_with(a, b, tol)
  • assert_array_equal(a,b)
(追記)

Emacs

(追記ここまで)
(追記) (追記ここまで)(追記)

The current FUnit also includes an funit-mode for Emacs in the utils directory.

(追記ここまで)
(追記) (追記ここまで)
Revision from July 30, 2009 22:21:20 by Jason Blevins
Forward in time (to current) | Back in time (1 more) | See current | Hide changes | History | Rollback | View: Source | Linked from: Unit testing frameworks, 2009

AltStyle によって変換されたページ (->オリジナル) /