在集成测试中,货物测试无法引用目标板条箱内的任何公共物品。单元测试也找不到测试用例

时间:2019-10-17 21:41:38

标签: testing rust rust-cargo rust-no-std

我正在尝试在no_std模块上进行一些测试,但是无法同时进行集成和单元测试。我认为这些货物无法使其他人看到功能和模块。

该项目位于:locals()

运行cargo test,我得到了:

➜ cargo test
   Compiling nulloc v0.1.0 (/Users/shisoft/Dropbox/Code/OSS Projects/Nulloc)
error[E0432]: unresolved import `nulloc::bump_heap`
 --> tests/bump_heap.rs:3:14
  |
3 |  use nulloc::bump_heap::BumpAllocator;
  |              ^^^^^^^^^ could not find `bump_heap` in `nulloc`

error[E0432]: unresolved import `nulloc::bump_heap`
 --> tests/bump_heap.rs:3:14
  |
3 |  use nulloc::bump_heap::BumpAllocator;
  |              ^^^^^^^^^ could not find `bump_heap` in `nulloc`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `nulloc`.
warning: build failed, waiting for other jobs to finish...
error: could not compile `nulloc`.

To learn more, run the command again with --verbose.

但是我已经在tests.rs中测试了要测试的板条箱,并且在bump_heap中将lib.rs标记为公开。

当我尝试在bump_heap.rs内运行单元测试时,货物找不到测试用例。

我不确定这是怎么回事

0 个答案:

没有答案