Skip to content

[BUILD,INTERNAL] Standard-library-only class-test framework, moved into its own library (OpenMSTestFramework) - #9929

Merged
timosachsenberg merged 25 commits into
developfrom
claude/framework-libopenms-removal-k06xbw
Aug 26, 2026
Merged

timosachsenberg merged 25 commits into
developfrom
claude/framework-libopenms-removal-k06xbw

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

Supersedes #9919. The class-test framework (ClassTest.h macros, FuzzyStringComparator, MacrosTest.h) becomes a standard-library-only static library, OpenMSTestFramework, in src/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_test shows 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):

  1. Explicit tmp-file validation — END_TEST no longer schema-validates NEW_TMP_FILE outputs; 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 new VALIDATE_TMP_FILES from the header-only TestFileValidation.h in the class-test project. Removes the framework's CONCEPT→FORMAT dependency; validation becomes opt-in for new tests.
  2. Std-only framework, in place — new ClassTestUtils.h owns 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, so TEST_EQUAL(std::string, number) formats exactly like toStr), a printValue layer for failure reports, and trim/split/join. The exception macros catch std::exception only; unexpected exceptions are described via registered exception translators. FuzzyStringComparator carries local copies of extractDouble/parseFloat/tryParseNaN/to_path/getLine (each with a pointer to its source of truth). The new OpenMSTestSupport.cpp, compiled into every openms/openms_gui test binary, seeds UniqueIdGenerator at static init, registers the OpenMS exception translator, and enables TEST_PRECONDITION_VIOLATED keyed on the same OPENMS_ASSERTIONS the library's OPENMS_PRECONDITION uses — so the expectation can never diverge from the library's real behavior in any build type or generator.
  3. The move — pure git mv (history follows) into src/testframework/, OPENMS_DLLAPI decorations 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 #include as-is.
  4. Library tidy — the test-only writtenDigits specialization (and DataValue forward declaration) leaves Types.h; the no-op Internal::OpenMS_locale global is removed (its initializer restored what it set; Types.cpp became empty and is deleted).
  5. Include fallout — ~40 tests add the Exception.h/StringUtils.h/Types.h/TypeAliases.h/DataValue.h includes they previously received transitively through ClassTest.h (23+3 measured up front, the rest surfaced by a full -k 0 build). Two finds beyond plain includes: MultiplexSatelliteProfile.h used OPENMS_DLLAPI without including OpenMSConfig.h (never self-contained) and gets the include; and the six TEST_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):

  • Class tests: 1194/1194 pass. The one behavioral wrinkle found and fixed along the way: the test projects compile with CMAKE_CXX_FLAGS_RELEASE = -O0 (no NDEBUG), which is why TEST_PRECONDITION_VIOLATED is keyed on the registered OPENMS_ASSERTIONS state rather than NDEBUG.
  • TOPP tests: 1544/1544 pass — every FuzzyDiff-based reference comparison agrees byte-for-byte with the copied number-parsing/formatting code.
  • Acid test: all five OpenSwathAlgo tests link against OpenSwathAlgo + OpenMSTestFramework only and pass; DT_NEEDED of Datastructures_test is libstdc++/libgcc/libc.
  • nm -uC libOpenMSTestFramework.a shows no undefined OpenMS:: 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 library component, as in #9919).

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

🤖 Generated with Claude Code

https://claude.ai/code/session_014EBe4MJ3TQJxm4GVm4N42D


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added a standalone testing framework with improved exception reporting, numeric comparisons, and configurable precondition testing.
    • Added optional validation for temporary XML, INI, and supported scientific data files.
    • Improved deterministic test behavior through consistent identifier seeding.
  • Bug Fixes

    • Improved handling of NaN and infinity comparisons.
    • Prevented invalid parsing on empty string ranges.
    • Removed locale-related side effects.
  • Build Improvements

    • Updated tests and comparison tools to use the standalone framework for greater modularity.

Summary by CodeRabbit

  • New Features
    • Added a standalone test framework library, including fuzzy comparison and enhanced exception reporting.
    • Added explicit validation for temporary XML, INI, and mzML test files.
  • Bug Fixes
    • Improved numeric parsing for empty or bounded input ranges.
    • Improved handling and reporting of NaN and infinity comparisons.
  • Refactor
    • Reduced coupling between testing tools and the main OpenMS library.
    • Removed obsolete locale-management behavior.

