Giter VIP home page Giter VIP logo

foamut's Introduction

A unit/integration testing framework for OpenFOAM code

This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks.

This is a unit/integration testing framework to help test-proof new OpenFOAM code (might be too late for the OpenFOAM library itself). This repository will always work with the latest versions of the main three OpenFOAM forks: ESI OpenCFD's, Foundation version and Foam-Extend.

If you intend to write cross-forks code, this can help you maintain your sanity. You can just keep branches for each fork on your code's repository and invoke CI on them with the help of this testing framework.

A quick demo

OpenFOAM unit testing in action

How to use this repo

The Alltest script loops through OpenFOAM cases and runs corresponding test cases (for directories it finds under tests) - both in serial and in parallel.

You can use this to your advantage as you don't need to include this repo into your code base:

  1. In your library's repo, write tests the way you like; ship them with their own Make directory to compile the test driver (see example tests)
  2. In your CI workflows, checkout this repository and symlink your tests somewhere under tests
    ln -s /path/to/your/tests tests/myLibTests
  3. Do the same for your OpenFOAM cases if you have any (only a simple cavity case is provided by default). Put these under cases.
  4. Run ./Alltest to compile and run your tests on your cases.
  5. If you run ./Alltest.report instead, HTML reports will be generated for your tests inside reports/tests directory.

Documentation

Head to the wiki to read few more words about this framework. There is also a FAQ there.

Contributing

Ease of use and portability across OpenFOAM forks are the main focus of this framework. As long as your contribution doesn't hinder one of those two objectives; it will be welcomed! And PRs against master are the way to go.

foamut's People

Contributors

foamscience avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.