Run the tests from CMake with explicit boost_test(); fix test failures; self-contained CI - #49
Conversation
test/CMakeLists.txt feeds Jamfile.v2 to the superproject's boost_test_jamfile()
helper, but that parser only recognises flat 'run foo.cpp ;' lines. This Jamfile
wrapped every test in 'test-suite numeric/interval : [ run foo.cpp ] ... ;', so
each line was silently ignored and a CMake build with BUILD_TESTING=ON configured
no interval tests at all ("No tests were found!!!").
Rewrite the Jamfile in the flat form: same targets, same per-test requirements,
same two entries left disabled (boostorg#15, boostorg#17). B2 behaviour is unchanged.
Also pass the Jamfile's strict-FP flags (-frounding-math / /fp:strict) through
boost_test_jamfile(COMPILE_OPTIONS): the library switches the rounding mode at
run time, and without them pi.cpp fails in optimised CMake builds.
…/cmake-test-jamfile
|
@Lastique You were the large person with a merge. So I tag you. I wanted to build up a Open Source footprint - especially in the maths domain - since I use a bunch of those libraries and inevitably would use more. I made this low-key change, mostly as an excuse for this intro (usefull though). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #49 +/- ##
========================================
Coverage 78.00% 78.00%
========================================
Files 22 22
Lines 923 923
Branches 364 373 +9
========================================
Hits 720 720
Misses 196 196
Partials 7 7 Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
I'm not a maintainer of this library, but if you want my opinion, I'm not a fan of using Anyway, I approved the CI run and it currently fails. Not sure what's going on there as the library uses Boost.CI, which I don't know how it works. |
|
@Lastique So who is the maintainer? I could try to figure this CI issue out - if that's of interest. Also the general maintenance of the library. Many orphaned PR. About CI The idea would be to what others do. I am very new to this. But in any case would any of the CI stuff need elevated permission of sort? But again only if it's of interest. Just pointing me to the the right person would be helpful. |
|
The sanitiser run fails with leaks - also an issue |
|
The official maintainers are listed in meta/libraries.json, although it doesn't look like they have been active recently. We are, of course, interested in submissions, including in CI cleanup. I have the permission to merge the PR, but given that I'm not a maintainer and I'm not familiar with the library, the PR would have to be easy to understand, and it should pass CI.
Well, everyone is doing what makes sense in their libraries. As I said, in trivial cases |
explicit boost_test() instead of boost_test_jamfile()
…coverage and subdir test
|
@Lastique Could you please release the CI. I tried to fix the tests, I tried on my fork, everything except codecov passed. And then comment on the ymls. Do you think it might be too much for a single PR? I tried to keep the ymls separate. |
|
I generally prefer a single |
|
@Lastique so the last issue was a msvc version, there is a warning about it, I suspect pin wasn't a good idea (for now on arm). Rest all passed, but run the windows runner first - If success the rest (they had passed once) |
that's true - I merged the yml files. Running the very first one should just suffice |
The ubuntu-22.04 runner image is deprecated. Run the gcc-9..12 jobs in ubuntu:22.04 containers on ubuntu-latest, and move the Coverity job to ubuntu-24.04 with clang-18 (clang-12 is not packaged there).
|
Thanks. |
The purpose of the PR is to make the CI Green
From the start : boost_test_jamfile()
only parses flatrun foo.cpp ;lines, so the bracketedtest-suiteintest/Jamfile.v2was ignored and a CMake build with BUILD_TESTING=ONconfigured no tests.As requested in review, this now lists the tests explicitly with
boost_test()instead of flattening the Jamfile. Running the tests in more places exposed a few real failures, which are fixed here too, and CI is replaced with a self-contained version of the same jobs.test/CMakeLists.txt: explicitboost_test()calls for the same tests as the Jamfile. The Jamfile's strict floating-point flags are mirrored per compiler (/fp:strictfor MSVC and clang-cl,-fp-model=strictfor IntelLLVM,-frounding-mathfor GCC/Clang).msvc_x64_flagsis built only for MSVC x64, and cmp_tribool` stays disabled (Changes in Boost.Logic (tribool) have broken compare/tribool #15).No language standard is forced, so C++03 builds keep working.
test/Jamfile.v2: back to the originaltest-suiteform. The only change is two added strict-FP requirements,<toolset>clang-win:<cxxflags>/fp\:strictand<toolset>intel:<cxxflags>-fp-model=strict. Without thempifails on clang-win andoverflowfails on icpx (which defaults to-fp-model=fast; it also fails onmaster).test/add.cpp: the symbolicexprnodes were never freed, so LeakSanitizer failedadd. They are now owned by a small pool (C++03). The pool records the pointers, and just calls delete on them when it goes away.test/suppressions.txt(leak:add) is removed as obsolete.test/cmp_exn.cpp: cast theBOOST_C_EXNoperand tovoidto silence-Wunused-comparison.windows-11-arm: uses
toolset=msvcwithout a version. GitHub is moving this runner to an image that ships only Visual Studio 2026, and while that happens repos get either VS 2022 or VS 2026, so a pinned msvc-14.3 or msvc-14.5 fails on one of them.The main issue is the Boost.CI could be a moving target? We have github.
the flags are necessary for the pi test.