Skip to content

A purely Fortran based unit testing framework derived from the original Fortran Unit Test Framework (FRUIT)

License

Notifications You must be signed in to change notification settings

cibinjoseph/naturalFRUIT

Repository files navigation

Build Status
naturalFRUIT

naturalFRUIT

A purely Fortran based unit testing framework derived from the original Fortran Unit Test Framework (FRUIT).

Why the new project?

  1. Similar projects like FRUIT and pFUnit utilize preprocessors written in other programming languages like Ruby to aid auto-generation of code and reporting easier. However, the time required to set up and learn a whole another language seems to hinder users from adopting the testing framework. naturalFRUIT follows the KISS principle and maintains only Fortran libraries necessary for testing with minimal to no dependencies on other programming languages.
  2. FRUIT documentation appeared to be generally lacking for intermediate to advanced uses. This project utilizes auto-generated documentation using FORD.
  3. FRUIT also appeared to not be updated constantly. A collaborative open-source based framework, hopefully improves this and reflects improvements to Fortran.
  4. FRUIT, just like Fortran, did not contain exception handling. This meant it could not be used in testing using continous integration frameworks like Travis. naturalFruit gets over this to a certain extent and can be used with these frameworks.

Installation

naturalFruit expects to be compiled and used along side your Fortran libraries without explicit installation. The following straightforward commands should get you going.

gfortran -c naturalFruit.f90        # Compile naturalFruit
gfortran main.f90 naturalFruit.o    # Link and use!

Usage

A word of warning: This repo is under very active development and a lot of drastic changes are being made at the moment. These include removal of deprecated and redundant subroutines and functions. Until this disclaimer is removed, users are cautioned against using naturalFRUIT and advised to use the original FRUIT module.

The following image illustrates the typical workflow and subroutines for unit testing using naturalFRUIT:

flowchart

Documentation

Read the FORD generated Documentation.

Quick links
Assert methods
Tutorials
All Procedures

Requirements

naturalFRUIT has been tested to work with gfortran and ifort for all versions of Fortran 90 and above.

Contributing

All contributions are to be made to the dev branch through pull requests. The master branch is kept aside for releases. During release, the master branch is tagged with 'vX.X.X' and pushed to remote using git push origin vX.X.X.

Creating documentation

For adding new documentation,

  1. Fork this repo and switch to dev branch.
  2. Make the necessary changes. FORD parses comments with the marks !! in the source code and contents of the folder ford_input/ for creating documentation.
  3. Run the bash script createDocs.sh in the topmost directory of the repo to make FORD autocreate the documentation webpages.
  4. Commit all changes.
  5. Send a pull request to the dev branch.

License

BSD-3-Clause

Author

Cibin Joseph

Acknowledgements

The author of FRUIT, Andrew H. Chen and all contributors to it are gratefullly acknowledged.

About

A purely Fortran based unit testing framework derived from the original Fortran Unit Test Framework (FRUIT)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages