@@ -325,7 +325,7 @@ mod tests {
325
325
#[ test]
326
326
fn build_command ( ) {
327
327
insta:: assert_compact_debug_snapshot!( get_build_commands( "@rust-timer build 5832462aa1d9373b24ace96ad2c50b7a18af9952" ) ,
328
- @r### "[Ok(BuildCommand { sha: "5832462aa1d9373b24ace96ad2c50b7a18af9952", params: BenchmarkParameters { include: None, exclude: None, runs: None } })]"## # ) ;
328
+ @r#"[Ok(BuildCommand { sha: "5832462aa1d9373b24ace96ad2c50b7a18af9952", params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: None } })]"# ) ;
329
329
}
330
330
331
331
#[ test]
@@ -334,7 +334,7 @@ mod tests {
334
334
@rust-timer build 5832462aa1d9373b24ace96ad2c50b7a18af9952
335
335
@rust-timer build 23936af287657fa4148aeab40cc2a780810fae52
336
336
"# ) ,
337
- @r### "[Ok(BuildCommand { sha: "5832462aa1d9373b24ace96ad2c50b7a18af9952", params: BenchmarkParameters { include: None, exclude: None, runs: None } }), Ok(BuildCommand { sha: "23936af287657fa4148aeab40cc2a780810fae52", params: BenchmarkParameters { include: None, exclude: None, runs: None } })]"## # ) ;
337
+ @r#"[Ok(BuildCommand { sha: "5832462aa1d9373b24ace96ad2c50b7a18af9952", params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: None } }), Ok(BuildCommand { sha: "23936af287657fa4148aeab40cc2a780810fae52", params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: None } })]"# ) ;
338
338
}
339
339
340
340
#[ test]
@@ -346,14 +346,14 @@ mod tests {
346
346
#[ test]
347
347
fn build_command_complex ( ) {
348
348
insta:: assert_compact_debug_snapshot!( get_build_commands( " @rust-timer build sha123456 exclude=baz include=foo,bar runs=4" ) ,
349
- @r### "[Ok(BuildCommand { sha: "sha123456", params: BenchmarkParameters { include: Some("foo,bar"), exclude: Some("baz"), runs: Some(4) } })]"## # ) ;
349
+ @r#"[Ok(BuildCommand { sha: "sha123456", params: BenchmarkParameters { include: Some("foo,bar"), exclude: Some("baz"), runs: Some(4), backends: None } })]"# ) ;
350
350
}
351
351
352
352
#[ test]
353
353
fn build_command_link ( ) {
354
354
insta:: assert_compact_debug_snapshot!( get_build_commands( r#"
355
355
@rust-timer build https://github.com/rust-lang/rust/commit/323f521bc6d8f2b966ba7838a3f3ee364e760b7e"# ) ,
356
- @r### "[Ok(BuildCommand { sha: "323f521bc6d8f2b966ba7838a3f3ee364e760b7e", params: BenchmarkParameters { include: None, exclude: None, runs: None } })]"## # ) ;
356
+ @r#"[Ok(BuildCommand { sha: "323f521bc6d8f2b966ba7838a3f3ee364e760b7e", params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: None } })]"# ) ;
357
357
}
358
358
359
359
#[ test]
@@ -369,7 +369,7 @@ mod tests {
369
369
#[ test]
370
370
fn queue_command ( ) {
371
371
insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue" ) ,
372
- @"Some(Ok(QueueCommand { params: BenchmarkParameters { include: None, exclude: None, runs: None } }))" ) ;
372
+ @"Some(Ok(QueueCommand { params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: None } }))" ) ;
373
373
}
374
374
375
375
#[ test]
@@ -387,19 +387,19 @@ mod tests {
387
387
#[ test]
388
388
fn queue_command_include ( ) {
389
389
insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue include=abcd,feih" ) ,
390
- @r### "Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("abcd,feih"), exclude: None, runs: None } }))"## # ) ;
390
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("abcd,feih"), exclude: None, runs: None, backends: None } }))"# ) ;
391
391
}
392
392
393
393
#[ test]
394
394
fn queue_command_exclude ( ) {
395
395
insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue exclude=foo134,barzbaz41baf" ) ,
396
- @r### "Some(Ok(QueueCommand { params: BenchmarkParameters { include: None, exclude: Some("foo134,barzbaz41baf"), runs: None } }))"## # ) ;
396
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: None, exclude: Some("foo134,barzbaz41baf"), runs: None, backends: None } }))"# ) ;
397
397
}
398
398
399
399
#[ test]
400
400
fn queue_command_runs ( ) {
401
401
insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue runs=5" ) ,
402
- @"Some(Ok(QueueCommand { params: BenchmarkParameters { include: None, exclude: None, runs: Some(5) } }))" ) ;
402
+ @"Some(Ok(QueueCommand { params: BenchmarkParameters { include: None, exclude: None, runs: Some(5), backends: None } }))" ) ;
403
403
}
404
404
405
405
#[ test]
@@ -411,7 +411,7 @@ mod tests {
411
411
#[ test]
412
412
fn queue_command_combination ( ) {
413
413
insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue include=acda,13asd exclude=c13,DA runs=5" ) ,
414
- @r### "Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("acda,13asd"), exclude: Some("c13,DA"), runs: Some(5) } }))"## # ) ;
414
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("acda,13asd"), exclude: Some("c13,DA"), runs: Some(5), backends: None } }))"# ) ;
415
415
}
416
416
417
417
#[ test]
@@ -423,19 +423,19 @@ mod tests {
423
423
#[ test]
424
424
fn queue_command_spaces ( ) {
425
425
insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue include=abcd,das " ) ,
426
- @r### "Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("abcd,das"), exclude: None, runs: None } }))"## # ) ;
426
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("abcd,das"), exclude: None, runs: None, backends: None } }))"# ) ;
427
427
}
428
428
429
429
#[ test]
430
430
fn queue_command_with_bors ( ) {
431
431
insta:: assert_compact_debug_snapshot!( parse_queue_command( "@bors try @rust-timer queue include=foo,bar" ) ,
432
- @r### "Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("foo,bar"), exclude: None, runs: None } }))"## # ) ;
432
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("foo,bar"), exclude: None, runs: None, backends: None } }))"# ) ;
433
433
}
434
434
435
435
#[ test]
436
436
fn queue_command_parameter_order ( ) {
437
437
insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue runs=3 exclude=c,a include=b" ) ,
438
- @r### "Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("b"), exclude: Some("c,a"), runs: Some(3) } }))"## # ) ;
438
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("b"), exclude: Some("c,a"), runs: Some(3), backends: None } }))"# ) ;
439
439
}
440
440
441
441
#[ test]
@@ -446,10 +446,42 @@ Let's do a perf run quickly and then we can merge it.
446
446
@bors try @rust-timer queue include=foo,bar
447
447
448
448
Otherwise LGTM."# ) ,
449
- @r### "Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("foo,bar"), exclude: None, runs: None } }))"## # ) ;
449
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("foo,bar"), exclude: None, runs: None, backends: None } }))"# ) ;
450
450
}
451
451
452
452
fn get_build_commands ( body : & str ) -> Vec < Result < BuildCommand , String > > {
453
453
parse_build_commands ( body) . collect ( )
454
454
}
455
+
456
+ #[ test]
457
+ fn build_command_with_backends ( ) {
458
+ insta:: assert_compact_debug_snapshot!( get_build_commands( r#"@rust-timer build 5832462aa1d9373b24ace96ad2c50b7a18af995G"# ) ,
459
+ @r#"[Ok(BuildCommand { sha: "5832462aa1d9373b24ace96ad2c50b7a18af995G", params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: None } })]"# ) ;
460
+ insta:: assert_compact_debug_snapshot!( get_build_commands( r#"@rust-timer build 5832462aa1d9373b24ace96ad2c50b7a18af995A backends=Llvm"# ) ,
461
+ @r#"[Ok(BuildCommand { sha: "5832462aa1d9373b24ace96ad2c50b7a18af995A", params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: Some("Llvm") } })]"# ) ;
462
+ insta:: assert_compact_debug_snapshot!( get_build_commands( r#"@rust-timer build 23936af287657fa4148aeab40cc2a780810fae5B backends=Cranelift"# ) ,
463
+ @r#"[Ok(BuildCommand { sha: "23936af287657fa4148aeab40cc2a780810fae5B", params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: Some("Cranelift") } })]"# ) ;
464
+ insta:: assert_compact_debug_snapshot!( get_build_commands( r#"@rust-timer build 23936af287657fa4148aeab40cc2a780810fae5C backends=Cranelift,Llvm"# ) ,
465
+ @r#"[Ok(BuildCommand { sha: "23936af287657fa4148aeab40cc2a780810fae5C", params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: Some("Cranelift,Llvm") } })]"# ) ;
466
+ insta:: assert_compact_debug_snapshot!( get_build_commands( r#"@rust-timer build 5832462aa1d9373b24ace96ad2c50b7a18af995D include=hello backends=Llvm"# ) ,
467
+ @r#"[Ok(BuildCommand { sha: "5832462aa1d9373b24ace96ad2c50b7a18af995D", params: BenchmarkParameters { include: Some("hello"), exclude: None, runs: None, backends: Some("Llvm") } })]"# ) ;
468
+ insta:: assert_compact_debug_snapshot!( get_build_commands( r#"@rust-timer build 5832462aa1d9373b24ace96ad2c50b7a18af995E runs=10 backends=Llvm"# ) ,
469
+ @r#"[Ok(BuildCommand { sha: "5832462aa1d9373b24ace96ad2c50b7a18af995E", params: BenchmarkParameters { include: None, exclude: None, runs: Some(10), backends: Some("Llvm") } })]"# ) ;
470
+ }
471
+
472
+ #[ test]
473
+ fn queue_command_with_backends ( ) {
474
+ insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue backends=Llvm" ) ,
475
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: Some("Llvm") } }))"# ) ;
476
+ insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue backends=Cranelift" ) ,
477
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: Some("Cranelift") } }))"# ) ;
478
+ insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue backends=Cranelift,Llvm" ) ,
479
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: Some("Cranelift,Llvm") } }))"# ) ;
480
+ insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue" ) ,
481
+ @"Some(Ok(QueueCommand { params: BenchmarkParameters { include: None, exclude: None, runs: None, backends: None } }))" ) ;
482
+ insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue include=hello backends=Llvm" ) ,
483
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("hello"), exclude: None, runs: None, backends: Some("Llvm") } }))"# ) ;
484
+ insta:: assert_compact_debug_snapshot!( parse_queue_command( "@rust-timer queue include=hello exclude=ripgrep runs=3 backends=Llvm" ) ,
485
+ @r#"Some(Ok(QueueCommand { params: BenchmarkParameters { include: Some("hello"), exclude: Some("ripgrep"), runs: Some(3), backends: Some("Llvm") } }))"# ) ;
486
+ }
455
487
}
0 commit comments