所以我有一個失敗的貨運測試:如何在gdb中調試失敗的貨物測試?
$ cargo test
[snip]
Running target/gunzip-c62d8688496249d8
running 2 tests
test test_extract_failure ... FAILED
test test_extract_success ... ok
failures:
---- test_extract_failure stdout ----
task 'test_extract_failure' panicked at 'assertion failed: result.is_err()', /home/dhardy/other/flate2-rs/tests/gunzip.rs:19
failures:
test_extract_failure
test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured
task '<main>' panicked at 'Some tests failed', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libtest/lib.rs:250
如何啓動失敗的測試在調試器(GDB或相似的)?
這應該是一個普遍的問題,但對於那些想追溯我的步驟,安裝近期夜間鏽構建和:
git clone https://github.com/dhardy/flate2-rs.git
git checkout 24979640a880
cd flate2-rs
cargo test
謝謝,克里斯!但是Cargo仍然在構建flate2庫而沒有調試信息,這意味着我無法進行除測試功能以外的任何調試。如何爲flate2 lib/all庫啓用調試?據我瞭解,Cargo有一個'--release'標誌來打開優化,所以爲什麼默認情況下不打開調試信息? [相關問題](http://stackoverflow.com/questions/27032271/how-to-debug-a-crate-in-rust) – dhardy 2014-12-03 13:31:58