28
28
assert_that ( & p. bin ( "foo" ) , existing_file ( ) ) ;
29
29
}
30
30
31
- #[ test]
32
- #[ ignore]
33
- fn simple_implicit_main ( ) {
34
- let p = project ( "foo" )
35
- . file ( "Cargo.toml" , r#"
36
- [project]
37
- name = "foo"
38
- version = "0.0.1"
39
- authors = []
40
- "# )
41
- . file ( "src/main.rs" , r#"
42
- fn main() { println!("hello world"); }
43
- "# )
44
- . build ( ) ;
45
-
46
- assert_that ( p. cargo ( "run" ) . arg ( "--bins" ) ,
47
- execs ( ) . with_status ( 0 )
48
- . with_stderr ( & format ! ( "\
49
- [COMPILING] foo v0.0.1 ({dir})
50
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
51
- [RUNNING] `target[/]debug[/]foo[EXE]`" , dir = path2url( p. root( ) ) ) )
52
- . with_stdout ( "\
53
- hello
54
- " ) ) ;
55
- assert_that ( & p. bin ( "foo" ) , existing_file ( ) ) ;
56
- }
57
-
58
31
#[ test]
59
32
fn simple_quiet ( ) {
60
33
let p = project ( "foo" )
@@ -215,25 +188,6 @@ fn no_main_file() {
215
188
for `cargo run`\n ") ) ;
216
189
}
217
190
218
- #[ test]
219
- #[ ignore]
220
- fn no_main_file_implicit ( ) {
221
- let p = project ( "foo" )
222
- . file ( "Cargo.toml" , r#"
223
- [project]
224
- name = "foo"
225
- version = "0.0.1"
226
- authors = []
227
- "# )
228
- . file ( "src/lib.rs" , "" )
229
- . build ( ) ;
230
-
231
- assert_that ( p. cargo ( "run" ) . arg ( "--bins" ) ,
232
- execs ( ) . with_status ( 101 )
233
- . with_stderr ( "[ERROR] a bin target must be available \
234
- for `cargo run`\n ") ) ;
235
- }
236
-
237
191
#[ test]
238
192
fn too_many_bins ( ) {
239
193
let p = project ( "foo" )
@@ -255,28 +209,6 @@ fn too_many_bins() {
255
209
to specify which one to run\n available binaries: [..]\n ") ) ;
256
210
}
257
211
258
- #[ test]
259
- #[ ignore]
260
- fn too_many_bins_implicit ( ) {
261
- let p = project ( "foo" )
262
- . file ( "Cargo.toml" , r#"
263
- [project]
264
- name = "foo"
265
- version = "0.0.1"
266
- authors = []
267
- "# )
268
- . file ( "src/lib.rs" , "" )
269
- . file ( "src/bin/a.rs" , "" )
270
- . file ( "src/bin/b.rs" , "" )
271
- . build ( ) ;
272
-
273
- assert_that ( p. cargo ( "run" ) . arg ( "--bins" ) ,
274
- execs ( ) . with_status ( 101 )
275
- . with_stderr ( "[ERROR] `cargo run` requires that a project only \
276
- have one executable; use the `--bin` option \
277
- to specify which one to run\n available binaries: [..]\n ") ) ;
278
- }
279
-
280
212
#[ test]
281
213
fn specify_name ( ) {
282
214
let p = project ( "foo" )
@@ -353,8 +285,7 @@ example
353
285
}
354
286
355
287
#[ test]
356
- #[ ignore]
357
- fn run_bin_implicit ( ) {
288
+ fn run_bins ( ) {
358
289
let p = project ( "foo" )
359
290
. file ( "Cargo.toml" , r#"
360
291
[project]
@@ -372,44 +303,9 @@ fn run_bin_implicit() {
372
303
. build ( ) ;
373
304
374
305
assert_that ( p. cargo ( "run" ) . arg ( "--bins" ) ,
375
- execs ( ) . with_status ( 0 )
376
- . with_stderr ( & format ! ( "\
377
- [COMPILING] foo v0.0.1 ({dir})
378
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
379
- [RUNNING] `target[/]debug[/]examples[/]a[EXE]`" , dir = path2url( p. root( ) ) ) )
380
- . with_stdout ( "\
381
- bin
382
- " ) ) ;
383
- }
384
-
385
- #[ test]
386
- #[ ignore]
387
- fn run_example_implicit ( ) {
388
- let p = project ( "foo" )
389
- . file ( "Cargo.toml" , r#"
390
- [project]
391
- name = "foo"
392
- version = "0.0.1"
393
- authors = []
394
- "# )
395
- . file ( "src/lib.rs" , "" )
396
- . file ( "examples/a.rs" , r#"
397
- fn main() { println!("example"); }
398
- "# )
399
- . file ( "src/bin/a.rs" , r#"
400
- fn main() { println!("bin"); }
401
- "# )
402
- . build ( ) ;
403
-
404
- assert_that ( p. cargo ( "run" ) . arg ( "--examples" ) ,
405
- execs ( ) . with_status ( 0 )
406
- . with_stderr ( & format ! ( "\
407
- [COMPILING] foo v0.0.1 ({dir})
408
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
409
- [RUNNING] `target[/]debug[/]examples[/]a[EXE]`" , dir = path2url( p. root( ) ) ) )
410
- . with_stdout ( "\
411
- example
412
- " ) ) ;
306
+ execs ( ) . with_status ( 1 )
307
+ . with_stderr_contains ( "\
308
+ [ERROR] Unknown flag: '--bins'. Did you mean '--bin'?") ) ;
413
309
}
414
310
415
311
#[ test]
0 commit comments