CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   OpenFOAM unit testing (https://www.cfd-online.com/Forums/openfoam-programming-development/162286-openfoam-unit-testing.html)

pbachant November 7, 2015 13:15

OpenFOAM unit testing
 
Does anyone have any good ideas on how to write unit tests for OpenFOAM code? As far as I can tell, the OpenFOAM source sort of has unit tests in applications/test, but there appear to be no assertions, and no framework for building, calling and summarizing the tests. Is it better to simply write whole simulation cases and ensure these give the correct outputs? That option seems hard to automate.

wyldckat November 7, 2015 13:49

Quick answers:
  1. There was an effort on this front I saw here on the forum, which you had commented on: http://www.cfd-online.com/Forums/ope...oam-mocks.html
  2. The closest to unit testing in OpenFOAM is currently:
  3. In foam-extend there is a bit more advanced unit testing, using CDash: http://openfoamwiki.net/index.php/Extend-testHarness - sorry, I'm still not familiar with who it does things, but that wiki page is very detailed!!
  4. In OpenFOAM a more dedicated unit test framework is pending sponsorship or contribution: http://www.openfoam.org/mantisbt/view.php?id=406


All times are GMT -4. The time now is 22:52.