S E S PFUnit - An example
|
The Software
|
ExampleSuppose you have a module in gas_physics.f90 that contains a routine that returns viscosity as a function of temperature, module gas_physics The tests of this module would be contained in gas_physics.fun, and might contain a test like, .. This brief fragment is all you need, the framework provides the rest of the trappings to turn this into valid Fortran code. Before running the tests you need to set the FC environment variable to specifiy your Fortran compiler. Then you would run the tests for the gas_physics module with the command, funit gas_physics which would transform your fragments contained in gas_physics.fun into valid Fortran code, create a test runner program, compile everything, and run the tests. A sample output would look like, parsing gas_physics.fun Further example Fortran code and unit testing code can be found on the SEG servers in /usr/local/ruby/fUnit-0.1.2/examples/.
|
SESP Homepage SEG Homepage |