Repository navigation
Conversation
… make a first example (still not finished)
…ing an exception in case of error for unit tests (not to abort the whole test suite)
…s::deep_copy(array, const_scalar_value)
… test to support GPU + fix rounding acceptance in testColumn.cpp
svalat
force-pushed
the
feature/test-column
branch
from
November 27, 2026 09:20
25a168e to
a402091
Compare
svalat
marked this pull request as ready for review
November 27, 2026 19:41
glesur
self-requested a review
November 29, 2026 20:13
This branch has not been deployed
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.
Goal
Be able to unit test more classes in Idefix, starting with the Column class, currently considering only the single rank implementation when being in MPI.
Tests depending on DataBlock
The Column class depends on the
DataBlockclass which connect to too many objects. To reduce those dependencies, theDataBlockclass has been patched to optionally initialise the physics so we can have only the grid in place.UnitTestApp
In order to ease the creation of the idefix objects required to make minimum tests I added the
UnitTestAppobject to setup Idefix basement in one line in unit tests.This classe does :
DataBlockobject.Tests for Column
The unit test for column consider only the 3D and Spherical case by filling an array with a constant value.
The test mainly consider that the column return value should be constant increase along$\phi$ and $\theta$ and being constant over $\theta$ and $\phi$ when applying column along r.
The expected value is estimating roughly with some rounding before checking the constant property for the other cells.
Array compare macros
I added some checks so that the arrays have the same size when using
ASSERT_THAT_XD_ARRAYS*macros so we also ensure thay have same size before comparing the content.About safeExit() in unit tests
I also made safeExit() a weak symbol, so the unit test can override it to make it throwing an exception instead of aborting the whole test suite if it is triggered. To be check if it is OK for you ?
TODO