-
Notifications
You must be signed in to change notification settings - Fork 89
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
add NDEBUG
test - add build_test
target - fix asserts
#2721
Conversation
da06b90
to
b3bfdfa
Compare
NDEBUG
test - add unitests
targetNDEBUG
test - add unittests
target
b3bfdfa
to
f1860ef
Compare
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.
These both seem like sensible additions, and a good way to test against erroneous NDEBUG
symbol propagation.
CI is still behaving weirdly though, because according to #2631 (comment), this test should not pass at the moment (GEOS-DEV/thirdPartyLibs#243 / #2700 would be needed).
EDIT: this is now fixed, and the tests now errors as expected. |
edd78c2
to
cfdfabf
Compare
cfdfabf
to
e192b62
Compare
a9a03c4
to
39833f4
Compare
Thanks for all the work that you have done on this PR @tbeltzun ;-). |
* instead, we always check that this test fails in CMake Debug mode, whilst it should always | ||
* pass in RelWithDebInfo or Release builds. |
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.
this test is compact and readable
No, this current test is not compact: it spans two files to be understood.
Both testToolChain.cpp
and the corresponding CMakeLists.txt
are involved in the pattern.
(Plus the "negate" pattern that will negate all the tests in the folder, not only this one).
Is the code below equivalent to the full logic on the test?
bool constexpr isDebug = std::string_view( GEOSX_CMAKE_BUILD_TYPE ) == std::string_view( "Debug" );
#ifdef NDEBUG
bool constexpr hasNDEBUG = true;
#else
bool constexpr hasNDEBUG = false;
#endif
ASSERT_EQ( !isDebug, hasNDEBUG ); // or static_assert(...)
Ready on my side. |
@TotoGaz Are you ok with this ? |
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.
dd84565
to
209c066
Compare
335af4c
to
924ee83
Compare
924ee83
to
753f192
Compare
* add `DNDEBUG` test case * add `build_unittests` to build all the test targets * implement `geos_add_test` * enforce `CMake` consistency (tests)
addition of a
NDEBUG
testAdd a test for the HDF5 propagated flags as explained in #2631 and #2699 or GEOS-DEV/thirdPartyLibs#248.
In
Debug
CMake configuration, if theDNDEBUG
flag is propagated by any dependencies from the TPLs, this test should fail.addition of a
build_test
targetIt is well known (CMake limitation) that running
make test
doesn't build the tests and only tries to run them (see here).There is no dedicated target to enable building all the unitests executables at once apart from running
make all
(which I want to avoid because it builds targets that I don't need from the C++ side).This PR add a
build_test
target such that runningmake geosx build_test test
builds geosx, the unitests, and runs the test suite.remove erroneous assertion
Authored by @Algiane.
Description duplicated from #2699:
According to geos code and doc:
numNodesInFace
is the number of nodes along the face of an element (getFaceNodes
method);numNodes = lowestNodeToFaces.size();
(see numNodes setting);lowestNodeToFaces
is of sizem_numNodes
(that is the number of nodes on the partition) (see lowestNodeToFaces allocation).Note that this erroneous assertion is not detected by the ci due to the transfer of theNDEBUG
flag of the hdf5 build toward the geos compilation flags through Conduit (see TPL PR #243 and Geos PR #2700 where the assertion is executed .)Fixes #2700. Closes #2631.
enhance
CMakeLists.txt
consistencyset(dependencyList ${dependencyList} geosx_core)
patterns withlist(APPEND dependencyList geosx_core)
, which is more concise;unset(something)
instead ofset(something)
, for clarity;CMakeLists.txt
.