{"id":47885218,"url":"https://github.com/dongli/fortran-unit-test","last_synced_at":"2026-04-04T02:14:03.309Z","repository":{"id":50926995,"uuid":"105962406","full_name":"dongli/fortran-unit-test","owner":"dongli","description":"Another Fortran unit test library","archived":false,"fork":false,"pushed_at":"2021-05-28T14:16:09.000Z","size":90,"stargazers_count":21,"open_issues_count":3,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2023-03-11T08:42:13.085Z","etag":null,"topics":["fortran-library","unit-testing"],"latest_commit_sha":null,"homepage":null,"language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dongli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-06T03:01:30.000Z","updated_at":"2023-01-16T21:30:31.000Z","dependencies_parsed_at":"2022-08-25T11:02:04.548Z","dependency_job_id":null,"html_url":"https://github.com/dongli/fortran-unit-test","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/dongli/fortran-unit-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongli%2Ffortran-unit-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongli%2Ffortran-unit-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongli%2Ffortran-unit-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongli%2Ffortran-unit-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dongli","download_url":"https://codeload.github.com/dongli/fortran-unit-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongli%2Ffortran-unit-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31384907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T01:22:39.193Z","status":"online","status_checked_at":"2026-04-04T02:00:07.569Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fortran-library","unit-testing"],"created_at":"2026-04-04T02:14:02.690Z","updated_at":"2026-04-04T02:14:03.282Z","avatar_url":"https://github.com/dongli.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"top\"\u003e\u003c/a\u003e\n# Fortran Unit Test Library FUT\n\n### Content\n\n+ [Overview](#overview)\n\n+ [Installation](#installation)\n\n+ [Example](#example)\n\n+ [Supported Data Types](#supported-data-types)\n\n+ [Compiler Support](#compiler-support)\n\n+ [License](#license)\n\n### Overview\nThis is a Fortran Unit Test library purely written in Fortran to encourage scientific programmer to write tests.\n\n\u003csub\u003eGo to [Top](#top)\u003c/sub\u003e\n\n### Installation\nA CMake-Setup is provided.\n\n\u003csub\u003eGo to [Top](#top)\u003c/sub\u003e\n\n### Example\n\ndemo.F90:\n```fortran\nprogram good_test\n\n  use unit_test\n\n  implicit none\n\n  type(test_suite_type) :: specific_suite\n\n  ! example with default suite\n  call test_suite_init()\n  call test_case_create('Test 1')\n\n  ! By sending macros __FILE__ and __LINE__, report will print the file and line number where assertion fails.\n  call assert_approximate(1.0, 2.0, __FILE__, __LINE__) ! line 14\n\n  ! report the complete suite\n  call test_suite_report()\n\n  ! finalize\n  call test_case_final()\n\n  ! example with specific suite\n  call test_suite_init('my specific test suite', specific_suite)\n  call test_case_create('Specific Test 1', specific_suite)\n  ! suite = SUITE need in this case (cause optional argument eps, file_name, line_number is missing)\n  call assert_approximate(1.0, 2.0, suite=specific_suite)\n\n  call test_case_create('Specific Test 2', specific_suite)\n  ! suite = SUITE need in this case (cause optional argument eps is missing)\n  call assert_equal(1.0, 2.0, __FILE__, __LINE__,  suite=specific_suite)\n\n  call test_case_create('Specific Test 3', specific_suite)\n  call assert_approximate(1.0, 2.0, __FILE__, __LINE__, 1E-0, specific_suite)\n\n  ! report a test_case\n  call test_case_report('Specific Test 2', specific_suite)\n\n  ! report the complete suite\n  call test_suite_report(specific_suite)\n\n  ! finalize\n  call test_suite_final(specific_suite)\n\nend program good_test\n```\n\nOutput:\n```txt\n///////////////////// Report of Suite: Default test suite ///////////////////////\n\n +-\u003e Details:\n |   |\n |   +-\u003e Test 1: 1 of 1 assertions succeed.\n |   |\n |\n +-\u003e Summary:\n |   +-\u003e Default test suite: 1 of 1 assertions succeed.\n\n////////////////////////////////////////////////////////////////////////////////\n\n\n//////// Report of Suite: my specific test suite, Case: Specific Test 2 /////////\n\n +-\u003e Specific Test 2: 0 of 1 assertions succeed.\n |   |\n |   +-\u003e Assertion #1 failed with reason: x ( 1.000) == y ( 2.000)\n |   +-\u003e Check line: test_assert.F90:29\n\n/////////////////// Report of Suite: my specific test suite /////////////////////\n\n +-\u003e Details:\n |   |\n |   +-\u003e Specific Test 1: 1 of 1 assertions succeed.\n |   |\n |   +-\u003e Specific Test 2: 0 of 1 assertions succeed.\n |   |   |\n |   |   +-\u003e Assertion #1 failed with reason: x ( 1.000) == y ( 2.000)\n |   |   +-\u003e Check line: test_assert.F90:29\n |   |\n |   +-\u003e Specific Test 3: 0 of 1 assertions succeed.\n |   |   |\n |   |   +-\u003e Assertion #1 failed with reason: x ( 1.000) =~ y ( 2.000)\n |   |   +-\u003e Check line: test_assert.F90:32\n |   |\n |\n +-\u003e Summary:\n |   +-\u003e my specific test suite: 1 of 3 assertions succeed.\n\n////////////////////////////////////////////////////////////////////////////////\n\n```\n\nYou can integrate this library into your CMake based project as:\n\n```\n...\nadd_subdirectory (\u003cfortran-unit-test root\u003e)\ninclude_directories (${UNIT_TEST_INCLUDE_DIR})\n...\ntarget_link_libraries (\u003cuser target\u003e fortran_unit_test ...)\n```\n\n\u003csub\u003eGo to [Top](#top)\u003c/sub\u003e\n\n### Supported Data Types\n+ assert_equal()\n  + single data type\n    * [x] `integer(1)`;\n    * [x] `integer(2)`;\n    * [x] `integer(4)`;\n    * [x] `integer(8)`;\n    * [x] `real(4)`;\n    * [x] `real(8)`;\n    * [x] `character(*)`;\n  + vector data type\n    * [x] `integer(1), dimension(:)`;\n    * [x] `integer(2), dimension(:)`;\n    * [x] `integer(4), dimension(:)`;\n    * [x] `integer(8), dimension(:)`;\n    * [x] `real(4), dimension(:)`;\n    * [x] `real(8), dimension(:)`;\n    * [x] `character(*), dimension(:)`;\n  + array data type\n    * [x] `integer(1), dimension(:, :)`;\n    * [x] `integer(2), dimension(:, :)`;\n    * [x] `integer(4), dimension(:, :)`;\n    * [x] `integer(8), dimension(:, :)`;\n    * [x] `real(4), dimension(:, :)`;\n    * [x] `real(8), dimension(:, :)`;\n    * [x] `character(*), dimension(:, :)`;\n+ assert_approximate()\n  + single data type\n    * [x] `real(4)`;\n    * [x] `real(8)`;\n  + vector data type\n    * [x] `real(4), dimension(:)`;\n    * [x] `real(8), dimension(:)`;\n  + array data type\n    * [x] `real(4), dimension(:, :)`;\n    * [x] `real(8), dimension(:, :)`;\n+ assert_great_then()\n  + single data type\n    * [x] `integer(1)`;\n    * [x] `integer(2)`;\n    * [x] `integer(4)`;\n    * [x] `integer(8)`;\n    * [x] `real(4)`;\n    * [x] `real(8)`;\n  + vector data type\n    * [x] `integer(1), dimension(:)`;\n    * [x] `integer(2), dimension(:)`;\n    * [x] `integer(4), dimension(:)`;\n    * [x] `integer(8), dimension(:)`;\n    * [x] `real(4), dimension(:)`;\n    * [x] `real(8), dimension(:)`;\n  + array data type\n    * [x] `integer(1), dimension(:, :)`;\n    * [x] `integer(2), dimension(:, :)`;\n    * [x] `integer(4), dimension(:, :)`;\n    * [x] `integer(8), dimension(:, :)`;\n    * [x] `real(4), dimension(:, :)`;\n    * [x] `real(8), dimension(:, :)`;\n\n\u003csub\u003eGo to [Top](#top)\u003c/sub\u003e\n\n### Compiler Support\n\n[![Compiler](https://img.shields.io/badge/GNU-v4.8.5+-brightgreen.svg)]()\n[![Compiler](https://img.shields.io/badge/PGI-v18.4+-brightgreen.svg)]()\n[![Compiler](https://img.shields.io/badge/Intel-v17.0.2.187+-brightgreen.svg)]()\n[![Compiler](https://img.shields.io/badge/IBM%20XL-not%20tested-yellow.svg)]()\n[![Compiler](https://img.shields.io/badge/g95-not%20tested-yellow.svg)]()\n[![Compiler](https://img.shields.io/badge/NAG-not%20tested-yellow.svg)]()\n\n\u003csub\u003eGo to [Top](#top)\u003c/sub\u003e\n\n### License\n[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)]()\n\n\u003csub\u003eGo to [Top](#top)\u003c/sub\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongli%2Ffortran-unit-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdongli%2Ffortran-unit-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongli%2Ffortran-unit-test/lists"}