How to understand tests

This is the first time I have been involved in a project where complex tests are used. Does anyone know how to read the following output?

thread 'node::graph::tests::test_graph_empty' panicked at library/core/src/panicking.rs:219:5:
unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread caused non-unwinding panic. aborting.
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/ros_debug_ws/build/rclrs/debug/deps/rclrs-0b260690dc021480 --color=never --quiet` (signal: 6, SIGABRT: process abort signal)

It means this test aborted due to what would have been undefined behavior in a non-debug build (i.e. that crate is not sound).

1 Like

Run it with the env variable above set as it suggests, then look at the file and line numbers in the backtrace to see the code path that is being tested and where it fails.