Repository navigation
[BUILD,INTERNAL] Standard-library-only class-test framework, moved into its own library (OpenMSTestFramework) - #9929
Conversation
…ng on libOpenMS Follow-up plan for #9919, verified against that branch by measurement: the framework's link surface (nm on its two objects), the implementation closure the PR-comment sketch missed (GlobalExceptionHandler, SysInfo, SIMDe, the DataValue/ParamValue toStr definitions), why the core must be a shared library (four duplicated-state hazards incl. UniqueIdGenerator seeding and BaseException RTTI), the OPENMSCORE_DLLAPI/config.h wiring, the test-side isRealType customization point (26+1 files, measured), the two-PR step sequence with an acid test, and the packaging checklist for a new shipped library (wheels, KNIME, pyOpenMS preload). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
…raction Six pre-work changes, each measured on the #9919 branch, that remove the plan's hard parts at the root instead of working around them: configuration-free bottom layer with checked-in platform/export headers (deletes the config.h wiring section), pull-model terminate handler so Exception.cpp drops GlobalExceptionHandler (also fixes a data race), local PID fetch so SysInfo stays in libOpenMS, moving DataValue knowledge out of Types.h/StringUtils (incl. the test-only writtenDigits<DataValue> specialization and the dead OpenMS_locale global), finishing target-based CMake, and deriving the shipped-library roster. With S1-S4 landed, the extraction becomes 9 headers + 4 dependency-free sources - the "build-system only" move the original sketch assumed. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
… a library Parts 1-2 answered two questions at once; all residual complexity (shared library, export macros, config wiring, packaging, ABI) belongs to starting the libOpenMS split, not to freeing the framework. Catch2's structural rule - the framework's compiled code touches only std types, everything type-specific happens at the macro-expansion site - maps onto the five measured couplings: expansion-site printing already works today, BaseException already derives std::runtime_error (complete what(), catch std::exception), framework-owned trim/extractDouble/ formatter (~250 lines, loud failure mode), seeding via a test-project support TU, and the S4 predicate. Result: a std-only static framework, no new shipped artifact, acid test met in three small PRs; OpenMSCore decouples onto the split's own timeline. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
File-by-file specification with copy sources (appendNumeric, extractDouble+parseFloat/tryParseNaN, to_path), the exception-translator registry replacing the BaseException clauses in printLastException and the TEST_EXCEPTION* macros, the seeding+translator support TU wired into the three add_executable sites, the printValue layer (named function, not operator<<, to avoid ADL ambiguity with ListUtilsIO), framework-owned writtenDigits (OpenSwathAlgo tests use TEST_REAL_SIMILAR), the NDEBUG switch for the precondition macros (14 files), the include-fallout protocol, acceptance criteria, and a risk register. Two revisions to Part 3 discovered while specifying: the isRealType predicate must ride in the main PR (ClassTest.h cannot go std-only while including DataValue.h), and the what()-completion PR is dropped -- 29 files compare what() verbatim in TEST_EXCEPTION_WITH_MESSAGE, so exception naming is injected via a registered translator instead. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
…a donor The spec no longer requires #9919 to merge. Sequencing std-only BEFORE extraction restructures the program into three green PRs from develop: PR0 explicit tmp-file validation (26 measured tests, hunks donated by the #9919 branch), PR1 std-only in place (framework files still inside libOpenMS, so tests keep linking as today), PR2 a purely mechanical move to src/testframework. Because the framework archive then references no libOpenMS symbols and every openms test binary references libOpenMS through the seeding/translator support TU, four pieces of #9919's machinery are never needed: the 'needed' link feature, LINK_LIBRARY_OVERRIDE, the CMake 3.21->3.24 bump, and the OpenMS->framework usage-requirement propagation; the Arrow/Thrift link order from develop is undisturbed. All file:line references re-verified against develop (c77f588), including develop-only deps the previous revision could not see (automatic FORMAT validation, TextFile/File use in FuzzyStringComparator, vestigial boost fpclassify include). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
END_TEST no longer schema-validates NEW_TMP_FILE outputs automatically; the 26 tests that actually validated files (determined by measurement in #9919: all 57 NEW_TMP_FILE+XML tests were run against the automatic- validation build and 26 validated something) now call VALIDATE_TMP_FILES explicitly via the new header-only TestFileValidation.h in the class-test project. Each validates exactly the same files as before; types without a schema validator were skipped before and still are. This removes the framework's only dependency on the FORMAT layer (a CONCEPT component calling upward), as prework for making the class-test framework standard-library-only. Validation becomes opt-in for new tests; the VALIDATE_TMP_FILES docs say when to add it. Validation hunks taken from #9919 (measurement and 26-test list). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
The framework (ClassTest, FuzzyStringComparator) no longer uses anything from libOpenMS -- verified by compiling both TUs against an include tree containing only the framework's own headers, and by linking and running a test executable against nothing but the two framework objects. Following the structure of Catch2: the framework's compiled code touches only std types; everything type-specific happens at the macro-expansion site or is registered by the side that knows. * New ClassTestUtils.h owns the utilities the framework needs: writtenDigits, an isRealType predicate (floating point, or class implicitly convertible to double -- covers DataValue/ParamValue and any future variant type with zero registration), the numeric formatter (verbatim copy of StringUtils' appendNumeric; TEST_EQUAL's string-vs-number quirk must format exactly like toStr), a printValue layer for failure reports (streamable via expansion-site operator<<, ranges as "[a, b, c]" like ListUtilsIO, placeholder otherwise), trim/ split/join, and a precisionWrapper equivalent. * Exception handling: the framework catches std::exception only. TEST_EXCEPTION's typed catch always bound in the test TU; the hard-coded BaseException clauses are replaced by registered exception translators (Catch2's translator design). printLastException and the macros describe foreign exceptions via describeCaughtException(). * FuzzyStringComparator carries local copies of extractDouble/ tryParseNaN/parseFloat, to_path, prefix/suffix and TextFile::getLine (each with a pointer to its source of truth); StringList/Int/UInt are respelled as their underlying std types, so the API is unchanged and FuzzyDiff compiles as before. * New OpenMSTestSupport.cpp, compiled into every openms/openms_gui test executable, seeds UniqueIdGenerator at static init (earlier than the removed START_TEST-time call) and registers the OpenMS exception translator. OpenSwathAlgo tests do not include it -- their tests need nothing from libOpenMS anymore. * TEST_PRECONDITION/POSTCONDITION_VIOLATED now key on NDEBUG (also correct for multi-config generators, unlike CMAKE_BUILD_TYPE). * 25 tests add the DataValue/ParamValue includes they previously got transitively through ClassTest.h (23 + 3, measured; one file needs both). The framework files still live in src/openms and still compile into libOpenMS; the move into their own static library is the next commit. Test link lines are unchanged in this commit. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
…OpenMSTestFramework)
Pure mechanics on top of the previous commit: git mv of the six framework
files (history follows) out of libOpenMS into src/testframework/, built
as the static library OpenMSTestFramework. Include paths are unchanged
(<OpenMS/CONCEPT/ClassTest.h>), install locations are unchanged, so no
test file needs editing for the move.
Because the framework is standard-library-only, none of the link-order
machinery a dependent framework would need exists here: no link
features, no --as-needed precautions, no usage-requirement propagation
from OpenMS, and the CMake minimum stays at 3.21. Every openms /
openms_gui test binary references libOpenMS genuinely (through its own
test code and OpenMSTestSupport.cpp), and libOpenMS.so keeps preceding
the static Arrow archives on the test link lines exactly as on develop.
* class tests link "OpenMSTestFramework ${OpenMS_LIBRARIES}" (gui
analogous); the OpenSwathAlgo tests link "OpenSwathAlgo
OpenMSTestFramework" -- no libOpenMS anywhere in their link closure,
which was the goal of this series.
* FuzzyDiff links the framework for FuzzyStringComparator.
* The ~50 OPENMS_DLLAPI decorations are stripped (a static archive
exports nothing) and the framework's symbols leave the libOpenMS ABI.
* The archive installs under its own component and is deliberately not
part of the exported OpenMS package, so minimal component-wise
install flows (pyOpenMS wheels) are unaffected.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
…OpenMS_locale relic The writtenDigits<DataValue> specialization (and its DataValue forward declaration) existed only for TEST_REAL_SIMILAR, which now uses the test framework's own writtenDigits; no library code calls it (measured). Internal::OpenMS_locale was a no-op: its initializer saved the locale, set "C" and restored the saved locale again, so the global only ever held the literal "C". Its one reader (OpenSwathFeatureXMLToTSV) now uses the literal; the test that existed solely to verify the relic is removed, and with it Types.cpp is empty and deleted. This also removes a static-initialization side effect from the bottom-most library layer. Plus the CHANGELOG entry for the whole test-framework series. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
…est.h First batch of the include fallout from the framework going standard-library-only: tests using Exception types, StringUtils' string operators, or the StringList alias now include those headers themselves. Found by the full local build; more batches follow as the -k 0 pass surfaces them. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
…e.h self-contained Complete inventory from the full -k 0 build: tests add the Types.h / Exception.h / StringUtils.h / TypeAliases.h includes they previously received transitively through ClassTest.h. Two notable finds beyond plain includes: MultiplexSatelliteProfile.h used OPENMS_DLLAPI without including OpenMSConfig.h (never self-contained; papered over by the old ClassTest.h transitives) and gets the include; and the one TEST_EQUAL(std::string, DataValue) call site in the tree (TargetedSpectraExtractor_test) now stringifies explicitly with DataValue::toString() -- the same function the removed implicit toStr(DataValue) path called. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
…on.h) The donor hunk from #9919 that puts ${PROJECT_SOURCE_DIR}/include/ on the class-test include path was missed when porting the explicit- validation commit; without it the 26 validating tests cannot find <OpenMS/TestFileValidation.h>. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
The five TEST_EQUAL(getStringOption(...), DataValue("...")) sites
compared a std::string against a DataValue, which relied on the
framework stringifying the DataValue; comparing against the string
literal directly is equivalent and simpler. (The framework's
stringification guard rejects non-arithmetic types by design.)
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
…ONS via registration The NDEBUG guard was wrong in exactly the configuration the class tests build in: the test projects replace CMAKE_CXX_FLAGS_RELEASE with plain -O0, wiping -DNDEBUG, so the macros expected Precondition throws from a Release library whose OPENMS_PRECONDITION checks are compiled out -- nine "no exception thrown" failures and one segfault (the unguarded command running into the very condition the precondition guards) in the local Release run. Fixed with the same pattern as seeding and exception naming: the side that knows registers. TEST_PRECONDITION/POSTCONDITION_VIOLATED now check a runtime flag (default off) that OpenMSTestSupport.cpp enables under #ifdef OPENMS_ASSERTIONS -- the identical switch Macros.h keys the library's checks on, read from the same config.h, so the expectation can never diverge from the library's behavior in any build type, flag override, or multi-config generator. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
|
CI status note: Generated by Claude Code |
…ort wording, doc alignment Review findings from #9929, each verified against the code before fixing: * extractDouble/extractInt iterator overloads (StringUtils.h and the framework's copy, kept in sync) no longer dereference the past-the-end iterator -- the end pointer is computed from the range length -- and guard empty ranges before dereferencing begin. Identical behavior for non-empty ranges; debug-iterator builds stop asserting. * FuzzyStringComparator: explicit <fstream>/<istream>/<ostream> in the header and <type_traits> in the .cpp (std::is_same_v sits in the libc++-only from_chars fallback, exactly the platform that would have missed it transitively). * TEST_NOT_EQUAL's generic failure branch says "forbidden is" like its enum branch (the "expected" wording predates this series). * describeCaughtException() documents that it requires an active exception (bare rethrow otherwise terminates). * TestFileValidation.h includes Types.h/TypeAliases.h directly and VALIDATE_TMP_FILES prints the failing-line marker like VALIDATE_FILE. * OpenSwathFeatureXMLToTSV: setlocale(LC_ALL, "C") directly instead of a variable that only ever held "C". * doc/plans: Part 3 aligned with the implemented translator design (no what() changes), PR count wording, acceptance criterion checks the transitive closure via ldd, include check scans all framework files against an allowlist. Declined, with reasons in the PR thread: the to_path POSIX fallback (verbatim copy of PathUtils.h; POSIX path construction is a byte copy and cannot throw) and registering compressed tmp-file names (behavior is identical to develop's automatic validation; changing it would newly validate files with unverified .gz validator support -- follow-up material). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
…cture Rewrite the @defgroup ClassTest page (stale since the framework moved out of OpenMS/source/TEST): what the OpenMSTestFramework library is, why it is std-only, test anatomy, the registration points wired up by OpenMSTestSupport.cpp (exception translators, precondition-test enablement, unique-id seeding), expansion-site printing, the TEST_REAL_SIMILAR convertibility rule, and where VALIDATE_TMP_FILES lives. Tag VALIDATE_TMP_FILES / VALIDATE_FILE / validateTmpFiles with @InGroup ClassTest and add the openms class-test include dir to the documentation search path so they render on the same page. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
The member block of the ClassTest topic was delimited with plain '//@{' /
'//@}' C++ comments, which doxygen (1.9.x) ignores entirely -- the generated
'Class test macros' page carried the group description but listed no macros.
Replace them with real doxygen comments ('/** @{ */' ... '/** @} */') so all
test macros appear as members of the page, and drop the equally invisible
'//@name test and subtest' stub. Verified with doxygen 1.9.8: the group page
now lists all 26 framework macros plus the validation helpers.
Also escape the whitespace escapes in the trim() doc comment, which doxygen
parsed as (unknown) commands.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
The two planning documents under doc/plans/ drove the design phase of this series; the durable outcome lives in the PR description, the code comments, and the ClassTest doxygen page. Remove them so the tree gains no implementation-time planning artifacts. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
|
@cbielow second attempt and I like the design now. |
PathUtils.h guarded the Windows ANSI-code-page fallback of the inline to_path() with OPENMS_WINDOWSPLATFORM but includes nothing that defines it, so the branch selected depended on whether the including TU happened to see <OpenMS/config.h> first -- an ODR hazard, and the cause of the windows-2025 CI failure: the std-only ClassTest.h no longer hands test TUs config.h transitively, so PathUtils_test compiled to_path without the fallback and the CP-1252 test cases threw. Key the guard on the compiler-provided _WIN32 (self-contained by construction; matches the framework's copies byte for byte). Verified as the only header using a config.h macro without including config.h; all test TUs using such macros reach config.h via Types.h. Review-round follow-ups: printLastException reproduces develop's exact two-line report format for non-OpenMS exceptions (translator output stays on one line); drop TOPPBase_test's now-unused DataValue.h include; document writtenDigits' deliberate report-precision divergence (ParamValue 6->15, long 9->18; print-only, never the comparison). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan includes up to 4 reviews per rolling hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe class-test framework and fuzzy comparator now build in a standard-library-only static ChangesOpenMSTestFramework extraction
Sequence Diagram(s)sequenceDiagram
participant TestExecutable
participant OpenMSTestSupport
participant OpenMSTestFramework
participant OpenMSLibrary
TestExecutable->>OpenMSTestSupport: initialize test support
OpenMSTestSupport->>OpenMSTestFramework: register exception translator and precondition state
TestExecutable->>OpenMSTestFramework: run class tests
TestExecutable->>OpenMSLibrary: create and write temporary files
TestExecutable->>OpenMSTestFramework: validate test results and cleanup
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This comment was marked as outdated.
This comment was marked as outdated.
The class-test framework is an in-repo development tool, not product payload. Mark the archive's install rule EXCLUDE_FROM_ALL so default installs and the monolithic installers (NSIS/zip) skip it, and drop the component from the macOS productbuild package list (which enumerates components explicitly). `cmake --install . --component OpenMSTestFramework` still installs it for whoever wants it. The headers keep installing to their historic location: they always shipped as part of the OpenMS header set, and existing includes of <OpenMS/CONCEPT/ClassTest.h> keep resolving against an installed tree. All linking consumers (class tests, FuzzyDiff, tests of future split-off libraries) are in-tree and use the CMake target directly. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
|
Transition to Catch2 v3 could be a potential follow up. For now it is mainly intended to simplify testing of split libraries (e.g. io in the future) |
|
The description and commit messages, ideas and intentions sound good. Also nice that is is not shipped anymore and is a separate lib in cmake. |
Picks up #9923 (obsolete developer tooling removal), which landed on develop after this branch was last pushed. GitHub flagged the PR as conflicted; the one file both changes touch is src/openms/include/OpenMS/CONCEPT/ClassTest.h -- #9923 edited its START_SECTION documentation to drop the reference to the deleted tools/checker.php, while this branch moves the file to src/testframework/. The merge follows the rename and applies the edit at the new path; every other file #9923 touched is taken from develop unchanged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MbuL7ckNAxytCK486pxHGR
OpenMSTestFramework is standard-library-only, so the numeric formatting and number parsing it needs are copies of libOpenMS code: detail::appendNumeric in ClassTestUtils.h from StringUtils.cpp, and tryParseNaN/fromCharsFloat/ parseFloat/extractDouble in FuzzyStringComparator.cpp from StringUtils. The copies exist to produce identical results, and nothing enforced that. The two sides compile independently, so a change to one was silently accepted, and the consequence would not be a build error but a behavioural one: TEST_EQUAL (std::string, <number>) would stop agreeing with StringUtils::toStr(), and FuzzyStringComparator would stop reading back the numbers the library writes into the TOPP reference files. The suite was only an indirect oracle for this -- it notices drift when some unrelated test's expected string happens to change. The test compares against libOpenMS rather than against a table of expected strings, so a legitimate change to the library's format does not have to be transcribed here, and the assertion keeps meaning "the two agree". It sits in the class-test project because only there are both implementations visible. Covers double/float/long double/integral formatting, writtenDigits (pinning the documented, deliberate long and unsigned long divergences so they stay deliberate), and -- through compareStrings -- that the comparator still parses what StringUtils writes. Verified by mutation: dropping one digit of precision in the framework's appendNumeric, making its extractDouble always fail, and making its parseFloat reject exponents are each caught. Disabling tryParseNaN alone is not, since std::from_chars accepts "nan" as well; the comment on that assertion says so rather than claiming a guard it does not provide. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MbuL7ckNAxytCK486pxHGR
Tighten the block/rationale comments added in this series (framework CMakeLists, ClassTestUtils, OpenMSTestSupport, PathUtils, FuzzyStringComparator, TestFileValidation, packaging) to the load-bearing facts; no code changes. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
|
Further concerns? |

Description
Supersedes #9919. The class-test framework (
ClassTest.hmacros,FuzzyStringComparator,MacrosTest.h) becomes a standard-library-only static library,OpenMSTestFramework, insrc/testframework/— zero libOpenMS headers, zero libOpenMS symbols. The acid test from the #9919 discussion holds: the OpenSwathAlgo class tests build and pass with no libOpenMS anywhere in their link closure (readelf -d Datastructures_testshows libstdc++/libgcc/libc only).The design is Catch2's, applied piecewise: the framework's compiled code touches only std types; everything type-specific happens at the macro-expansion site or is registered by the side that knows. Because the framework references no libOpenMS symbols, none of the dependent-framework machinery from #9919 exists here — no user-defined link features, no
LINK_LIBRARY_OVERRIDE, no CMake 3.21→3.24 bump, no usage-requirement propagation, and the Arrow/Thrift link order on the test lines is untouched from develop.Commit walk (each independently green):
END_TESTno longer schema-validatesNEW_TMP_FILEoutputs; the 26 tests that actually validated files (measured in [BUILD,INTERNAL] Move the class-test framework into its own library (OpenMSTestFramework) #9919; hunks taken from there) call the newVALIDATE_TMP_FILESfrom the header-onlyTestFileValidation.hin the class-test project. Removes the framework's CONCEPT→FORMAT dependency; validation becomes opt-in for new tests.ClassTestUtils.hownswrittenDigits, anisRealTypepredicate (floating point, or class implicitly convertible todouble— coversDataValue/ParamValueand any future variant type with zero registration), the numeric formatter (verbatim copy ofStringUtils'appendNumeric, soTEST_EQUAL(std::string, number)formats exactly liketoStr), aprintValuelayer for failure reports, and trim/split/join. The exception macros catchstd::exceptiononly; unexpected exceptions are described via registered exception translators.FuzzyStringComparatorcarries local copies ofextractDouble/parseFloat/tryParseNaN/to_path/getLine(each with a pointer to its source of truth). The newOpenMSTestSupport.cpp, compiled into every openms/openms_gui test binary, seedsUniqueIdGeneratorat static init, registers the OpenMS exception translator, and enablesTEST_PRECONDITION_VIOLATEDkeyed on the sameOPENMS_ASSERTIONSthe library'sOPENMS_PRECONDITIONuses — so the expectation can never diverge from the library's real behavior in any build type or generator.git mv(history follows) intosrc/testframework/,OPENMS_DLLAPIdecorations stripped, link lines updated; the ~50 framework symbols leave the libOpenMS ABI. Include paths and installed header locations are unchanged, so the ~720 tests keep#includeas-is.writtenDigitsspecialization (andDataValueforward declaration) leavesTypes.h; the no-opInternal::OpenMS_localeglobal is removed (its initializer restored what it set;Types.cppbecame empty and is deleted).Exception.h/StringUtils.h/Types.h/TypeAliases.h/DataValue.hincludes they previously received transitively throughClassTest.h(23+3 measured up front, the rest surfaced by a full-k 0build). Two finds beyond plain includes:MultiplexSatelliteProfile.husedOPENMS_DLLAPIwithout includingOpenMSConfig.h(never self-contained) and gets the include; and the sixTEST_EQUAL(std::string, DataValue)sites in the tree now compare strings directly.Testing
Full local verification on Linux (g++ 13, Release, Ninja,
WITH_GUI=OFF/WITH_THERMO_RAW=OFF):CMAKE_CXX_FLAGS_RELEASE = -O0(noNDEBUG), which is whyTEST_PRECONDITION_VIOLATEDis keyed on the registeredOPENMS_ASSERTIONSstate rather thanNDEBUG.OpenSwathAlgo+OpenMSTestFrameworkonly and pass;DT_NEEDEDofDatastructures_testis libstdc++/libgcc/libc.nm -uC libOpenMSTestFramework.ashows no undefinedOpenMS::symbols; the framework TUs compile standalone against an include tree containing only their own four headers.For CI to confirm: macOS and Windows (seeding via the support TU on Windows in particular), the GUI test project (not built locally), and the wheel builds (the framework target is deliberately outside the exported package and the
librarycomponent, as in #9919).Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D
Generated by Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Build Improvements
Summary by CodeRabbit