@@ -2522,8 +2522,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly.
2522
2522
2523
2523
#[ cargo_test]
2524
2524
fn with_duplicate_spec_in_members ( ) {
2525
- // Use local registry for faster test times since no publish will occur
2526
- let registry = registry:: init ( ) ;
2525
+ let registry = RegistryBuilder :: new ( ) . http_api ( ) . http_index ( ) . build ( ) ;
2527
2526
2528
2527
let p = project ( )
2529
2528
. file (
@@ -2630,8 +2629,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly.
2630
2629
2631
2630
#[ cargo_test]
2632
2631
fn in_virtual_workspace ( ) {
2633
- // Use local registry for faster test times since no publish will occur
2634
- let registry = registry:: init ( ) ;
2632
+ let registry = RegistryBuilder :: new ( ) . http_api ( ) . http_index ( ) . build ( ) ;
2635
2633
2636
2634
let p = project ( )
2637
2635
. file (
@@ -2668,8 +2666,7 @@ fn in_virtual_workspace() {
2668
2666
2669
2667
#[ cargo_test]
2670
2668
fn in_virtual_workspace_with_p ( ) {
2671
- // `publish` generally requires a remote registry
2672
- let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
2669
+ let registry = RegistryBuilder :: new ( ) . http_api ( ) . http_index ( ) . build ( ) ;
2673
2670
2674
2671
let p = project ( )
2675
2672
. file (
@@ -2771,8 +2768,7 @@ fn in_package_workspace_not_found() {
2771
2768
2772
2769
#[ cargo_test]
2773
2770
fn in_package_workspace_found_multiple ( ) {
2774
- // Use local registry for faster test times since no publish will occur
2775
- let registry = registry:: init ( ) ;
2771
+ let registry = RegistryBuilder :: new ( ) . http_api ( ) . http_index ( ) . build ( ) ;
2776
2772
2777
2773
let p = project ( )
2778
2774
. file (
@@ -2828,8 +2824,7 @@ fn in_package_workspace_found_multiple() {
2828
2824
#[ cargo_test]
2829
2825
// https://github.com/rust-lang/cargo/issues/10536
2830
2826
fn publish_path_dependency_without_workspace ( ) {
2831
- // Use local registry for faster test times since no publish will occur
2832
- let registry = registry:: init ( ) ;
2827
+ let registry = RegistryBuilder :: new ( ) . http_api ( ) . http_index ( ) . build ( ) ;
2833
2828
2834
2829
let p = project ( )
2835
2830
. file (
@@ -3403,7 +3398,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly.
3403
3398
}
3404
3399
3405
3400
#[ cargo_test]
3406
- fn package_selection ( ) {
3401
+ fn package_selection_nightly ( ) {
3407
3402
let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
3408
3403
let p = project ( )
3409
3404
. file (
@@ -3478,26 +3473,44 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
3478
3473
"# ] ] )
3479
3474
. with_stdout_data ( str![ [ r#""# ] ] )
3480
3475
. run ( ) ;
3476
+ }
3481
3477
3482
- p. cargo ( "publish --no-verify --dry-run --package a --package b" )
3478
+ #[ cargo_test]
3479
+ fn package_selection ( ) {
3480
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
3481
+ let p = project ( )
3482
+ . file (
3483
+ "Cargo.toml" ,
3484
+ r#"
3485
+ [workspace]
3486
+ members = ["a", "b"]
3487
+ "# ,
3488
+ )
3489
+ . file ( "a/Cargo.toml" , & basic_manifest ( "a" , "0.1.0" ) )
3490
+ . file ( "a/src/lib.rs" , "#[test] fn a() {}" )
3491
+ . file ( "b/Cargo.toml" , & basic_manifest ( "b" , "0.1.0" ) )
3492
+ . file ( "b/src/lib.rs" , "#[test] fn b() {}" )
3493
+ . build ( ) ;
3494
+
3495
+ p. cargo ( "publish --no-verify --dry-run --workspace" )
3483
3496
. replace_crates_io ( registry. index_url ( ) )
3484
3497
. with_status ( 101 )
3485
3498
. with_stderr_data ( str![ [ r#"
3486
- [ERROR] the `--package (multiple occurrences) ` flag is unstable, and only available on the nightly channel of Cargo, but this is the `stable` channel
3499
+ [ERROR] the `--workspace ` flag is unstable, and only available on the nightly channel of Cargo, but this is the `stable` channel
3487
3500
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
3488
- See https://github.com/rust-lang/cargo/issues/10948 for more information about the `--package (multiple occurrences) ` flag.
3501
+ See https://github.com/rust-lang/cargo/issues/10948 for more information about the `--workspace ` flag.
3489
3502
3490
3503
"# ] ] )
3491
3504
. with_stdout_data ( str![ [ r#""# ] ] )
3492
3505
. run ( ) ;
3493
3506
3494
- p. cargo ( "publish --no-verify --dry-run --workspace " )
3507
+ p. cargo ( "publish --no-verify --dry-run --package a --package b " )
3495
3508
. replace_crates_io ( registry. index_url ( ) )
3496
3509
. with_status ( 101 )
3497
3510
. with_stderr_data ( str![ [ r#"
3498
- [ERROR] the `--workspace ` flag is unstable, and only available on the nightly channel of Cargo, but this is the `stable` channel
3511
+ [ERROR] the `--package (multiple occurrences) ` flag is unstable, and only available on the nightly channel of Cargo, but this is the `stable` channel
3499
3512
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
3500
- See https://github.com/rust-lang/cargo/issues/10948 for more information about the `--workspace ` flag.
3513
+ See https://github.com/rust-lang/cargo/issues/10948 for more information about the `--package (multiple occurrences) ` flag.
3501
3514
3502
3515
"# ] ] )
3503
3516
. with_stdout_data ( str![ [ r#""# ] ] )
0 commit comments