-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set the right path for PODIO_SIOBLOCK_PATH
and add an error message
#588
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I originally added the DL_PATHS
like this because catch_discover_tests
actually runs the executable during the build and it didn't find all the datamodel libraries without injecting the DL_PATHS
like this.
This is the original commit that introduced it, it also contains a link to the original issue on Catch2.
At least for now the sanitizer builds all skip the test discovery because they run in an LCG environment where the CMake version is too old to have DL_PATHS
. However, also on dev3
with a newer environment things seem to work as expected with test discovery.
Did you check that the tests run in the correct environment with this change? I.e. PODIO_SIOBLOCK_PATH
is also set? IIRC, there was also an issue with trying to set multiple environment variables this way with catch_discover_tests
)
I noticed but since it works fine without |
So having a look I think the options are:
|
I am not sure I understand how the failure appears with one but not the other. We first check if Lines 141 to 168 in 82814a8
|
The issue is that |
PODIO_SIOBLOCK_PATH
and add an error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this. It looks like I messed this up a bit in the whole test reorganization.
If we remove the DL_PATHS
, I think we also need to adapt this comment here to not create too much confusion:
podio/tests/unittests/CMakeLists.txt
Lines 66 to 72 in 82814a8
# To work around https://github.com/catchorg/Catch2/issues/2424 we need the | |
# DL_PATH argument for catch_discoer_tests which requires CMake 3.22 at least | |
# The whole issue can be avoided if we skip the catch test discovery and set the | |
# environment on our own | |
if (CMAKE_VERSION VERSION_LESS 3.22) | |
set(SKIP_CATCH_DISCOVERY ON) | |
endif() |
PROPERTIES | ||
ENVIRONMENT | ||
PODIO_SIOBLOCK_PATH=${CMAKE_CURRENT_BINARY_DIR} | ||
PODIO_SIOBLOCK_PATH=${PROJECT_BINARY_DIR}/tests | ||
ENVIRONMENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this second ENVIRONMENT
necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a look at the comment, I think the SKIP_CATCH_DISCOVERY
option can be removed; the point of that part is to check if the cmake version is less than 3.22 because in principle using DL_PATH
is needed and this is supported only for 3.22 and above. But, it is actually not needed, because duplicating the ENVIRONMENT
keyword works (it's described in the Catch2 issue).
We even get the fine grained list for unittests in the sanitizer builds with this. Very nice. Thanks :) |
BEGINRELEASENOTES
PODIO_SIOBLOCK_PATH
, fixing unit tests that read and write SIO files (there aren't any at the moment)PODIO_SIOBLOCK_PATH
is set but none of the SioBlock libraries are found.ENDRELEASENOTES
Adding a simple test that writes a frame to a SIO file won't work when ran with
ctest
. It looks like the environment is not correctly set because when running the test manually it will work fine. I don't know why but usingLD_LIBRARY_PATH
instead ofDL_PATHS
fixes this. This is the testHere I don't think we need a unittest to simply test the environment, but for running with sanitizers, since all the ROOT ones fail then it's useful to have the SIO ones run from the unit tests.