Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
556 views
in Technique[技术] by (71.8m points)

testing - Cargo test not displaying any output and not showing all tests

Running cargo test does not show all 4 of the tests, and it doesn't show any output of any of the tests I run. I have 4 tests:

test common::tests::test_workingdays 
test documents::tests::create_docs 
test emailer::tests::test_attachments 
test emailer::tests::test_format_attachments 
$ cargo test
   Compiling te-pm-analytics v0.1.0 (/home/charlie/thoughtexpress/rust/te-pm-analytics)
    Finished test [unoptimized + debuginfo] target(s) in 2.44s
     Running target/debug/deps/main-253a09bf91ed177c

running 4 tests
test common::tests::test_workingdays ... ok
test emailer::tests::test_attachments ... FAILED
error: test failed, to rerun pass '--bin main'

It only runs two of them and does not even give me information on what has failed.

question from:https://stackoverflow.com/questions/65902338/cargo-test-not-displaying-any-output-and-not-showing-all-tests

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

So the reason that this is happening, is that of the 4 tests I have

test common::tests::test_workingdays 
test documents::tests::create_docs 
test emailer::tests::test_attachments 
test emailer::tests::test_format_attachments 

both test_attachments and test_format_attachments were failing, however test_format_attachments had a std::process::exit(1) condition inside the function it was testing, and therefore it killed the process before the tests were able to return.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...