Open garthk opened 9 years ago
Thanks for this, I have been able to reproduce, I'm not sure what the problem is yet but will look into it once I get some free time
I'm having the same problem too. Is there a fix yet?
@jnordwick sorry havn't got a fix yet, please feel free to contribute if you have an idea of why it is failing?
Would love to... when Atom becomes a little more functional. Moved on to IDEA, since Atom was far behind where I thought it was. I like the idea, but it isn't even up to a good vimrc config yet in ability. Maybe in a few months, I'll revisit (and the Rust tooling should be more polished by then too).
I had a bit of a chance to look into this Looks like my understanding of how cargo filters test could be wrong
Essentially what this plugin does is use the filename from the file that is currently selected to filter out what tests to run
From the cargo documentation cargo test -h
For
example, this will run all tests with the name `foo` in their name:
cargo test foo
So in the above example we are actually running cargo test lib
which I would expect this to run all tests in any files that contain lib
.
If I run cargo test lib
from the command line I get
cargo test lib
Compiling adder v0.0.1 (file:///Users/nguyenchr/Documents/rust/adder)
Running target/adder-742f3bc3af7d0ced
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
Doc-tests adder
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
That is the problem.
When it says "with the name foo
in their name" it means the actual test functions, not the files. I just confirmed this by changing the name of my test function to match the name of my test file and it ran.
the fix is now in the latest v0.1.0
release, thanks for the help everyone :)
I'll leave it to you to close it, @nguyenchr; I haven't touched Atom nor Rust for a few months.
cargo new adder
cd adder/
edit
src/lib.rs
to contain:cargo test
Packages menu >
cargo-test-runner
>run tests
The
cargo
path is right, as is the root folder, but you're not picking up the tests.Versions:
cargo-test-runner
: 0.0.4cargo
: 0.2.0rustc
: 1.0.0