diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-11-12 12:30:07 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-11-12 12:30:07 +0100 |
| commit | 0fb12149ce4245b93dac109a135e81294452edaf (patch) | |
| tree | 5bd34fc0f25a153ee655f7daae3514004709261d /CONTRIBUTING.rst | |
| parent | a07877fd2d60402d81179c0ad90d54a8ea26b0c9 (diff) | |
| parent | 1415e1e7e0011b0c9f42978f013a5d79007bf255 (diff) | |
| download | kernel-0fb12149ce4245b93dac109a135e81294452edaf.tar.xz kernel-0fb12149ce4245b93dac109a135e81294452edaf.zip | |
Merge branch 'feature/catch2-string-makers-develop' into 'develop'
kstd: add Catch2 string makers for printable test output source from develop branch
See merge request teachos/kernel!69
Diffstat (limited to 'CONTRIBUTING.rst')
| -rw-r--r-- | CONTRIBUTING.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 2dbd613c..dabc2552 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -54,6 +54,15 @@ For thread-safety and race condition analysis under ThreadSanitizer: cmake --build --preset bht-stress-dbg ctest --preset bht-stress-dbg +Printing Values in Test Failures +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Catch2 prints values it cannot convert as ``{?}``. +To avoid that, every test translation unit force-includes ``kstd/test_support/string_makers.hpp`` (kstd tests) or ``kernel/test_support/string_makers.hpp`` (kernel tests), which teach Catch2 how to print our types without touching kernel code. +To make a new type printable in tests, add a ``Catch::StringMaker`` specialization to the ``string_makers.hpp`` of the library the type belongs to. +Do not add or change anything in kernel code (e.g. a ``kstd::formatter``) just to make a type printable in tests. +Types that already have a ``kstd::formatter`` are printed through it automatically. + Bootable Kernel Targets ~~~~~~~~~~~~~~~~~~~~~~~ |