timosachsenberg and others added 14 commits August 18, 2026 05:42
…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

Copy link
Copy Markdown
Contributor Author

CI status note: build-sphinx is red, but the failure is pre-existing on the base branch — ruff-action installs the unpinned latest ruff (0.16.3 today), which flags doc/pyopenms/src/examples/pymol_example.py (SIM905, UP031, …), a file this branch does not touch. The same failure shows on every open PR, as already noted in #9919. No action from this PR; will re-check when the base recovers (pinning ruff in the workflow or fixing the example file would clear it repo-wide).


Generated by Claude Code

coderabbitai[bot]

This comment was marked as outdated.

timosachsenberg and others added 4 commits August 18, 2026 13:57
…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
@OpenMS OpenMS deleted a comment from coderabbitai Bot Aug 18, 2026
@OpenMS OpenMS deleted a comment from coderabbitai Bot Aug 18, 2026
@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@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
@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 26dbb873-e61f-4529-8d4a-e08fab89cf0b

📥 Commits

Reviewing files that changed from the base of the PR and between d1feb0d and bd6330c.

📒 Files selected for processing (4)
  • src/openms/include/OpenMS/SYSTEM/PathUtils.h
  • src/testframework/include/OpenMS/CONCEPT/ClassTestUtils.h
  • src/testframework/source/CONCEPT/ClassTest.cpp
  • src/tests/class_tests/openms/source/TOPPBase_test.cpp
💤 Files with no reviewable changes (1)
  • src/tests/class_tests/openms/source/TOPPBase_test.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/testframework/source/CONCEPT/ClassTest.cpp
  • src/testframework/include/OpenMS/CONCEPT/ClassTestUtils.h

Included review availability: Your plan includes up to 4 reviews per rolling hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The class-test framework and fuzzy comparator now build in a standard-library-only static OpenMSTestFramework library. OpenMS tests and FuzzyDiff link this library. Temporary-file schema validation is explicit, and locale-related OpenMS globals are removed.

Changes

OpenMSTestFramework extraction

Layer / File(s) Summary
Framework contracts and build target
src/testframework/..., src/openms/include/OpenMS/CONCEPT/..., src/CMakeLists.txt
The framework uses standard-library types and utilities. CMake builds and installs OpenMSTestFramework as a static library. Framework symbols no longer use OpenMS DLL exports.
Standard-library framework implementation
src/testframework/source/CONCEPT/*
Class-test execution and fuzzy comparison replace OpenMS utility dependencies. Exception translators, runtime precondition controls, numeric formatting, path handling, and fuzzy comparison helpers are implemented locally.
Test support, validation, and consumers
src/tests/class_tests/..., src/topp/..., src/openms/include/OpenMS/DATASTRUCTURES/StringUtils.h
Test targets link OpenMSTestFramework and register OpenMS-specific support. Temporary files receive explicit schema validation. Consumer targets and affected tests receive updated includes and link dependencies.

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
Loading

Poem

A rabbit links the tests in line,
With fuzzy checks that now shine.
XML files pass the schema gate,
Exceptions name their source and state.
The framework hops, clean and bright—
Standard-library dreams take flight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.94% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: moving the standard-library-only class-test framework into the new OpenMSTestFramework library.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/framework-libopenms-removal-k06xbw

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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
@timosachsenberg

Copy link
Copy Markdown
Contributor Author

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)

@jpfeuffer

Copy link
Copy Markdown
Contributor

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.
But I haven't checked the code thoroughly.

@jpfeuffer

Copy link
Copy Markdown
Contributor

Me reviewing AI PRs:

giphy (1)

claude and others added 4 commits August 19, 2026 18:52
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
@timosachsenberg

Copy link
Copy Markdown
Contributor Author

Further concerns?

@timosachsenberg
timosachsenberg enabled auto-merge (squash) August 26, 2026 08:02
@timosachsenberg
timosachsenberg merged commit ca8d56e into develop Aug 26, 2026
34 checks passed
@timosachsenberg
timosachsenberg deleted the claude/framework-libopenms-removal-k06xbw branch August 26, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants