Skip to content

Commit

Permalink
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]>
  • Loading branch information
ShadowCurse committed Nov 28, 2024
1 parent 21bec8f commit 107442c
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
Expand Up @@ -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"

Expand Down

0 comments on commit 107442c

Please sign in to comment.