Skip to content

Conversation

jdeaton
Copy link
Member

@jdeaton jdeaton commented Feb 6, 2020

This pull request introduces unit test capability initially developed primarily by @JohnDN90 using the Catch2 framework. A small number of basic unit tests are included as examples of how to add them based on our current understanding of Catch2 and CTest.

Also, in this PR the Travis CI system is setup to run the unit tests using ctest after building the Debug and Release versions of the MAST library. This architecture should automatically pick-up any new unit tests that are added inside the tests directory.

@jdeaton
Copy link
Member Author

jdeaton commented Feb 6, 2020

@manavbhatia Since catch2 is header only we've just included it in the repo. John originally stuck it in the tests folder. Do you want it in there or should I move it over with the other external files in a contrib/catch2 directory.

Fixed bug that could cause timpi libaries to not be found in FindlibMesh.cmake
Added code to find libmesh_devel (development) libraries
Added logic to handle cases when when a version (opt, dbg, devel) of libMesh is not present, so that MAST is buildable as long as at least one of these libraries are present
- This is done by specifying CMAKE_BUILD_TYPE=RelWithDebInfo or by setting the CMake variable USE_LIBMESH_DEVEL=1.
- It should not adversely effect the previously working build for dbg/opt versions on Linux or macOS.
@jdeaton jdeaton changed the title Added catch2 header file for new unit tests using Catch2. Catch2 unit testing capability. Feb 6, 2020
@jdeaton jdeaton changed the title Catch2 unit testing capability. Catch2 unit testing capability and retro-actively adding tests. Feb 6, 2020
@manavbhatia
Copy link
Member

@manavbhatia Since catch2 is header only we've just included it in the repo. John originally stuck it in the tests folder. Do you want it in there or should I move it over with the other external files in a contrib/catch2 directory.

It would be best to keep all external packages in contrib.

JohnDN90 and others added 3 commits February 6, 2020 16:47
Base functions: parameter, function_set_base, constant_field_function, libMesh mesh generation.
Use "make check" to run these tests after building MAST via "make"
- Debug build now occurs first because it has extra assertions that may cause test failures. Earlier feedback than doing Release first.
@jdeaton
Copy link
Member Author

jdeaton commented Feb 7, 2020

@manavbhatia @JohnDN90 Once the last commit clears the CI, I'm going to go ahead and merge this first increment of unit test capability into master. It is running on Travis CI and any new tests should also just get added on.

We can then start implementing other changes/features that have tests defined. We also have code that is just pure unit tests for existing capability that we will put into another PR so it doesn't hold things up.

@jdeaton jdeaton changed the title Catch2 unit testing capability and retro-actively adding tests. Catch2 unit testing capability, a few example/basic unit tests, and tests running on Travis CI. Feb 7, 2020
@JohnDN90
Copy link
Member

JohnDN90 commented Feb 7, 2020

@jdeaton Sounds good to me.

@jdeaton jdeaton marked this pull request as ready for review February 7, 2020 19:05
@jdeaton jdeaton merged commit 1af06ae into master Feb 7, 2020
@jdeaton jdeaton deleted the feature/catch2-tests branch February 7, 2020 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants