Skip to content
Snippets Groups Projects

Add unit test for BwdTrans operator

Merged Thibault Lestang requested to merge minimal_testing into master
All threads resolved!

This adds a starting point for a unit test validating the currently implemented BwdTrans operator. This is also infrastructure and a template for testing future operators implementation as they are integrated. The unit test is based on Boost.Test. Other popular options exist but if I remember well boost.test is already used for testing some parts of Nektar++.

The test uses a fixture structure InitFields for which the constructor and destructor is called at the beginning and end of the test. It provides access to two (input/output) Field instance that can be then passed to the operator. Member of the fixture object are accessible within the test block without prefixing their name with obj. but for clarity fixture members are prefixed with fixt_.

Code responsible for creating the fields is taken straight from main.cpp, although the session file is hardcoded in the fixture constructor.

  • The InitFields fixture currently has pointers to fields as attributes. This bypasses the need for a Field default constructor which the class currently doesn't have -- not obvious to me how t o initialise Field members in that case.
  • The test currently fails reporting that no session file was given.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Chris Cantwell added 1 commit

    added 1 commit

    • 7a873d9f - Switch fixt fields to be declared on the heap.

    Compare with previous version

  • Chris Cantwell added 1 commit

    added 1 commit

    • 5de52edb - Very basic BwdTrans StdMat unit test.

    Compare with previous version

  • added 1 commit

    • 5cc8c68c - docs: Adds some comments and docstrings

    Compare with previous version

  • added 1 commit

    • 73940333 - Remove code used for debugging

    Compare with previous version

  • added 1 commit

    • 5f80b787 - cast string literals to char*

    Compare with previous version

  • Thibault Lestang resolved all threads

    resolved all threads

  • Author Maintainer

    @ccantwel I don't have permissions to merge, so this is all yours.

  • mentioned in issue #2 (closed)

  • Should we add it as a test in the CMakeLists.txt, so we can just run ctest after compiling?

    We also need to make sure it gets the square.xml file from somewhere. At the moment, we need to manually copy it into the build/tests directory for it to work.

  • added 1 commit

    Compare with previous version

  • Thibault Lestang mentioned in commit eb03cdc8

    mentioned in commit eb03cdc8

  • Please register or sign in to reply
    Loading