Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(unit-tests): disable debug-assertions in test builds
Browse files Browse the repository at this point in the history
We need to do this because we have tests which create
Files from a raw fds or do an explicit close on fds.
This causes UB check to trigger and test to panic.
There is no separate flag to disable these checks,
so we have to disable all debug-assertions in test builds.
Tracking issue: rust-lang/rust#123499

Signed-off-by: Egor Lazarchuk <[email protected]>
ShadowCurse committed Nov 28, 2024
1 parent bbadfbf commit 4aa2d4e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -22,6 +22,14 @@ tests_outside_test_module = "warn"
assertions_on_result_states = "warn"
error_impl_error = "warn"

[profile.test]
# Some unit tests create files from raw fds and
# this triggers UB checks to panic. There is no
# separate flag to disable those as of right now,
# so we have to disable debug-assertions.
# Tracking issue: https://github.com/rust-lang/rust/issues/123499
debug-assertions = false

[profile.dev]
panic = "abort"

0 comments on commit 4aa2d4e

Please sign in to comment.