Repository navigation
Conversation
… download GoogleTest if not found on the system
…d IdefixXDArray 1D,2D,3D,4D
…cmake + add a missing test file
…() + remove some useless redundant tests
…mem representation
…ix target not in libidefix-core
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the usage of GoogleTest in the Idefix sources via the first use case about the
LookupTable.In the build system
GoogleTest is automatically downloaded by the CMake script in version 1.18.0 via the function
GoogleTestDownloadAndLink()implemented incmake/HandleDeps.cmake.Due to the limitation discussed in next part I cannot safely use the system GoogleTest because I don't know the version on which I fall on form the sources.
The core functions of Idefix has been moved into
libidefix-coreto be linked toidefixas for the newunittestsexacultable.GTest limitation with KOKKOS_LAMBDA
When building a unit test defined via
TEST(..., ...)with aKOKKOS_LAMDAinside we cannot compile withNVCC because it complains about the fact the the function generated by
TEST()isprivate.A fix has been proposed to Google in 2022 but they rejected it due to non standard
behavior of the compiler : google/googletest#4104
I currently override inside Idefix the
GTEST_TEST_macro applying theprivate->publicchange but to be safeit makes the code sticked to a specific version of GoogleTest.
With this fix everything is working as long as we
#include "gtest-idfx.hpp"in each test file.Idefix & MPI & Kokkos init
A new
main()has been defined ingtest-idfx.cppto be used to launch the unit tests with Kokkos and MPI initialized.Extra assertions
When we will progress in unit testing Idefix we will need to validation some
IdefixXDArrays. I already defined some dedicated macrosto get a simple semantic reusing all the matchers provided by
GoogleTest & GoogleMock.
There is a full example of use in
src/test/testArrays.hpp.First ported tests
The
LoopkupTabletest has been translated to GoogeTest and is first realtest in Idefix.
Building and launching
You need to activate
-DIdefix_GTEST=ONto build the unit tests.Intégration in github actions
I patched the github action scripts so they first build & run the unittests
for each mode (CUDA / Intel / gcc).
It currently run first the unit tests then run the integration tests the time
to validate. I will revert that behavior before doing the final merge.
TODO