[5.0] fix eosvmoc_limits_tests on non-x86 and non-Linux (where OC is not supported) #2392
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.
Recall that the way
ctest
tests are populated forunit_test
are by finding all the .cpp files in theunittests
directory,leap/unittests/CMakeLists.txt
Line 71 in d47b35a
sending those through a
grep
to find theTEST_SUITE()
for each,leap/unittests/CMakeLists.txt
Line 91 in d47b35a
and then adding a test on what it find, for each WASM runtime enabled,
leap/unittests/CMakeLists.txt
Lines 95 to 96 in d47b35a
Notice how previously the entire
eosvmoc_limits_tests.cpp
is#ifdef
ed away when OC is not enabled. The glob+grep above has no knowledge of this, so when OC is not enabled the cmake file generates a ctest entry that runsunit_test --run_test=eosvmoc_limits_tests
but that will always fail because there is no test suite namedeosvmoc_limits_tests
.Adjust the eosvmoc_limits test suite and tests to be defined no matter OC enabled or not, and just
#ifdef
out the small OC-specific part.This change still looks strange: why are we running these OC limits tests at all with OC is not enabled for the build? Well, that's actually what is occurring even when OC is enabled normally on our x86 Linux builds. For example this previous run you can see that we run the eosvmoc_limits test even for non-OC runtimes:
https://github.com/AntelopeIO/leap/actions/runs/8634314462/job/23670206127#step:5:76
It's just that when OC isn't enabled
limit_violated_test()
always passes. So arguably this change is more consistent with what already occurs when OC builds are enabled vs, say, stubbing out a no-op test suite and test when OC build is not enabled. Any more complex changes to how tests are populated are probably not reasonably in scope for a release branch.