Skip to content

AlexBuccheri/Fortran_unit_testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unit Testing Frameworks for Fortran

Example unit tests for several popular unit testing frameworks available for Fortran 95 and above.

This project will include a CMake build file demonstrating installation and linking for each.

Unit Test Frameworks Currently Included

Unit Test Frameworks to Include

Writing Unit Tests and Adding to CMake

Each source subdirectory should have one test per module, with the naming convention module_tests.f90 and a driver that calls all of the tests. The driver is generated when building with CMake. Specifically, add_custom_command calls the driver supplied by th zofu library.

A test executable is buildable for each subdirectory.

Would also like a test_all but I'm still considering ways of implementing.

To Dos

  • Move zofu unit test into its own source directory OR rename
  • Write FindZofu.cmake
  • Include in that, a script that pulls Zofu off of github and builds it in a user- specified location => can supply that via a cmake function

Documentation

Documentation written with FORD: https://github.com/Fortran-FOSS-Programmers/ford/wiki/Writing-Documentation

Submodules

Potential means of keeping track of external dependencies:

  • git submodules
  • Cmake ExternalProject Command
  • vkpkg although fortran support appears limited
  • Fortran Package Manager
  • Custom BASH or python script that pulls the relevant packages from github and builds

Git Submodules

Submodule information is stored in $ROOT/.gitmodules, $ROOT/.git/config and $ROOT/.git/modules.

Git submodules can be added to the external folder using the command:
cd external && git submodule add -b master [URL to Git repo] which will track the master branch of the project.

An issue with git submodules is that it is not a package manager, so if the external libraries also have external dependencies then one will have to download and install those separately.

Useful references on submodules:

About

Example builds for fortran unit testing frameworks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published