我正在尝试在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
内运行单元测试时,货物找不到测试用例。
我不确定这是怎么回事