{"id":46231657,"url":"https://github.com/jatkinson1000/pfunit-parameterization-demo","last_synced_at":"2026-03-03T18:01:47.223Z","repository":{"id":305946216,"uuid":"1024472696","full_name":"jatkinson1000/pfunit-parameterization-demo","owner":"jatkinson1000","description":"A demonstration of how to apply parameterization to pFUnit tests","archived":false,"fork":false,"pushed_at":"2025-07-22T20:58:05.000Z","size":23,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-22T21:05:11.375Z","etag":null,"topics":["fortran","pfunit","teaching-materials","testing","unittest"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jatkinson1000.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-22T18:50:31.000Z","updated_at":"2025-07-22T20:12:25.000Z","dependencies_parsed_at":"2025-07-22T21:05:14.331Z","dependency_job_id":"5a54fe3d-3f51-4561-a080-5f2f0aa0e9a3","html_url":"https://github.com/jatkinson1000/pfunit-parameterization-demo","commit_stats":null,"previous_names":["jatkinson1000/pfunit-parameterization-demo"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jatkinson1000/pfunit-parameterization-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jatkinson1000%2Fpfunit-parameterization-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jatkinson1000%2Fpfunit-parameterization-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jatkinson1000%2Fpfunit-parameterization-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jatkinson1000%2Fpfunit-parameterization-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jatkinson1000","download_url":"https://codeload.github.com/jatkinson1000/pfunit-parameterization-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jatkinson1000%2Fpfunit-parameterization-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30053990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T17:46:22.538Z","status":"ssl_error","status_checked_at":"2026-03-03T17:46:22.036Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","pfunit","teaching-materials","testing","unittest"],"created_at":"2026-03-03T18:01:46.516Z","updated_at":"2026-03-03T18:01:47.216Z","avatar_url":"https://github.com/jatkinson1000.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pFUnit Parameterization Demonstration\n\n![Fortran](https://img.shields.io/badge/Fortran-2008-purple)\n![GitHub](https://img.shields.io/github/license/jatkinson1000/pfunit-parameterization-demo)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/jatkinson1000/pfunit-parameterization-demo/test_build.yaml?label=tests)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/jatkinson1000/pfunit-parameterization-demo/static_analysis.yaml?label=quality)\n\nThis code accompanies [a post](https://jackatkinson.net/post/fortran_parameterizing_pfunit/)\nI wrote about using the Fortran unit testing framework\n[pFUnit](https://github.com/Goddard-Fortran-Ecosystem/pFUnit) to write and run\nparameterized tests.\n\npFUnit has a lot of excellent features, but the documentation and tutorials are sparse,\nand often out of date.\nThis makes it a challenge to learn and utilize to the fullest extent.\n\nIn this demo I take a simple Fortran code that multiplies two numbers together,\nsupported by a simple pFUnit test.\nI then provide a parameterized version of the test to indicate the benefits of utilizing\nparameterization, and the changes required to accommodate it.\n\nFor a full walkthrough and explanation of this process please refer to the\n[accompanying article on my website](https://jackatkinson.net/post/fortran_parameterizing_pfunit/),\nalso included here under [`article.md`](article.md).\n\n\n## Dependencies\n\nTo run this code requires a Fortran compiler (gfortran is assumed in the Makefile, but\ncould be adjusted) pFUnit to be installed.\nYou will need Make, or optionally CMake, to build.\n\npFUnit can be installed as follows:\n```sh\ngit clone git@github.com:Goddard-Fortran-Ecosystem/pFUnit.git\ncd pFUnit\ncmake -B build\ncd build\nmake tests\nmake install\n```\n\nFollowing this pFUnit should should be installed at\n`pfunit/build/installed/PFUNIT-x.y/`, where\n`x.y` indicates the version of this installation.\n\n\n## Building/Installation\n\nThis code comes with both a Makefile and a CMakeLists.\n\n### Using Make\n\nTo build using Make set the value of the environment variable `PFUNIT` to\nbe the path to the installation as noted above, then invoke `make`:\n```sh\nPFUNIT=\u003cPATH/TO/PFUNIT-x.y\u003e\nmake\n```\n\nto build the code.\n\nAlternatively, pass the value of the variable directly to the `make`\ncommand:\n```sh\nmake PFUNIT=\u003cPATH/TO/PFUNIT-x.y\u003e\n```\n\nThis will generate a number of compilation files, as well as three executables.\nTo clean up the compilation files run:\n```sh\nmake clean\n```\n\n### Using CMake\n\nTo build using CMake, from the root of the repository run:\n```sh\ncmake -B build -DCMAKE_PREFIX_PATH=\u003cPATH/TO/PFUNIT-x.y\u003e\ncmake --build build\n```\nwhere `\u003cPATH/TO/PFUNIT-x.y\u003e` is the path to the pFUnit installation as described\nabove.\n\nThis will generate build files in the `build/` directory, and the three executables\nat the root of the repository.\n\n\n## Usage\n\nOnce built/installed the code provides three executables:\n\n- `multiply` is a program defined in `multiply.f90` that takes two numbers from\n  the user and returns the product. It makes use of a subroutine defined in the\n  `multiply_mod.f90` module file.\n- `test_multiply` is a simple test for the `multiply_mod` module written using\n  the pFUnit framework. It contains a single test checking that `2 * 2 == 4`.\n  It is defined in the `unittest_multiply.pf` file.\n- `test_multiply_param` is an extension of `test_multiply` that runs the same test,\n  but this time parameterized for a series of different inputs to check a variety of\n  possible cases. It is defined in the `unittest_multiply_param.pf` file.\n\nAll three can be run from the command line with no additional arguments.\n\nTo gain a clear picture of the changes that had to be made to accommodate\nparameterization one can run:\n```sh\nvimdiff unittest_multiply.pf unittest_multiply_param.pf\n```\nor any other side-by-side comparison tool/viewer.\n\nTo view the process of adding parameterization you can inspect the git history.\n\n\n### License\n\nThis demo is distributed under a [GPL 3.0](https://github.com/jatkinson1000/pfunit-parameterization-demo/blob/main/LICENSE)\nLicense.\n\n\n## Contributions\nContributions are welcome.\n\nBugs, feature requests, and clear suggestions for improvement can be documented by\n[opening an issue](https://github.com/jatkinson1000/pfunit-parameterization-demo/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjatkinson1000%2Fpfunit-parameterization-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjatkinson1000%2Fpfunit-parameterization-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjatkinson1000%2Fpfunit-parameterization-demo/lists"}