File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,17 @@ export class Cargo {
4848
4949 async executableFromArgs ( args : readonly string [ ] ) : Promise < string > {
5050 const cargoArgs = [ ...args , "--message-format=json" ] ;
51- if ( cargoArgs [ 0 ] == "run" ) {
51+ if ( cargoArgs [ 0 ] === "run" ) {
5252 // a runnable from the quick pick.
5353 cargoArgs [ 0 ] = "build" ;
5454 }
5555
56- const artifacts = await this . artifactsFromArgs ( cargoArgs ) ;
56+ let artifacts = await this . artifactsFromArgs ( cargoArgs ) ;
57+ if ( cargoArgs [ 0 ] === "test" ) {
58+ // for instance, `crates\rust-analyzer\tests\heavy_tests\main.rs` tests
59+ // produce 2 artifacts: {"kind": "bin"} and {"kind": "test"}
60+ artifacts = artifacts . filter ( a => a . isTest ) ;
61+ }
5762
5863 if ( artifacts . length === 0 ) {
5964 throw new Error ( 'No compilation artifacts' ) ;
You can’t perform that action at this time.
0 commit comments