Releases: snitch-org/snitch
Releases ยท snitch-org/snitch
v1.3.1
v1.3.0
Main changes:
- [API] It is now possible to completely disable snitch at compile-time, for example so the test code can be placed alongside the application code (#186). Thank you @NicoMuleo for contributing the feature!
Small changes and bug fixes:
- [Reporter] Fixed #167:
--list-test
output format with default reporter was not compatible with Catch2 (prevented some IDE integrations to work, e.g. CLion). - [Reporter] Fixed #170: Catch2 XML reporter would not report sections properly, and use an old format (v2). Thanks @CrustyAuklet!
- [Internal] Fixed #171: Reporters would require shared global state.
- [Reporter] Fixed #177: Capture and section information was not always reported correctly with unhandled exceptions.
- [Build] Fixed #185: Reporters were not disabled when requested in build options.
- [Build] Fixed #190: Build failures in tests when disabling reporters.
- [Reporter] Fixed #193: Double numbers with exponents between
1e-86
and1e-99
contained a null character when converted to string. - [Build] Fixes #196: Install prefix was incorrect when using
cmake --install ... --prefix ...
instead of setting-DCMAKE_INSTALL_PREFIX
at configure time.
v1.2.5
Small changes and bug fixes:
- Fixed #158: Add option to disable multi-threading support for embedded use.
- Fixed #158: Compilation would fail if
SNITCH_MAX_MESSAGE_LENGTH
andSNITCH_MAX_EXPR_LENGTH
were not the same. - Fixed #158 and #18: Use
std::to_chars
to avoid usingstd::snprintf
which is not always fully implemented. Ifstd::to_chars
isn't available, fallback to our own (slower but portable) implementation. - Fixed #164: Escaped characters could sometimes be truncated incorrectly if hitting the max message length.
v1.2.4
Small changes and bug fixes:
- Fixed #143: Extraneous failures were reported for
REQUIRE_THROWS_*
macros in case no exception is thrown. - Fixed #145:
CONSTEVAL_*
macros were evaluating their expressions at runtime if the expression was not decomposable. - Fixed #147: color codes were used in the console output in some cases even when
--color never
was specified. - Fixed #149: following sections were sometimes executed after an uncaught exception.
- [Reporter] When an exception is thrown unexpectedly in the test code, the resulting assertion now reports the file/line of the
CHECK*
orREQUIRE*
call that triggered the exception. If the exception is not triggered inside a check macro, then the file/line of the enclosingSECTION
is used instead. If no section is used, then the assertion reverts to the previous behavior (file/line of the test case). See #141. - [Build] Meson scripts now properly set the default symbol visibility with GCC/clang (thanks @topazus)
- [Internal] Renamed
small_function
intofunction_ref
(thanks @tocic)
v1.2.3
v1.2.2
v1.2.1
Small changes and bug fixes:
- [Build] Reverted the change to the CMake target name for the header-only build. It is now back to
snitch::snitch-header-only
. - [Build] Lowered the minimum CMake version to what is strictly needed (3.14 instead of 3.19).
- [Build] Fixed #120: CMake error when enabling
--warn-uninitialized -Werror=dev
.
v1.2.0
Main changes:
- [API] Added
REQUIRE_NOTHROW(EXPR)
andCHECK_NOTHROW(EXPR)
. - [API] Added
SUCCEED(MESSAGE)
. - [API] Added
REGISTER_REPORTER(...)
(from Catch2) for registering multiple reporters that can be selected from the command line. - [CLI] Added support for
--out
to save test report to a file. - [CLI] Added support for filtering the output of
--list-tests
(#114). - [Reporter] Added the Catch2 XML reporter (#100).
- [Reporter] Added file/line information for test cases and sections.
- [Reporter] Added fixture class name information for test cases ("method" test cases only).
- [Reporter] Added test filtering criteria to the
test_run_started
event. - [Reporter] Expression data is no longer concatenated into a single message when sent to the reporter.
- [Reporter] Added events for listing tests (listing started, ended, and test case listed).
As a result, the following Catch2 IDE integrations now work with snitch:
- Visual Studio Code & C++ TestMate
- Visual Studio 2022 & Catch2 Test Adapter
- CLion Catch2 configuration
Small changes and bug fixes:
- [API] Fixed #105:
small_function
copy construction from a non-const object was ambiguous. - [API] Fixed #107: crash when evaluating a check containing a
const char*
equal tonullptr
. - [Reporter] Fixed: the Teamcity reporter was reporting failures in
[!mayfail]
and[!shouldfail]
as actual failures. - [Reporter] Fixed: long outputs in
registry::print
and all reporters was too easily truncated; the risk of this is now largely reduced. - [CLI] Fixed: unsupported Catch2 command line parameters were not parsed correctly.
- [CLI] Fixed #110: the output of
--list-tests
did not contain the full test name. - [CLI] Fixed #113: the test filtering algorithm did not match Catch2 v3.
- [Build] snitch can now build as a shared library.
- [Build] The CMake scripts will now build either a compiled library or a header-only library, but not both.
- [Docs] Fixed #108: clarify how to write your own
append()
function for serialisation - [Internal] Fixed:
small_vector_span<const T>
was unsafe when not initialized with a valid backingsmall_vector
. - [Internal] Fixed:
small_function
compilation error when assigning a member function (or stateful lambda) when the function parameters contain l-value references. - [Internal] Added
file_writer
. - [Tests] Added approval tests for all reporters.
- [Tests] Reduced memory usage of
mock_framework
in tests by ~x3. - [Tests] Reduced stack usage in tests by allocating large data on the heap (reduce risk of stack overflow).
- [Tests] Fixed stack size for tests not set correctly on Windows.
v1.1.1
v1.1.0
Main changes:
- Added
CONSTEVAL_*
andCONSTEXPR_*
macros for compile-time (or combined compile- and run-time) testing. - Added test event reporting for successful assertions (available only with verbosity "full").
- Added
SKIP_CHECK()
to mark a test case as skipped without aborting (useful only if exceptions are turned off). - Previously, verbosity only controlled the output of the default reporter. This was not documented. Now, verbosity selects which tests events are sent to the reporter interface. This will speed things up, however you may have to increase the verbosity level if your custom reporter requires events that aren't emitted at the default verbosity (e.g., test case start/end events require verbosity "high").
- Fixed major bug #83: the last section at any level is only ever entered once, even if it has multiple child sections.
Small changes and bug fixes:
- Fixed #61: support expressions containing commas in
REQUIRE
,CHECK
,REQUIRE_FALSE
, andCHECK_FALSE
- Fixed #62: do not include absolute path to build directory in uncaught exception messages
- Fixed #66: incorrect static assert in implementation (internal only; does not affect user code)
- Fixed #67:
REQUIRE_THAT
andCHECK_THAT
would not compile - Fixed #68: preserve matcher state in
REQUIRE_THROWS_MATCHES
andCHECK_THROWS_MATCHES
- Fixed #74: incorrect formatting for uncaught
std::exception
- Fixed #77: extra semicolon warning with
-Wpedantic
- Fixed #82: corrupted terminal output if assertion message exceeds
SNITCH_MAX_MESSAGE_LENGTH
. - (build) Added support for meson.
- (utilities) Refactored
snitch::small_function
to have stronger invariants (always contains a function to call). - (internal) Split the code into multiple files. This is fully backward-compatible, just makes maintenance a bit easier.
- (internal) Refactored the default reporter to use the standard reporter interface, rather than receiving special treatment.
- (internal) Fixed the
snitch_all
target being sometimes out of date when building tests. - (internal) Fixed WebAssembly tests not configured with as much stack space as other platforms.
- (internal) Fixed tests not compiling/failing when exceptions are forcefully disabled in the compiler settings.
- (internal) Replaced several calls to
std::terminate
with a customizable assertion handler. This terminates by default, so behavior is unchanged, but can be made to throw instead for testing. - (internal) Applied the Lakos Rule for
noexcept
to the whole code. This led to a minor but measurable performance degradation of compilation time. - (internal) Added missing tests for exception checking macros.
- (internal) Reduced code duplication between check macros. This improved compilation time slightly.