testing - 货物测试不显示任何输出并且不显示所有测试
问题描述
运行cargo test
不会显示所有 4 个测试,也不会显示我运行的任何测试的任何输出。我有 4 个测试:
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'
它只运行其中两个,甚至没有给我关于失败的信息。
解决方案
所以发生这种情况的原因是我有 4 个测试
test common::tests::test_workingdays
test documents::tests::create_docs
test emailer::tests::test_attachments
test emailer::tests::test_format_attachments
两者test_attachments
都test_format_attachments
失败了,但是它正在测试的函数内部test_format_attachments
有一个std::process::exit(1)
条件,因此它在测试能够返回之前终止了进程。
推荐阅读
- visual-studio - Roslyn MSBuild 工作区添加了额外的斜杠?
- bokeh - 显示带有铬嵌入框架的散景图?
- ruby-on-rails - 未找到 Rails Devise Gem Routes
- javascript - SWT 浏览器未在 Eclipse 视图中呈现 Angular 2 页面
- c# - 如何使报表查看器控件以 xls 格式而不是 xlsx 格式导出?
- shell - 获取属于具有多个 DC 的 Cassandra 集群的每个 dc 的节点数的最佳方法是什么?
- javascript - 在前端 javascript 中添加文档对象的自定义属性
- apache-nifi - 通过 Nifi 处理大文本文件返回 null
- python - 在python中调用空数组的元素
- objective-c - Objective-C:强制使用 Facebook 应用程序登录?