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 {
48
48
49
49
async executableFromArgs ( args : readonly string [ ] ) : Promise < string > {
50
50
const cargoArgs = [ ...args , "--message-format=json" ] ;
51
- if ( cargoArgs [ 0 ] == "run" ) {
51
+ if ( cargoArgs [ 0 ] === "run" ) {
52
52
// a runnable from the quick pick.
53
53
cargoArgs [ 0 ] = "build" ;
54
54
}
55
55
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
+ }
57
62
58
63
if ( artifacts . length === 0 ) {
59
64
throw new Error ( 'No compilation artifacts' ) ;
You can’t perform that action at this time.
0 commit comments