From 73e207ab9faf16b0988cd4252466193e12b3dd37 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 27 Jul 2022 11:11:41 -0500 Subject: [PATCH 1/2] test(upgrade): Switch to cargo-test-support' --- Cargo.lock | 158 +++++++++++++++- Cargo.toml | 4 + src/bin/upgrade/upgrade.rs | 4 +- tests/cargo-upgrade.rs | 4 - .../cargo-upgrade/alt_registry/in/Cargo.toml | 13 ++ .../cargo-upgrade/alt_registry/in/src/lib.rs | 0 tests/cargo-upgrade/alt_registry/mod.rs | 24 +++ .../cargo-upgrade/alt_registry/out/Cargo.toml | 13 ++ .../cargo-upgrade/alt_registry/out/src/lib.rs | 0 tests/cargo-upgrade/alt_registry/stderr.log | 5 + tests/cargo-upgrade/alt_registry/stdout.log | 0 tests/cargo-upgrade/dry_run/in/Cargo.toml | 6 + tests/cargo-upgrade/dry_run/in/src/lib.rs | 0 tests/cargo-upgrade/dry_run/mod.rs | 25 +++ tests/cargo-upgrade/dry_run/out/Cargo.toml | 6 + tests/cargo-upgrade/dry_run/out/src/lib.rs | 0 tests/cargo-upgrade/dry_run/stderr.log | 4 + tests/cargo-upgrade/dry_run/stdout.log | 0 tests/cargo-upgrade/exclude_dep/in/Cargo.toml | 48 +++++ tests/cargo-upgrade/exclude_dep/in/src/lib.rs | 0 tests/cargo-upgrade/exclude_dep/mod.rs | 25 +++ .../cargo-upgrade/exclude_dep/out/Cargo.toml | 48 +++++ tests/cargo-upgrade/exclude_dep/stderr.log | 18 ++ tests/cargo-upgrade/exclude_dep/stdout.log | 0 .../exclude_renamed/in/Cargo.toml | 13 ++ .../exclude_renamed/in/src/lib.rs | 0 tests/cargo-upgrade/exclude_renamed/mod.rs | 25 +++ .../exclude_renamed/out/Cargo.toml | 13 ++ .../exclude_renamed/out/src/lib.rs | 0 .../cargo-upgrade/exclude_renamed/stderr.log | 5 + .../cargo-upgrade/exclude_renamed/stdout.log | 0 .../implicit_prerelease/in/Cargo.toml | 7 + .../implicit_prerelease/in/src/lib.rs | 0 .../cargo-upgrade/implicit_prerelease/mod.rs | 24 +++ .../implicit_prerelease/out/Cargo.toml | 7 + .../implicit_prerelease/out/src/lib.rs | 0 .../implicit_prerelease/stderr.log | 4 + .../implicit_prerelease/stdout.log | 0 tests/cargo-upgrade/invalid_dep/in/Cargo.toml | 3 + tests/cargo-upgrade/invalid_dep/in/src/lib.rs | 0 tests/cargo-upgrade/invalid_dep/mod.rs | 25 +++ .../cargo-upgrade/invalid_dep/out/Cargo.toml | 3 + .../cargo-upgrade/invalid_dep/out/src/lib.rs | 0 tests/cargo-upgrade/invalid_dep/stderr.log | 3 + tests/cargo-upgrade/invalid_dep/stdout.log | 0 .../cargo-upgrade/invalid_flag/in/Cargo.toml | 3 + .../cargo-upgrade/invalid_flag/in/src/lib.rs | 0 tests/cargo-upgrade/invalid_flag/mod.rs | 25 +++ .../cargo-upgrade/invalid_flag/out/Cargo.toml | 3 + .../cargo-upgrade/invalid_flag/out/src/lib.rs | 0 tests/cargo-upgrade/invalid_flag/stderr.log | 8 + tests/cargo-upgrade/invalid_flag/stdout.log | 0 .../invalid_manifest/in/Cargo.toml | 1 + .../invalid_manifest/in/src/lib.rs | 0 tests/cargo-upgrade/invalid_manifest/mod.rs | 24 +++ .../invalid_manifest/out/Cargo.toml | 1 + .../invalid_manifest/out/src/lib.rs | 0 .../cargo-upgrade/invalid_manifest/stderr.log | 16 ++ .../cargo-upgrade/invalid_manifest/stdout.log | 0 .../in/Cargo.toml | 1 + .../in/src/lib.rs | 0 .../invalid_workspace_root_manifest/mod.rs | 25 +++ .../out/Cargo.toml | 1 + .../out/src/lib.rs | 0 .../stderr.log | 11 ++ .../stdout.log | 0 tests/cargo-upgrade/locked/in/Cargo.toml | 6 + tests/cargo-upgrade/locked/in/src/lib.rs | 0 tests/cargo-upgrade/locked/mod.rs | 25 +++ tests/cargo-upgrade/locked/out/Cargo.toml | 6 + tests/cargo-upgrade/locked/out/src/lib.rs | 0 tests/cargo-upgrade/locked/stderr.log | 4 + tests/cargo-upgrade/locked/stdout.log | 0 tests/cargo-upgrade/main.rs | 173 ++++++++++++++++++ .../cargo-upgrade/optional_dep/in/Cargo.toml | 6 + .../cargo-upgrade/optional_dep/in/src/lib.rs | 0 tests/cargo-upgrade/optional_dep/mod.rs | 24 +++ .../cargo-upgrade/optional_dep/out/Cargo.toml | 6 + .../cargo-upgrade/optional_dep/out/src/lib.rs | 0 tests/cargo-upgrade/optional_dep/stderr.log | 3 + tests/cargo-upgrade/optional_dep/stdout.log | 0 tests/cargo-upgrade/pinned/in/Cargo.toml | 14 ++ tests/cargo-upgrade/pinned/in/src/lib.rs | 0 tests/cargo-upgrade/pinned/mod.rs | 25 +++ tests/cargo-upgrade/pinned/out/Cargo.toml | 14 ++ tests/cargo-upgrade/pinned/out/src/lib.rs | 0 tests/cargo-upgrade/pinned/stderr.log | 13 ++ tests/cargo-upgrade/pinned/stdout.log | 0 .../preserve_precision_major/in/Cargo.toml | 6 + .../preserve_precision_major/in/src/lib.rs | 0 .../preserve_precision_major/mod.rs | 25 +++ .../preserve_precision_major/out/Cargo.toml | 6 + .../preserve_precision_major/out/src/lib.rs | 0 .../preserve_precision_major/stderr.log | 3 + .../preserve_precision_major/stdout.log | 0 .../preserve_precision_minor/in/Cargo.toml | 6 + .../preserve_precision_minor/in/src/lib.rs | 0 .../preserve_precision_minor/mod.rs | 25 +++ .../preserve_precision_minor/out/Cargo.toml | 6 + .../preserve_precision_minor/out/src/lib.rs | 0 .../preserve_precision_minor/stderr.log | 3 + .../preserve_precision_minor/stdout.log | 0 .../preserve_precision_patch/in/Cargo.toml | 6 + .../preserve_precision_patch/in/src/lib.rs | 0 .../preserve_precision_patch/mod.rs | 25 +++ .../preserve_precision_patch/out/Cargo.toml | 6 + .../preserve_precision_patch/out/src/lib.rs | 0 .../preserve_precision_patch/stderr.log | 3 + .../preserve_precision_patch/stdout.log | 0 .../preserves_inline_table/in/Cargo.toml | 6 + .../preserves_inline_table/in/src/lib.rs | 0 .../preserves_inline_table/mod.rs | 24 +++ .../preserves_inline_table/out/Cargo.toml | 6 + .../preserves_inline_table/out/src/lib.rs | 0 .../preserves_inline_table/stderr.log | 3 + .../preserves_inline_table/stdout.log | 0 .../preserves_std_table/in/Cargo.toml | 6 + .../preserves_std_table/in/src/lib.rs | 0 .../cargo-upgrade/preserves_std_table/mod.rs | 24 +++ .../preserves_std_table/out/Cargo.toml | 6 + .../preserves_std_table/out/src/lib.rs | 0 .../preserves_std_table/stderr.log | 3 + .../preserves_std_table/stdout.log | 0 tests/cargo-upgrade/single_dep/in/Cargo.toml | 6 + tests/cargo-upgrade/single_dep/in/src/lib.rs | 0 tests/cargo-upgrade/single_dep/mod.rs | 24 +++ tests/cargo-upgrade/single_dep/out/Cargo.toml | 6 + tests/cargo-upgrade/single_dep/out/src/lib.rs | 0 tests/cargo-upgrade/single_dep/stderr.log | 3 + tests/cargo-upgrade/single_dep/stdout.log | 0 .../skip_compatible/in/Cargo.toml | 7 + .../skip_compatible/in/src/lib.rs | 0 tests/cargo-upgrade/skip_compatible/mod.rs | 25 +++ .../skip_compatible/out/Cargo.toml | 7 + .../skip_compatible/out/src/lib.rs | 0 .../cargo-upgrade/skip_compatible/stderr.log | 5 + .../cargo-upgrade/skip_compatible/stdout.log | 0 tests/cargo-upgrade/specified/in/Cargo.toml | 7 + tests/cargo-upgrade/specified/in/src/lib.rs | 0 tests/cargo-upgrade/specified/mod.rs | 25 +++ tests/cargo-upgrade/specified/out/Cargo.toml | 7 + tests/cargo-upgrade/specified/out/src/lib.rs | 0 tests/cargo-upgrade/specified/stderr.log | 3 + tests/cargo-upgrade/specified/stdout.log | 0 tests/cargo-upgrade/to_lockfile/in/Cargo.lock | 38 ++++ tests/cargo-upgrade/to_lockfile/in/Cargo.toml | 6 + tests/cargo-upgrade/to_lockfile/in/dummy.rs | 0 .../to_lockfile/in/explicit/four/Cargo.toml | 9 + .../to_lockfile/in/implicit/three/Cargo.toml | 9 + .../to_lockfile/in/one/Cargo.toml | 10 + .../to_lockfile/in/two/Cargo.toml | 10 + tests/cargo-upgrade/to_lockfile/mod.rs | 25 +++ .../cargo-upgrade/to_lockfile/out/Cargo.lock | 38 ++++ .../cargo-upgrade/to_lockfile/out/Cargo.toml | 6 + tests/cargo-upgrade/to_lockfile/out/dummy.rs | 0 .../to_lockfile/out/explicit/four/Cargo.toml | 9 + .../to_lockfile/out/implicit/three/Cargo.toml | 9 + .../to_lockfile/out/one/Cargo.toml | 10 + .../to_lockfile/out/two/Cargo.toml | 10 + tests/cargo-upgrade/to_lockfile/stderr.log | 9 + tests/cargo-upgrade/to_lockfile/stdout.log | 0 tests/cargo-upgrade/to_version/in/Cargo.toml | 6 + tests/cargo-upgrade/to_version/in/src/lib.rs | 0 tests/cargo-upgrade/to_version/mod.rs | 25 +++ tests/cargo-upgrade/to_version/out/Cargo.toml | 6 + tests/cargo-upgrade/to_version/out/src/lib.rs | 0 tests/cargo-upgrade/to_version/stderr.log | 3 + tests/cargo-upgrade/to_version/stdout.log | 0 tests/cargo-upgrade/upgrade_all/in/Cargo.lock | 137 ++++++++++++++ tests/cargo-upgrade/upgrade_all/in/Cargo.toml | 6 + tests/cargo-upgrade/upgrade_all/in/dummy.rs | 0 .../upgrade_all/in/explicit/four/Cargo.toml | 9 + .../upgrade_all/in/implicit/three/Cargo.toml | 9 + .../upgrade_all/in/one/Cargo.toml | 10 + .../upgrade_all/in/two/Cargo.toml | 10 + tests/cargo-upgrade/upgrade_all/mod.rs | 25 +++ .../cargo-upgrade/upgrade_all/out/Cargo.lock | 137 ++++++++++++++ .../cargo-upgrade/upgrade_all/out/Cargo.toml | 6 + tests/cargo-upgrade/upgrade_all/out/dummy.rs | 0 .../upgrade_all/out/explicit/four/Cargo.toml | 9 + .../upgrade_all/out/implicit/three/Cargo.toml | 9 + .../upgrade_all/out/one/Cargo.toml | 10 + .../upgrade_all/out/two/Cargo.toml | 10 + tests/cargo-upgrade/upgrade_all/stderr.log | 10 + tests/cargo-upgrade/upgrade_all/stdout.log | 0 .../upgrade_everything/in/Cargo.toml | 48 +++++ .../upgrade_everything/in/src/lib.rs | 0 tests/cargo-upgrade/upgrade_everything/mod.rs | 25 +++ .../upgrade_everything/out/Cargo.toml | 48 +++++ .../upgrade_everything/stderr.log | 17 ++ .../upgrade_everything/stdout.log | 0 .../upgrade_renamed/in/Cargo.toml | 13 ++ .../upgrade_renamed/in/src/lib.rs | 0 tests/cargo-upgrade/upgrade_renamed/mod.rs | 25 +++ .../upgrade_renamed/out/Cargo.toml | 13 ++ .../upgrade_renamed/out/src/lib.rs | 0 .../cargo-upgrade/upgrade_renamed/stderr.log | 4 + .../cargo-upgrade/upgrade_renamed/stdout.log | 0 .../upgrade_workspace/in/Cargo.lock | 137 ++++++++++++++ .../upgrade_workspace/in/Cargo.toml | 6 + .../upgrade_workspace/in/dummy.rs | 0 .../in/explicit/four/Cargo.toml | 9 + .../in/implicit/three/Cargo.toml | 9 + .../upgrade_workspace/in/one/Cargo.toml | 10 + .../upgrade_workspace/in/two/Cargo.toml | 10 + tests/cargo-upgrade/upgrade_workspace/mod.rs | 25 +++ .../upgrade_workspace/out/Cargo.lock | 137 ++++++++++++++ .../upgrade_workspace/out/Cargo.toml | 6 + .../upgrade_workspace/out/dummy.rs | 0 .../out/explicit/four/Cargo.toml | 9 + .../out/implicit/three/Cargo.toml | 9 + .../upgrade_workspace/out/one/Cargo.toml | 10 + .../upgrade_workspace/out/two/Cargo.toml | 10 + .../upgrade_workspace/stderr.log | 9 + .../upgrade_workspace/stdout.log | 0 .../virtual_manifest/in/Cargo.lock | 137 ++++++++++++++ .../virtual_manifest/in/Cargo.toml | 6 + .../virtual_manifest/in/dummy.rs | 0 .../in/explicit/four/Cargo.toml | 9 + .../in/implicit/three/Cargo.toml | 9 + .../virtual_manifest/in/one/Cargo.toml | 10 + .../virtual_manifest/in/two/Cargo.toml | 10 + tests/cargo-upgrade/virtual_manifest/mod.rs | 25 +++ .../virtual_manifest/out/Cargo.lock | 137 ++++++++++++++ .../virtual_manifest/out/Cargo.toml | 6 + .../virtual_manifest/out/dummy.rs | 0 .../out/explicit/four/Cargo.toml | 9 + .../out/implicit/three/Cargo.toml | 9 + .../virtual_manifest/out/one/Cargo.toml | 10 + .../virtual_manifest/out/two/Cargo.toml | 10 + .../cargo-upgrade/virtual_manifest/stderr.log | 9 + .../cargo-upgrade/virtual_manifest/stdout.log | 0 .../workspace_member_cwd/in/Cargo.lock | 137 ++++++++++++++ .../workspace_member_cwd/in/Cargo.toml | 6 + .../workspace_member_cwd/in/dummy.rs | 0 .../in/explicit/four/Cargo.toml | 9 + .../in/implicit/three/Cargo.toml | 9 + .../workspace_member_cwd/in/one/Cargo.toml | 10 + .../workspace_member_cwd/in/two/Cargo.toml | 10 + .../cargo-upgrade/workspace_member_cwd/mod.rs | 25 +++ .../workspace_member_cwd/out/Cargo.lock | 137 ++++++++++++++ .../workspace_member_cwd/out/Cargo.toml | 6 + .../workspace_member_cwd/out/dummy.rs | 0 .../out/explicit/four/Cargo.toml | 9 + .../out/implicit/three/Cargo.toml | 9 + .../workspace_member_cwd/out/one/Cargo.toml | 10 + .../workspace_member_cwd/out/two/Cargo.toml | 10 + .../workspace_member_cwd/stderr.log | 3 + .../workspace_member_cwd/stdout.log | 0 .../in/Cargo.lock | 137 ++++++++++++++ .../in/Cargo.toml | 6 + .../in/dummy.rs | 0 .../in/explicit/four/Cargo.toml | 9 + .../in/implicit/three/Cargo.toml | 9 + .../in/one/Cargo.toml | 10 + .../in/two/Cargo.toml | 10 + .../workspace_member_manifest_path/mod.rs | 25 +++ .../out/Cargo.toml | 6 + .../out/dummy.rs | 0 .../out/explicit/four/Cargo.toml | 9 + .../out/implicit/three/Cargo.toml | 9 + .../out/one/Cargo.toml | 10 + .../out/two/Cargo.toml | 10 + .../workspace_member_manifest_path/stderr.log | 3 + .../workspace_member_manifest_path/stdout.log | 0 265 files changed, 3551 insertions(+), 10 deletions(-) delete mode 100644 tests/cargo-upgrade.rs create mode 100644 tests/cargo-upgrade/alt_registry/in/Cargo.toml create mode 100644 tests/cargo-upgrade/alt_registry/in/src/lib.rs create mode 100644 tests/cargo-upgrade/alt_registry/mod.rs create mode 100644 tests/cargo-upgrade/alt_registry/out/Cargo.toml create mode 100644 tests/cargo-upgrade/alt_registry/out/src/lib.rs create mode 100644 tests/cargo-upgrade/alt_registry/stderr.log create mode 100644 tests/cargo-upgrade/alt_registry/stdout.log create mode 100644 tests/cargo-upgrade/dry_run/in/Cargo.toml create mode 100644 tests/cargo-upgrade/dry_run/in/src/lib.rs create mode 100644 tests/cargo-upgrade/dry_run/mod.rs create mode 100644 tests/cargo-upgrade/dry_run/out/Cargo.toml create mode 100644 tests/cargo-upgrade/dry_run/out/src/lib.rs create mode 100644 tests/cargo-upgrade/dry_run/stderr.log create mode 100644 tests/cargo-upgrade/dry_run/stdout.log create mode 100644 tests/cargo-upgrade/exclude_dep/in/Cargo.toml create mode 100644 tests/cargo-upgrade/exclude_dep/in/src/lib.rs create mode 100644 tests/cargo-upgrade/exclude_dep/mod.rs create mode 100644 tests/cargo-upgrade/exclude_dep/out/Cargo.toml create mode 100644 tests/cargo-upgrade/exclude_dep/stderr.log create mode 100644 tests/cargo-upgrade/exclude_dep/stdout.log create mode 100644 tests/cargo-upgrade/exclude_renamed/in/Cargo.toml create mode 100644 tests/cargo-upgrade/exclude_renamed/in/src/lib.rs create mode 100644 tests/cargo-upgrade/exclude_renamed/mod.rs create mode 100644 tests/cargo-upgrade/exclude_renamed/out/Cargo.toml create mode 100644 tests/cargo-upgrade/exclude_renamed/out/src/lib.rs create mode 100644 tests/cargo-upgrade/exclude_renamed/stderr.log create mode 100644 tests/cargo-upgrade/exclude_renamed/stdout.log create mode 100644 tests/cargo-upgrade/implicit_prerelease/in/Cargo.toml create mode 100644 tests/cargo-upgrade/implicit_prerelease/in/src/lib.rs create mode 100644 tests/cargo-upgrade/implicit_prerelease/mod.rs create mode 100644 tests/cargo-upgrade/implicit_prerelease/out/Cargo.toml create mode 100644 tests/cargo-upgrade/implicit_prerelease/out/src/lib.rs create mode 100644 tests/cargo-upgrade/implicit_prerelease/stderr.log create mode 100644 tests/cargo-upgrade/implicit_prerelease/stdout.log create mode 100644 tests/cargo-upgrade/invalid_dep/in/Cargo.toml create mode 100644 tests/cargo-upgrade/invalid_dep/in/src/lib.rs create mode 100644 tests/cargo-upgrade/invalid_dep/mod.rs create mode 100644 tests/cargo-upgrade/invalid_dep/out/Cargo.toml create mode 100644 tests/cargo-upgrade/invalid_dep/out/src/lib.rs create mode 100644 tests/cargo-upgrade/invalid_dep/stderr.log create mode 100644 tests/cargo-upgrade/invalid_dep/stdout.log create mode 100644 tests/cargo-upgrade/invalid_flag/in/Cargo.toml create mode 100644 tests/cargo-upgrade/invalid_flag/in/src/lib.rs create mode 100644 tests/cargo-upgrade/invalid_flag/mod.rs create mode 100644 tests/cargo-upgrade/invalid_flag/out/Cargo.toml create mode 100644 tests/cargo-upgrade/invalid_flag/out/src/lib.rs create mode 100644 tests/cargo-upgrade/invalid_flag/stderr.log create mode 100644 tests/cargo-upgrade/invalid_flag/stdout.log create mode 100644 tests/cargo-upgrade/invalid_manifest/in/Cargo.toml create mode 100644 tests/cargo-upgrade/invalid_manifest/in/src/lib.rs create mode 100644 tests/cargo-upgrade/invalid_manifest/mod.rs create mode 100644 tests/cargo-upgrade/invalid_manifest/out/Cargo.toml create mode 100644 tests/cargo-upgrade/invalid_manifest/out/src/lib.rs create mode 100644 tests/cargo-upgrade/invalid_manifest/stderr.log create mode 100644 tests/cargo-upgrade/invalid_manifest/stdout.log create mode 100644 tests/cargo-upgrade/invalid_workspace_root_manifest/in/Cargo.toml create mode 100644 tests/cargo-upgrade/invalid_workspace_root_manifest/in/src/lib.rs create mode 100644 tests/cargo-upgrade/invalid_workspace_root_manifest/mod.rs create mode 100644 tests/cargo-upgrade/invalid_workspace_root_manifest/out/Cargo.toml create mode 100644 tests/cargo-upgrade/invalid_workspace_root_manifest/out/src/lib.rs create mode 100644 tests/cargo-upgrade/invalid_workspace_root_manifest/stderr.log create mode 100644 tests/cargo-upgrade/invalid_workspace_root_manifest/stdout.log create mode 100644 tests/cargo-upgrade/locked/in/Cargo.toml create mode 100644 tests/cargo-upgrade/locked/in/src/lib.rs create mode 100644 tests/cargo-upgrade/locked/mod.rs create mode 100644 tests/cargo-upgrade/locked/out/Cargo.toml create mode 100644 tests/cargo-upgrade/locked/out/src/lib.rs create mode 100644 tests/cargo-upgrade/locked/stderr.log create mode 100644 tests/cargo-upgrade/locked/stdout.log create mode 100644 tests/cargo-upgrade/main.rs create mode 100644 tests/cargo-upgrade/optional_dep/in/Cargo.toml create mode 100644 tests/cargo-upgrade/optional_dep/in/src/lib.rs create mode 100644 tests/cargo-upgrade/optional_dep/mod.rs create mode 100644 tests/cargo-upgrade/optional_dep/out/Cargo.toml create mode 100644 tests/cargo-upgrade/optional_dep/out/src/lib.rs create mode 100644 tests/cargo-upgrade/optional_dep/stderr.log create mode 100644 tests/cargo-upgrade/optional_dep/stdout.log create mode 100644 tests/cargo-upgrade/pinned/in/Cargo.toml create mode 100644 tests/cargo-upgrade/pinned/in/src/lib.rs create mode 100644 tests/cargo-upgrade/pinned/mod.rs create mode 100644 tests/cargo-upgrade/pinned/out/Cargo.toml create mode 100644 tests/cargo-upgrade/pinned/out/src/lib.rs create mode 100644 tests/cargo-upgrade/pinned/stderr.log create mode 100644 tests/cargo-upgrade/pinned/stdout.log create mode 100644 tests/cargo-upgrade/preserve_precision_major/in/Cargo.toml create mode 100644 tests/cargo-upgrade/preserve_precision_major/in/src/lib.rs create mode 100644 tests/cargo-upgrade/preserve_precision_major/mod.rs create mode 100644 tests/cargo-upgrade/preserve_precision_major/out/Cargo.toml create mode 100644 tests/cargo-upgrade/preserve_precision_major/out/src/lib.rs create mode 100644 tests/cargo-upgrade/preserve_precision_major/stderr.log create mode 100644 tests/cargo-upgrade/preserve_precision_major/stdout.log create mode 100644 tests/cargo-upgrade/preserve_precision_minor/in/Cargo.toml create mode 100644 tests/cargo-upgrade/preserve_precision_minor/in/src/lib.rs create mode 100644 tests/cargo-upgrade/preserve_precision_minor/mod.rs create mode 100644 tests/cargo-upgrade/preserve_precision_minor/out/Cargo.toml create mode 100644 tests/cargo-upgrade/preserve_precision_minor/out/src/lib.rs create mode 100644 tests/cargo-upgrade/preserve_precision_minor/stderr.log create mode 100644 tests/cargo-upgrade/preserve_precision_minor/stdout.log create mode 100644 tests/cargo-upgrade/preserve_precision_patch/in/Cargo.toml create mode 100644 tests/cargo-upgrade/preserve_precision_patch/in/src/lib.rs create mode 100644 tests/cargo-upgrade/preserve_precision_patch/mod.rs create mode 100644 tests/cargo-upgrade/preserve_precision_patch/out/Cargo.toml create mode 100644 tests/cargo-upgrade/preserve_precision_patch/out/src/lib.rs create mode 100644 tests/cargo-upgrade/preserve_precision_patch/stderr.log create mode 100644 tests/cargo-upgrade/preserve_precision_patch/stdout.log create mode 100644 tests/cargo-upgrade/preserves_inline_table/in/Cargo.toml create mode 100644 tests/cargo-upgrade/preserves_inline_table/in/src/lib.rs create mode 100644 tests/cargo-upgrade/preserves_inline_table/mod.rs create mode 100644 tests/cargo-upgrade/preserves_inline_table/out/Cargo.toml create mode 100644 tests/cargo-upgrade/preserves_inline_table/out/src/lib.rs create mode 100644 tests/cargo-upgrade/preserves_inline_table/stderr.log create mode 100644 tests/cargo-upgrade/preserves_inline_table/stdout.log create mode 100644 tests/cargo-upgrade/preserves_std_table/in/Cargo.toml create mode 100644 tests/cargo-upgrade/preserves_std_table/in/src/lib.rs create mode 100644 tests/cargo-upgrade/preserves_std_table/mod.rs create mode 100644 tests/cargo-upgrade/preserves_std_table/out/Cargo.toml create mode 100644 tests/cargo-upgrade/preserves_std_table/out/src/lib.rs create mode 100644 tests/cargo-upgrade/preserves_std_table/stderr.log create mode 100644 tests/cargo-upgrade/preserves_std_table/stdout.log create mode 100644 tests/cargo-upgrade/single_dep/in/Cargo.toml create mode 100644 tests/cargo-upgrade/single_dep/in/src/lib.rs create mode 100644 tests/cargo-upgrade/single_dep/mod.rs create mode 100644 tests/cargo-upgrade/single_dep/out/Cargo.toml create mode 100644 tests/cargo-upgrade/single_dep/out/src/lib.rs create mode 100644 tests/cargo-upgrade/single_dep/stderr.log create mode 100644 tests/cargo-upgrade/single_dep/stdout.log create mode 100644 tests/cargo-upgrade/skip_compatible/in/Cargo.toml create mode 100644 tests/cargo-upgrade/skip_compatible/in/src/lib.rs create mode 100644 tests/cargo-upgrade/skip_compatible/mod.rs create mode 100644 tests/cargo-upgrade/skip_compatible/out/Cargo.toml create mode 100644 tests/cargo-upgrade/skip_compatible/out/src/lib.rs create mode 100644 tests/cargo-upgrade/skip_compatible/stderr.log create mode 100644 tests/cargo-upgrade/skip_compatible/stdout.log create mode 100644 tests/cargo-upgrade/specified/in/Cargo.toml create mode 100644 tests/cargo-upgrade/specified/in/src/lib.rs create mode 100644 tests/cargo-upgrade/specified/mod.rs create mode 100644 tests/cargo-upgrade/specified/out/Cargo.toml create mode 100644 tests/cargo-upgrade/specified/out/src/lib.rs create mode 100644 tests/cargo-upgrade/specified/stderr.log create mode 100644 tests/cargo-upgrade/specified/stdout.log create mode 100644 tests/cargo-upgrade/to_lockfile/in/Cargo.lock create mode 100644 tests/cargo-upgrade/to_lockfile/in/Cargo.toml create mode 100644 tests/cargo-upgrade/to_lockfile/in/dummy.rs create mode 100644 tests/cargo-upgrade/to_lockfile/in/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/to_lockfile/in/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/to_lockfile/in/one/Cargo.toml create mode 100644 tests/cargo-upgrade/to_lockfile/in/two/Cargo.toml create mode 100644 tests/cargo-upgrade/to_lockfile/mod.rs create mode 100644 tests/cargo-upgrade/to_lockfile/out/Cargo.lock create mode 100644 tests/cargo-upgrade/to_lockfile/out/Cargo.toml create mode 100644 tests/cargo-upgrade/to_lockfile/out/dummy.rs create mode 100644 tests/cargo-upgrade/to_lockfile/out/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/to_lockfile/out/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/to_lockfile/out/one/Cargo.toml create mode 100644 tests/cargo-upgrade/to_lockfile/out/two/Cargo.toml create mode 100644 tests/cargo-upgrade/to_lockfile/stderr.log create mode 100644 tests/cargo-upgrade/to_lockfile/stdout.log create mode 100644 tests/cargo-upgrade/to_version/in/Cargo.toml create mode 100644 tests/cargo-upgrade/to_version/in/src/lib.rs create mode 100644 tests/cargo-upgrade/to_version/mod.rs create mode 100644 tests/cargo-upgrade/to_version/out/Cargo.toml create mode 100644 tests/cargo-upgrade/to_version/out/src/lib.rs create mode 100644 tests/cargo-upgrade/to_version/stderr.log create mode 100644 tests/cargo-upgrade/to_version/stdout.log create mode 100644 tests/cargo-upgrade/upgrade_all/in/Cargo.lock create mode 100644 tests/cargo-upgrade/upgrade_all/in/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_all/in/dummy.rs create mode 100644 tests/cargo-upgrade/upgrade_all/in/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_all/in/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_all/in/one/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_all/in/two/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_all/mod.rs create mode 100644 tests/cargo-upgrade/upgrade_all/out/Cargo.lock create mode 100644 tests/cargo-upgrade/upgrade_all/out/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_all/out/dummy.rs create mode 100644 tests/cargo-upgrade/upgrade_all/out/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_all/out/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_all/out/one/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_all/out/two/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_all/stderr.log create mode 100644 tests/cargo-upgrade/upgrade_all/stdout.log create mode 100644 tests/cargo-upgrade/upgrade_everything/in/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_everything/in/src/lib.rs create mode 100644 tests/cargo-upgrade/upgrade_everything/mod.rs create mode 100644 tests/cargo-upgrade/upgrade_everything/out/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_everything/stderr.log create mode 100644 tests/cargo-upgrade/upgrade_everything/stdout.log create mode 100644 tests/cargo-upgrade/upgrade_renamed/in/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_renamed/in/src/lib.rs create mode 100644 tests/cargo-upgrade/upgrade_renamed/mod.rs create mode 100644 tests/cargo-upgrade/upgrade_renamed/out/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_renamed/out/src/lib.rs create mode 100644 tests/cargo-upgrade/upgrade_renamed/stderr.log create mode 100644 tests/cargo-upgrade/upgrade_renamed/stdout.log create mode 100644 tests/cargo-upgrade/upgrade_workspace/in/Cargo.lock create mode 100644 tests/cargo-upgrade/upgrade_workspace/in/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_workspace/in/dummy.rs create mode 100644 tests/cargo-upgrade/upgrade_workspace/in/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_workspace/in/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_workspace/in/one/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_workspace/in/two/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_workspace/mod.rs create mode 100644 tests/cargo-upgrade/upgrade_workspace/out/Cargo.lock create mode 100644 tests/cargo-upgrade/upgrade_workspace/out/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_workspace/out/dummy.rs create mode 100644 tests/cargo-upgrade/upgrade_workspace/out/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_workspace/out/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_workspace/out/one/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_workspace/out/two/Cargo.toml create mode 100644 tests/cargo-upgrade/upgrade_workspace/stderr.log create mode 100644 tests/cargo-upgrade/upgrade_workspace/stdout.log create mode 100644 tests/cargo-upgrade/virtual_manifest/in/Cargo.lock create mode 100644 tests/cargo-upgrade/virtual_manifest/in/Cargo.toml create mode 100644 tests/cargo-upgrade/virtual_manifest/in/dummy.rs create mode 100644 tests/cargo-upgrade/virtual_manifest/in/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/virtual_manifest/in/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/virtual_manifest/in/one/Cargo.toml create mode 100644 tests/cargo-upgrade/virtual_manifest/in/two/Cargo.toml create mode 100644 tests/cargo-upgrade/virtual_manifest/mod.rs create mode 100644 tests/cargo-upgrade/virtual_manifest/out/Cargo.lock create mode 100644 tests/cargo-upgrade/virtual_manifest/out/Cargo.toml create mode 100644 tests/cargo-upgrade/virtual_manifest/out/dummy.rs create mode 100644 tests/cargo-upgrade/virtual_manifest/out/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/virtual_manifest/out/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/virtual_manifest/out/one/Cargo.toml create mode 100644 tests/cargo-upgrade/virtual_manifest/out/two/Cargo.toml create mode 100644 tests/cargo-upgrade/virtual_manifest/stderr.log create mode 100644 tests/cargo-upgrade/virtual_manifest/stdout.log create mode 100644 tests/cargo-upgrade/workspace_member_cwd/in/Cargo.lock create mode 100644 tests/cargo-upgrade/workspace_member_cwd/in/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_cwd/in/dummy.rs create mode 100644 tests/cargo-upgrade/workspace_member_cwd/in/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_cwd/in/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_cwd/in/one/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_cwd/in/two/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_cwd/mod.rs create mode 100644 tests/cargo-upgrade/workspace_member_cwd/out/Cargo.lock create mode 100644 tests/cargo-upgrade/workspace_member_cwd/out/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_cwd/out/dummy.rs create mode 100644 tests/cargo-upgrade/workspace_member_cwd/out/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_cwd/out/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_cwd/out/one/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_cwd/out/two/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_cwd/stderr.log create mode 100644 tests/cargo-upgrade/workspace_member_cwd/stdout.log create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/in/Cargo.lock create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/in/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/in/dummy.rs create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/in/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/in/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/in/one/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/in/two/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/mod.rs create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/out/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/out/dummy.rs create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/out/explicit/four/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/out/implicit/three/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/out/one/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/out/two/Cargo.toml create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/stderr.log create mode 100644 tests/cargo-upgrade/workspace_member_manifest_path/stdout.log diff --git a/Cargo.lock b/Cargo.lock index cdd47653d0..73ebce1748 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,12 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aho-corasick" version = "0.7.18" @@ -123,6 +129,8 @@ dependencies = [ "anyhow", "assert_cmd", "assert_fs", + "cargo-test-macro", + "cargo-test-support", "cargo_metadata", "clap", "concolor-control", @@ -131,7 +139,7 @@ dependencies = [ "dunce", "env_proxy", "git2", - "hex", + "hex 0.4.3", "indexmap", "native-tls", "pathdiff", @@ -141,6 +149,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "snapbox", "subprocess", "termcolor", "toml_edit", @@ -158,6 +167,55 @@ dependencies = [ "serde", ] +[[package]] +name = "cargo-test-macro" +version = "0.1.0" +source = "git+https://github.com/rust-lang/cargo#85b500ccad8cd0b63995fd94a03ddd4b83f7905b" + +[[package]] +name = "cargo-test-support" +version = "0.1.0" +source = "git+https://github.com/rust-lang/cargo#85b500ccad8cd0b63995fd94a03ddd4b83f7905b" +dependencies = [ + "anyhow", + "cargo-test-macro", + "cargo-util", + "filetime", + "flate2", + "git2", + "glob", + "itertools", + "lazy_static", + "remove_dir_all", + "serde_json", + "snapbox", + "tar", + "termcolor", + "toml_edit", + "url", +] + +[[package]] +name = "cargo-util" +version = "0.2.1" +source = "git+https://github.com/rust-lang/cargo#85b500ccad8cd0b63995fd94a03ddd4b83f7905b" +dependencies = [ + "anyhow", + "core-foundation", + "crypto-hash", + "filetime", + "hex 0.4.3", + "jobserver", + "libc", + "log", + "miow", + "same-file", + "shell-escape", + "tempfile", + "walkdir", + "winapi", +] + [[package]] name = "cargo_metadata" version = "0.15.0" @@ -233,6 +291,24 @@ dependencies = [ "memchr", ] +[[package]] +name = "commoncrypto" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007" +dependencies = [ + "commoncrypto-sys", +] + +[[package]] +name = "commoncrypto-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2" +dependencies = [ + "libc", +] + [[package]] name = "concolor" version = "0.0.8" @@ -299,7 +375,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0044896374c388ccbf1497dad6384bf6111dbcad9d7069506df7450ce9b62ea3" dependencies = [ "git2", - "hex", + "hex 0.4.3", "home", "memchr", "num_cpus", @@ -312,6 +388,15 @@ dependencies = [ "smartstring", ] +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-channel" version = "0.5.4" @@ -357,6 +442,18 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "crypto-hash" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a77162240fd97248d19a564a565eb563a3f592b386e4136fb300909e67dddca" +dependencies = [ + "commoncrypto", + "hex 0.3.2", + "openssl", + "winapi", +] + [[package]] name = "difflib" version = "0.4.0" @@ -433,6 +530,19 @@ dependencies = [ "winapi", ] +[[package]] +name = "flate2" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af" +dependencies = [ + "cfg-if", + "crc32fast", + "libc", + "libz-sys", + "miniz_oxide", +] + [[package]] name = "float-cmp" version = "0.9.0" @@ -550,6 +660,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" + [[package]] name = "hex" version = "0.4.3" @@ -756,6 +872,24 @@ dependencies = [ "autocfg", ] +[[package]] +name = "miniz_oxide" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +dependencies = [ + "adler", +] + +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi", +] + [[package]] name = "native-tls" version = "0.2.9" @@ -1173,6 +1307,12 @@ dependencies = [ "serde", ] +[[package]] +name = "shell-escape" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" + [[package]] name = "shlex" version = "1.1.0" @@ -1199,9 +1339,9 @@ dependencies = [ [[package]] name = "snapbox" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1f212b806d6f56d19838e36a0aaa7e79a0bc9ca177e873fb87651ad92f983e2" +checksum = "767a1d5da232b6959cd1bd5c9e8db8a7cce09c3038e89deedb49a549a2aefd93" dependencies = [ "concolor", "content_inspector", @@ -1273,6 +1413,16 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "tar" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +dependencies = [ + "filetime", + "libc", +] + [[package]] name = "tempfile" version = "3.3.0" diff --git a/Cargo.toml b/Cargo.toml index afc0f94a4a..7dc8723d8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,6 +94,10 @@ predicates = { version = "2.0.3", features = ["color-auto"] } assert_cmd = { version = "2.0.2", features = ["color-auto"] } assert_fs = { version = "1.0.6", features = ["color-auto"] } trycmd = "0.13.1" +snapbox = { version = "0.2.10", features = ["cmd", "path"] } +cargo-test-macro.git = "https://github.com/rust-lang/cargo" +cargo-test-support.git = "https://github.com/rust-lang/cargo" +url = "2.2.2" [features] default = [ diff --git a/src/bin/upgrade/upgrade.rs b/src/bin/upgrade/upgrade.rs index 084c90fb7a..cc97cbe88e 100644 --- a/src/bin/upgrade/upgrade.rs +++ b/src/bin/upgrade/upgrade.rs @@ -135,7 +135,7 @@ fn exec(args: UpgradeArgs) -> CargoResult<()> { deprecated_message("The flag `--all` has been deprecated in favor of `--workspace`")?; } - if !args.offline && !args.to_lockfile && std::env::var("CARGO_IS_TEST").is_err() { + if !args.offline && !args.to_lockfile { let url = registry_url(&find(args.manifest_path.as_deref())?, None)?; update_registry_index(&url, false)?; } @@ -281,7 +281,7 @@ fn exec(args: UpgradeArgs) -> CargoResult<()> { .registry() .map(|registry| registry_url(&manifest_path, Some(registry))) .transpose()?; - if !args.offline && std::env::var("CARGO_IS_TEST").is_err() { + if !args.offline { if let Some(registry_url) = ®istry_url { if updated_registries.insert(registry_url.to_owned()) { update_registry_index(registry_url, false)?; diff --git a/tests/cargo-upgrade.rs b/tests/cargo-upgrade.rs deleted file mode 100644 index 4dd60c79fa..0000000000 --- a/tests/cargo-upgrade.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[test] -fn cli_tests() { - trycmd::TestCases::new().case("tests/cmd/upgrade/*.toml"); -} diff --git a/tests/cargo-upgrade/alt_registry/in/Cargo.toml b/tests/cargo-upgrade/alt_registry/in/Cargo.toml new file mode 100644 index 0000000000..de85a9ff5d --- /dev/null +++ b/tests/cargo-upgrade/alt_registry/in/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "none" +version = "0.0.0" + +[lib] +path = "dummy.rs" + +[dependencies] +my-package1 = {version = "0.1.1", registry = "alternative" } + +[dependencies.my-package2] +version = "0.2" +registry = "alternative" diff --git a/tests/cargo-upgrade/alt_registry/in/src/lib.rs b/tests/cargo-upgrade/alt_registry/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/alt_registry/mod.rs b/tests/cargo-upgrade/alt_registry/mod.rs new file mode 100644 index 0000000000..fe5e31ed13 --- /dev/null +++ b/tests/cargo-upgrade/alt_registry/mod.rs @@ -0,0 +1,24 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_alt_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_alt_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/alt_registry/out/Cargo.toml b/tests/cargo-upgrade/alt_registry/out/Cargo.toml new file mode 100644 index 0000000000..9b4e74c19e --- /dev/null +++ b/tests/cargo-upgrade/alt_registry/out/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "none" +version = "0.0.0" + +[lib] +path = "dummy.rs" + +[dependencies] +my-package1 = {version = "99999.0.0", registry = "alternative" } + +[dependencies.my-package2] +version = "99999.0" +registry = "alternative" diff --git a/tests/cargo-upgrade/alt_registry/out/src/lib.rs b/tests/cargo-upgrade/alt_registry/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/alt_registry/stderr.log b/tests/cargo-upgrade/alt_registry/stderr.log new file mode 100644 index 0000000000..05e3e87e8e --- /dev/null +++ b/tests/cargo-upgrade/alt_registry/stderr.log @@ -0,0 +1,5 @@ + Updating '[ROOTURL]/registry' index + Checking none's dependencies + Updating '[ROOTURL]/alternative-registry' index + Upgrading my-package1: v0.1.1 -> v99999.0.0 + Upgrading my-package2: v0.2 -> v99999.0 diff --git a/tests/cargo-upgrade/alt_registry/stdout.log b/tests/cargo-upgrade/alt_registry/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/dry_run/in/Cargo.toml b/tests/cargo-upgrade/dry_run/in/Cargo.toml new file mode 100644 index 0000000000..8d96c67ea1 --- /dev/null +++ b/tests/cargo-upgrade/dry_run/in/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/dry_run/in/src/lib.rs b/tests/cargo-upgrade/dry_run/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/dry_run/mod.rs b/tests/cargo-upgrade/dry_run/mod.rs new file mode 100644 index 0000000000..a83afa2929 --- /dev/null +++ b/tests/cargo-upgrade/dry_run/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--dry-run"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/dry_run/out/Cargo.toml b/tests/cargo-upgrade/dry_run/out/Cargo.toml new file mode 100644 index 0000000000..8d96c67ea1 --- /dev/null +++ b/tests/cargo-upgrade/dry_run/out/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/dry_run/out/src/lib.rs b/tests/cargo-upgrade/dry_run/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/dry_run/stderr.log b/tests/cargo-upgrade/dry_run/stderr.log new file mode 100644 index 0000000000..1310ad1697 --- /dev/null +++ b/tests/cargo-upgrade/dry_run/stderr.log @@ -0,0 +1,4 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading my-package: v0.1.1 -> v99999.0.0 +warning: aborting upgrade due to dry run diff --git a/tests/cargo-upgrade/dry_run/stdout.log b/tests/cargo-upgrade/dry_run/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/exclude_dep/in/Cargo.toml b/tests/cargo-upgrade/exclude_dep/in/Cargo.toml new file mode 100644 index 0000000000..019788d4ba --- /dev/null +++ b/tests/cargo-upgrade/exclude_dep/in/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "None" +version = "0.1.0" + +[lib] +path = "dummy.rs" + +[dependencies] +docopt = "0.8" +pad = "0.1" +serde_json = "1.0" +syn = { version = "0.11.10", default-features = false, features = ["parsing"] } +tar = { version = "0.4", default-features = false } +ftp = "2.2.1" +te = { package = "toml_edit", version = "0.1.5" } + +[dependencies.semver] +features = ["serde"] +version = "0.7" + +[dependencies.rn] +package = "renamed" +version = "0.1" + +[dev-dependencies] +assert_cli = "0.2.0" +tempdir = "0.3" + +[build-dependencies] +serde = { version = "1.0", git= "https://github.com/serde-rs/serde.git" } + +[target.'cfg(unix)'.dependencies] +openssl = "0.9" + +[target."windows.json"] +# let's make it an inline table +dependencies = { rget = "0.3.0" } + +[target.'cfg(target_arch = "x86_64")'.dev-dependencies] +geo = { version = "0.7.0", default-features = false, features = ["postgis-integration"] } + +[target.foo.build-dependencies] +ftp = "2.2.1" + +[features] +default = [] +test-external-apis = [] +unstable = [] diff --git a/tests/cargo-upgrade/exclude_dep/in/src/lib.rs b/tests/cargo-upgrade/exclude_dep/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/exclude_dep/mod.rs b/tests/cargo-upgrade/exclude_dep/mod.rs new file mode 100644 index 0000000000..dbb301fffc --- /dev/null +++ b/tests/cargo-upgrade/exclude_dep/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--pinned", "--exclude", "docopt", "--verbose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/exclude_dep/out/Cargo.toml b/tests/cargo-upgrade/exclude_dep/out/Cargo.toml new file mode 100644 index 0000000000..5e14dab988 --- /dev/null +++ b/tests/cargo-upgrade/exclude_dep/out/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "None" +version = "0.1.0" + +[lib] +path = "dummy.rs" + +[dependencies] +docopt = "0.8" +pad = "99999.0" +serde_json = "99999.0" +syn = { version = "99999.0.0", default-features = false, features = ["parsing"] } +tar = { version = "99999.0", default-features = false } +ftp = "99999.0.0" +te = { package = "toml_edit", version = "99999.0.0" } + +[dependencies.semver] +features = ["serde"] +version = "99999.0" + +[dependencies.rn] +package = "renamed" +version = "99999.0" + +[dev-dependencies] +assert_cli = "99999.0.0" +tempdir = "99999.0" + +[build-dependencies] +serde = { version = "1.0", git= "https://github.com/serde-rs/serde.git" } + +[target.'cfg(unix)'.dependencies] +openssl = "99999.0" + +[target."windows.json"] +# let's make it an inline table +dependencies = { rget = "99999.0.0" } + +[target.'cfg(target_arch = "x86_64")'.dev-dependencies] +geo = { version = "99999.0.0", default-features = false, features = ["postgis-integration"] } + +[target.foo.build-dependencies] +ftp = "99999.0.0" + +[features] +default = [] +test-external-apis = [] +unstable = [] diff --git a/tests/cargo-upgrade/exclude_dep/stderr.log b/tests/cargo-upgrade/exclude_dep/stderr.log new file mode 100644 index 0000000000..dcd76d7d38 --- /dev/null +++ b/tests/cargo-upgrade/exclude_dep/stderr.log @@ -0,0 +1,18 @@ + Updating '[ROOTURL]/registry' index + Checking None's dependencies +warning: ignoring docopt, excluded by user + Upgrading pad: v0.1 -> v99999.0 + Upgrading serde_json: v1.0 -> v99999.0 + Upgrading syn: v0.11.10 -> v99999.0.0 + Upgrading tar: v0.4 -> v99999.0 + Upgrading ftp: v2.2.1 -> v99999.0.0 + Upgrading te: v0.1.5 -> v99999.0.0 + Upgrading semver: v0.7 -> v99999.0 + Upgrading rn: v0.1 -> v99999.0 + Upgrading assert_cli: v0.2.0 -> v99999.0.0 + Upgrading tempdir: v0.3 -> v99999.0 +warning: ignoring serde, source is https://github.com/serde-rs/serde.git + Upgrading openssl: v0.9 -> v99999.0 + Upgrading rget: v0.3.0 -> v99999.0.0 + Upgrading geo: v0.7.0 -> v99999.0.0 + Upgrading ftp: v2.2.1 -> v99999.0.0 diff --git a/tests/cargo-upgrade/exclude_dep/stdout.log b/tests/cargo-upgrade/exclude_dep/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/exclude_renamed/in/Cargo.toml b/tests/cargo-upgrade/exclude_renamed/in/Cargo.toml new file mode 100644 index 0000000000..62a598d5af --- /dev/null +++ b/tests/cargo-upgrade/exclude_renamed/in/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[lib] +path = "dummy.rs" + +[dependencies] +te = { package = "toml_edit", version = "0.1.5" } + +[dependencies.rx] +package = "regex" +version = "0.2" diff --git a/tests/cargo-upgrade/exclude_renamed/in/src/lib.rs b/tests/cargo-upgrade/exclude_renamed/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/exclude_renamed/mod.rs b/tests/cargo-upgrade/exclude_renamed/mod.rs new file mode 100644 index 0000000000..de2fad738f --- /dev/null +++ b/tests/cargo-upgrade/exclude_renamed/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--exclude", "rx", "--verbose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/exclude_renamed/out/Cargo.toml b/tests/cargo-upgrade/exclude_renamed/out/Cargo.toml new file mode 100644 index 0000000000..62a598d5af --- /dev/null +++ b/tests/cargo-upgrade/exclude_renamed/out/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[lib] +path = "dummy.rs" + +[dependencies] +te = { package = "toml_edit", version = "0.1.5" } + +[dependencies.rx] +package = "regex" +version = "0.2" diff --git a/tests/cargo-upgrade/exclude_renamed/out/src/lib.rs b/tests/cargo-upgrade/exclude_renamed/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/exclude_renamed/stderr.log b/tests/cargo-upgrade/exclude_renamed/stderr.log new file mode 100644 index 0000000000..9940ec71b4 --- /dev/null +++ b/tests/cargo-upgrade/exclude_renamed/stderr.log @@ -0,0 +1,5 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies +warning: ignoring te, renamed dependencies are pinned +warning: ignoring rx, excluded by user +note: Re-run with `--pinned` to upgrade pinned version requirements diff --git a/tests/cargo-upgrade/exclude_renamed/stdout.log b/tests/cargo-upgrade/exclude_renamed/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/implicit_prerelease/in/Cargo.toml b/tests/cargo-upgrade/implicit_prerelease/in/Cargo.toml new file mode 100644 index 0000000000..96968b8ca4 --- /dev/null +++ b/tests/cargo-upgrade/implicit_prerelease/in/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +unrelated-crate = "1.0" +my-package = "0.1.1-alpha.1" diff --git a/tests/cargo-upgrade/implicit_prerelease/in/src/lib.rs b/tests/cargo-upgrade/implicit_prerelease/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/implicit_prerelease/mod.rs b/tests/cargo-upgrade/implicit_prerelease/mod.rs new file mode 100644 index 0000000000..0c7d03aa22 --- /dev/null +++ b/tests/cargo-upgrade/implicit_prerelease/mod.rs @@ -0,0 +1,24 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/implicit_prerelease/out/Cargo.toml b/tests/cargo-upgrade/implicit_prerelease/out/Cargo.toml new file mode 100644 index 0000000000..6031e04ecc --- /dev/null +++ b/tests/cargo-upgrade/implicit_prerelease/out/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +unrelated-crate = "99999.0" +my-package = "99999.1.0-alpha.1" diff --git a/tests/cargo-upgrade/implicit_prerelease/out/src/lib.rs b/tests/cargo-upgrade/implicit_prerelease/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/implicit_prerelease/stderr.log b/tests/cargo-upgrade/implicit_prerelease/stderr.log new file mode 100644 index 0000000000..4514653460 --- /dev/null +++ b/tests/cargo-upgrade/implicit_prerelease/stderr.log @@ -0,0 +1,4 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading unrelated-crate: v1.0 -> v99999.0 + Upgrading my-package: v0.1.1-alpha.1 -> v99999.1.0-alpha.1 diff --git a/tests/cargo-upgrade/implicit_prerelease/stdout.log b/tests/cargo-upgrade/implicit_prerelease/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_dep/in/Cargo.toml b/tests/cargo-upgrade/invalid_dep/in/Cargo.toml new file mode 100644 index 0000000000..5e20016d71 --- /dev/null +++ b/tests/cargo-upgrade/invalid_dep/in/Cargo.toml @@ -0,0 +1,3 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/tests/cargo-upgrade/invalid_dep/in/src/lib.rs b/tests/cargo-upgrade/invalid_dep/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_dep/mod.rs b/tests/cargo-upgrade/invalid_dep/mod.rs new file mode 100644 index 0000000000..33b9e5a3a5 --- /dev/null +++ b/tests/cargo-upgrade/invalid_dep/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["failure"]) + .current_dir(cwd) + .assert() + .failure() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/invalid_dep/out/Cargo.toml b/tests/cargo-upgrade/invalid_dep/out/Cargo.toml new file mode 100644 index 0000000000..5e20016d71 --- /dev/null +++ b/tests/cargo-upgrade/invalid_dep/out/Cargo.toml @@ -0,0 +1,3 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/tests/cargo-upgrade/invalid_dep/out/src/lib.rs b/tests/cargo-upgrade/invalid_dep/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_dep/stderr.log b/tests/cargo-upgrade/invalid_dep/stderr.log new file mode 100644 index 0000000000..a905adf081 --- /dev/null +++ b/tests/cargo-upgrade/invalid_dep/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies +Error: dependency failure doesn't exist diff --git a/tests/cargo-upgrade/invalid_dep/stdout.log b/tests/cargo-upgrade/invalid_dep/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_flag/in/Cargo.toml b/tests/cargo-upgrade/invalid_flag/in/Cargo.toml new file mode 100644 index 0000000000..5e20016d71 --- /dev/null +++ b/tests/cargo-upgrade/invalid_flag/in/Cargo.toml @@ -0,0 +1,3 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/tests/cargo-upgrade/invalid_flag/in/src/lib.rs b/tests/cargo-upgrade/invalid_flag/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_flag/mod.rs b/tests/cargo-upgrade/invalid_flag/mod.rs new file mode 100644 index 0000000000..64c0ff2abc --- /dev/null +++ b/tests/cargo-upgrade/invalid_flag/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--flag"]) + .current_dir(cwd) + .assert() + .code(2) + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/invalid_flag/out/Cargo.toml b/tests/cargo-upgrade/invalid_flag/out/Cargo.toml new file mode 100644 index 0000000000..5e20016d71 --- /dev/null +++ b/tests/cargo-upgrade/invalid_flag/out/Cargo.toml @@ -0,0 +1,3 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/tests/cargo-upgrade/invalid_flag/out/src/lib.rs b/tests/cargo-upgrade/invalid_flag/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_flag/stderr.log b/tests/cargo-upgrade/invalid_flag/stderr.log new file mode 100644 index 0000000000..c2ea9229d2 --- /dev/null +++ b/tests/cargo-upgrade/invalid_flag/stderr.log @@ -0,0 +1,8 @@ +error: Found argument '--flag' which wasn't expected, or isn't valid in this context + + If you tried to supply `--flag` as a value rather than a flag, use `-- --flag` + +USAGE: + cargo upgrade [OPTIONS] [DEPENDENCY]... + +For more information try --help diff --git a/tests/cargo-upgrade/invalid_flag/stdout.log b/tests/cargo-upgrade/invalid_flag/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_manifest/in/Cargo.toml b/tests/cargo-upgrade/invalid_manifest/in/Cargo.toml new file mode 100644 index 0000000000..4c1ec3ff06 --- /dev/null +++ b/tests/cargo-upgrade/invalid_manifest/in/Cargo.toml @@ -0,0 +1 @@ +This is clearly not a valid Cargo.toml. diff --git a/tests/cargo-upgrade/invalid_manifest/in/src/lib.rs b/tests/cargo-upgrade/invalid_manifest/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_manifest/mod.rs b/tests/cargo-upgrade/invalid_manifest/mod.rs new file mode 100644 index 0000000000..be8d17d394 --- /dev/null +++ b/tests/cargo-upgrade/invalid_manifest/mod.rs @@ -0,0 +1,24 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/invalid_manifest/out/Cargo.toml b/tests/cargo-upgrade/invalid_manifest/out/Cargo.toml new file mode 100644 index 0000000000..4c1ec3ff06 --- /dev/null +++ b/tests/cargo-upgrade/invalid_manifest/out/Cargo.toml @@ -0,0 +1 @@ +This is clearly not a valid Cargo.toml. diff --git a/tests/cargo-upgrade/invalid_manifest/out/src/lib.rs b/tests/cargo-upgrade/invalid_manifest/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_manifest/stderr.log b/tests/cargo-upgrade/invalid_manifest/stderr.log new file mode 100644 index 0000000000..d6d89f1667 --- /dev/null +++ b/tests/cargo-upgrade/invalid_manifest/stderr.log @@ -0,0 +1,16 @@ + Updating '[ROOTURL]/registry' index +Error: Invalid manifest + +Caused by: + `cargo metadata` exited with an error: error: failed to parse manifest at `[ROOT]/case/Cargo.toml` + + Caused by: + could not parse input as TOML + + Caused by: + TOML parse error at line 1, column 6 + | + 1 | This is clearly not a valid Cargo.toml. + | ^ + Unexpected `i` + Expected `.` or `=` diff --git a/tests/cargo-upgrade/invalid_manifest/stdout.log b/tests/cargo-upgrade/invalid_manifest/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_workspace_root_manifest/in/Cargo.toml b/tests/cargo-upgrade/invalid_workspace_root_manifest/in/Cargo.toml new file mode 100644 index 0000000000..4c1ec3ff06 --- /dev/null +++ b/tests/cargo-upgrade/invalid_workspace_root_manifest/in/Cargo.toml @@ -0,0 +1 @@ +This is clearly not a valid Cargo.toml. diff --git a/tests/cargo-upgrade/invalid_workspace_root_manifest/in/src/lib.rs b/tests/cargo-upgrade/invalid_workspace_root_manifest/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_workspace_root_manifest/mod.rs b/tests/cargo-upgrade/invalid_workspace_root_manifest/mod.rs new file mode 100644 index 0000000000..b79d0bccda --- /dev/null +++ b/tests/cargo-upgrade/invalid_workspace_root_manifest/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--workspace"]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/invalid_workspace_root_manifest/out/Cargo.toml b/tests/cargo-upgrade/invalid_workspace_root_manifest/out/Cargo.toml new file mode 100644 index 0000000000..4c1ec3ff06 --- /dev/null +++ b/tests/cargo-upgrade/invalid_workspace_root_manifest/out/Cargo.toml @@ -0,0 +1 @@ +This is clearly not a valid Cargo.toml. diff --git a/tests/cargo-upgrade/invalid_workspace_root_manifest/out/src/lib.rs b/tests/cargo-upgrade/invalid_workspace_root_manifest/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/invalid_workspace_root_manifest/stderr.log b/tests/cargo-upgrade/invalid_workspace_root_manifest/stderr.log new file mode 100644 index 0000000000..52975e8fa6 --- /dev/null +++ b/tests/cargo-upgrade/invalid_workspace_root_manifest/stderr.log @@ -0,0 +1,11 @@ + Updating '[ROOTURL]/registry' index +Error: Invalid manifest + +Caused by: + `cargo metadata` exited with an error: error: failed to parse manifest at `[ROOT]/case/Cargo.toml` + + Caused by: + could not parse input as TOML + + Caused by: +... diff --git a/tests/cargo-upgrade/invalid_workspace_root_manifest/stdout.log b/tests/cargo-upgrade/invalid_workspace_root_manifest/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/locked/in/Cargo.toml b/tests/cargo-upgrade/locked/in/Cargo.toml new file mode 100644 index 0000000000..8d96c67ea1 --- /dev/null +++ b/tests/cargo-upgrade/locked/in/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/locked/in/src/lib.rs b/tests/cargo-upgrade/locked/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/locked/mod.rs b/tests/cargo-upgrade/locked/mod.rs new file mode 100644 index 0000000000..01c4a68147 --- /dev/null +++ b/tests/cargo-upgrade/locked/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--locked"]) + .current_dir(cwd) + .assert() + .failure() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/locked/out/Cargo.toml b/tests/cargo-upgrade/locked/out/Cargo.toml new file mode 100644 index 0000000000..8d96c67ea1 --- /dev/null +++ b/tests/cargo-upgrade/locked/out/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/locked/out/src/lib.rs b/tests/cargo-upgrade/locked/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/locked/stderr.log b/tests/cargo-upgrade/locked/stderr.log new file mode 100644 index 0000000000..f481495d3f --- /dev/null +++ b/tests/cargo-upgrade/locked/stderr.log @@ -0,0 +1,4 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading my-package: v0.1.1 -> v99999.0.0 +Error: cannot upgrade due to `--locked` diff --git a/tests/cargo-upgrade/locked/stdout.log b/tests/cargo-upgrade/locked/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/main.rs b/tests/cargo-upgrade/main.rs new file mode 100644 index 0000000000..d7b4909b88 --- /dev/null +++ b/tests/cargo-upgrade/main.rs @@ -0,0 +1,173 @@ +#![allow(clippy::all)] +#![warn(clippy::needless_borrow)] +#![warn(clippy::redundant_clone)] + +#[macro_use] +extern crate cargo_test_macro; + +mod alt_registry; +mod dry_run; +mod exclude_dep; +mod exclude_renamed; +mod implicit_prerelease; +mod invalid_dep; +mod invalid_flag; +mod invalid_manifest; +mod invalid_workspace_root_manifest; +mod locked; +mod optional_dep; +mod pinned; +mod preserve_precision_major; +mod preserve_precision_minor; +mod preserve_precision_patch; +mod preserves_inline_table; +mod preserves_std_table; +mod single_dep; +mod skip_compatible; +mod specified; +mod to_lockfile; +mod to_version; +mod upgrade_all; +mod upgrade_everything; +mod upgrade_renamed; +mod upgrade_workspace; +mod virtual_manifest; +mod workspace_member_cwd; +mod workspace_member_manifest_path; + +fn init_registry() { + cargo_test_support::registry::init(); + add_registry_packages(false); +} + +fn init_alt_registry() { + cargo_test_support::registry::alt_init(); + add_registry_packages(true); +} + +fn add_registry_packages(alt: bool) { + for name in [ + "my-package", + "my-package1", + "my-package2", + "my-dev-package1", + "my-dev-package2", + "my-build-package1", + "my-build-package2", + "versioned-package", + "cargo-list-test-fixture-dependency", + "unrelated-crate", + // "Everything" + "docopt", + "pad", + "serde_json", + "syn", + "tar", + "ftp", + "toml_edit", + "semver", + "renamed", + "assert_cli", + "tempdir", + "toml", + "openssl", + "rget", + "geo", + // Operators + "default", + "exact", + "lessthan", + "lessorequal", + "greaterthan", + "greaterorequal", + "wildcard", + "caret", + "tilde", + "greaterthan", + "greaterthan", + ] { + cargo_test_support::registry::Package::new(name, "0.1.1-alpha.1+my-package") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new(name, "0.1.1+my-package") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new(name, "0.2.0+my-package") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new(name, "0.2.3+my-package") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new(name, "0.4.1+my-package") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new(name, "20.0.0+my-package") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new(name, "99999.0.0-alpha.1+my-package") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new(name, "99999.0.0+my-package") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new(name, "99999.1.0-alpha.1+my-package") + .alternative(alt) + .publish(); + } + + cargo_test_support::registry::Package::new("prerelease_only", "0.2.0-alpha.1") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new("test_breaking", "0.2.0") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new("test_nonbreaking", "0.1.1") + .alternative(alt) + .publish(); + + // Normalization + cargo_test_support::registry::Package::new("linked-hash-map", "0.5.4") + .alternative(alt) + .feature("clippy", &[]) + .feature("heapsize", &[]) + .feature("heapsize_impl", &[]) + .feature("nightly", &[]) + .feature("serde", &[]) + .feature("serde_impl", &[]) + .feature("serde_test", &[]) + .publish(); + cargo_test_support::registry::Package::new("inflector", "0.11.4") + .alternative(alt) + .feature("default", &["heavyweight", "lazy_static", "regex"]) + .feature("heavyweight", &[]) + .feature("lazy_static", &[]) + .feature("regex", &[]) + .feature("unstable", &[]) + .publish(); + + cargo_test_support::registry::Package::new("your-face", "99999.0.0+my-package") + .alternative(alt) + .feature("nose", &[]) + .feature("mouth", &[]) + .feature("eyes", &[]) + .feature("ears", &[]) + .publish(); +} + +pub fn cargo_exe() -> std::path::PathBuf { + snapbox::cmd::cargo_bin("cargo-upgrade") +} + +/// Test the cargo command +pub trait CargoCommand { + fn cargo_ui() -> Self; +} + +impl CargoCommand for snapbox::cmd::Command { + fn cargo_ui() -> Self { + use cargo_test_support::TestEnv; + Self::new(cargo_exe()) + .with_assert(cargo_test_support::compare::assert_ui()) + .test_env() + } +} diff --git a/tests/cargo-upgrade/optional_dep/in/Cargo.toml b/tests/cargo-upgrade/optional_dep/in/Cargo.toml new file mode 100644 index 0000000000..538f988760 --- /dev/null +++ b/tests/cargo-upgrade/optional_dep/in/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = { version = "0.1.1", optional = true } diff --git a/tests/cargo-upgrade/optional_dep/in/src/lib.rs b/tests/cargo-upgrade/optional_dep/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/optional_dep/mod.rs b/tests/cargo-upgrade/optional_dep/mod.rs new file mode 100644 index 0000000000..0c7d03aa22 --- /dev/null +++ b/tests/cargo-upgrade/optional_dep/mod.rs @@ -0,0 +1,24 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/optional_dep/out/Cargo.toml b/tests/cargo-upgrade/optional_dep/out/Cargo.toml new file mode 100644 index 0000000000..8123077bb6 --- /dev/null +++ b/tests/cargo-upgrade/optional_dep/out/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = { version = "99999.0.0", optional = true } diff --git a/tests/cargo-upgrade/optional_dep/out/src/lib.rs b/tests/cargo-upgrade/optional_dep/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/optional_dep/stderr.log b/tests/cargo-upgrade/optional_dep/stderr.log new file mode 100644 index 0000000000..74c5b6f685 --- /dev/null +++ b/tests/cargo-upgrade/optional_dep/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading my-package: v0.1.1 -> v99999.0.0 diff --git a/tests/cargo-upgrade/optional_dep/stdout.log b/tests/cargo-upgrade/optional_dep/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/pinned/in/Cargo.toml b/tests/cargo-upgrade/pinned/in/Cargo.toml new file mode 100644 index 0000000000..36aff13b16 --- /dev/null +++ b/tests/cargo-upgrade/pinned/in/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +default = "1.0" +exact = "=2.0" +lessthan = "<0.4" +lessorequal = "<=3.0" +caret = "^3.0" +tilde = "~4.1.0" +greaterthan = ">2.0" +greaterorequal = ">=2.1.0" +wildcard = "3.*" diff --git a/tests/cargo-upgrade/pinned/in/src/lib.rs b/tests/cargo-upgrade/pinned/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/pinned/mod.rs b/tests/cargo-upgrade/pinned/mod.rs new file mode 100644 index 0000000000..b55e769327 --- /dev/null +++ b/tests/cargo-upgrade/pinned/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--verbose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/pinned/out/Cargo.toml b/tests/cargo-upgrade/pinned/out/Cargo.toml new file mode 100644 index 0000000000..8049eaa4aa --- /dev/null +++ b/tests/cargo-upgrade/pinned/out/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +default = "99999.0" +exact = "=2.0" +lessthan = "<0.4" +lessorequal = "<=3.0" +caret = "^99999.0" +tilde = "~99999.0.0" +greaterthan = ">2.0" +greaterorequal = ">=2.1.0" +wildcard = "99999.*" diff --git a/tests/cargo-upgrade/pinned/out/src/lib.rs b/tests/cargo-upgrade/pinned/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/pinned/stderr.log b/tests/cargo-upgrade/pinned/stderr.log new file mode 100644 index 0000000000..11f6180339 --- /dev/null +++ b/tests/cargo-upgrade/pinned/stderr.log @@ -0,0 +1,13 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading default: v1.0 -> v99999.0 +warning: ignoring exact, version (=2.0) is pinned +warning: ignoring lessthan, version (<0.4) is pinned +warning: ignoring lessorequal, version (<=3.0) is pinned + Upgrading caret: ^3.0 -> ^99999.0 + Upgrading tilde: ~4.1.0 -> ~99999.0.0 +warning: ignoring greaterthan, version (>2.0) is compatible with 99999.0.0 +warning: ignoring greaterorequal, version (>=2.1.0) is compatible with 99999.0.0 + Upgrading wildcard: v3.* -> v99999.* +note: Re-run with `--pinned` to upgrade pinned version requirements +note: Re-run with `--to-lockfile` to upgrade compatible version requirements diff --git a/tests/cargo-upgrade/pinned/stdout.log b/tests/cargo-upgrade/pinned/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserve_precision_major/in/Cargo.toml b/tests/cargo-upgrade/preserve_precision_major/in/Cargo.toml new file mode 100644 index 0000000000..ec228f642a --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_major/in/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "0" diff --git a/tests/cargo-upgrade/preserve_precision_major/in/src/lib.rs b/tests/cargo-upgrade/preserve_precision_major/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserve_precision_major/mod.rs b/tests/cargo-upgrade/preserve_precision_major/mod.rs new file mode 100644 index 0000000000..a9cf401fdf --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_major/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--pinned", "--verbose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/preserve_precision_major/out/Cargo.toml b/tests/cargo-upgrade/preserve_precision_major/out/Cargo.toml new file mode 100644 index 0000000000..f2e166dcf9 --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_major/out/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "99999" diff --git a/tests/cargo-upgrade/preserve_precision_major/out/src/lib.rs b/tests/cargo-upgrade/preserve_precision_major/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserve_precision_major/stderr.log b/tests/cargo-upgrade/preserve_precision_major/stderr.log new file mode 100644 index 0000000000..4e4c4f0221 --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_major/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading my-package: v0 -> v99999 diff --git a/tests/cargo-upgrade/preserve_precision_major/stdout.log b/tests/cargo-upgrade/preserve_precision_major/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserve_precision_minor/in/Cargo.toml b/tests/cargo-upgrade/preserve_precision_minor/in/Cargo.toml new file mode 100644 index 0000000000..93abe95165 --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_minor/in/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "0.1" diff --git a/tests/cargo-upgrade/preserve_precision_minor/in/src/lib.rs b/tests/cargo-upgrade/preserve_precision_minor/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserve_precision_minor/mod.rs b/tests/cargo-upgrade/preserve_precision_minor/mod.rs new file mode 100644 index 0000000000..a9cf401fdf --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_minor/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--pinned", "--verbose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/preserve_precision_minor/out/Cargo.toml b/tests/cargo-upgrade/preserve_precision_minor/out/Cargo.toml new file mode 100644 index 0000000000..18054f6cfe --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_minor/out/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "99999.0" diff --git a/tests/cargo-upgrade/preserve_precision_minor/out/src/lib.rs b/tests/cargo-upgrade/preserve_precision_minor/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserve_precision_minor/stderr.log b/tests/cargo-upgrade/preserve_precision_minor/stderr.log new file mode 100644 index 0000000000..0c0253bb0a --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_minor/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading my-package: v0.1 -> v99999.0 diff --git a/tests/cargo-upgrade/preserve_precision_minor/stdout.log b/tests/cargo-upgrade/preserve_precision_minor/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserve_precision_patch/in/Cargo.toml b/tests/cargo-upgrade/preserve_precision_patch/in/Cargo.toml new file mode 100644 index 0000000000..8d96c67ea1 --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_patch/in/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/preserve_precision_patch/in/src/lib.rs b/tests/cargo-upgrade/preserve_precision_patch/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserve_precision_patch/mod.rs b/tests/cargo-upgrade/preserve_precision_patch/mod.rs new file mode 100644 index 0000000000..a9cf401fdf --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_patch/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--pinned", "--verbose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/preserve_precision_patch/out/Cargo.toml b/tests/cargo-upgrade/preserve_precision_patch/out/Cargo.toml new file mode 100644 index 0000000000..5e2ebf198a --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_patch/out/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "99999.0.0" diff --git a/tests/cargo-upgrade/preserve_precision_patch/out/src/lib.rs b/tests/cargo-upgrade/preserve_precision_patch/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserve_precision_patch/stderr.log b/tests/cargo-upgrade/preserve_precision_patch/stderr.log new file mode 100644 index 0000000000..74c5b6f685 --- /dev/null +++ b/tests/cargo-upgrade/preserve_precision_patch/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading my-package: v0.1.1 -> v99999.0.0 diff --git a/tests/cargo-upgrade/preserve_precision_patch/stdout.log b/tests/cargo-upgrade/preserve_precision_patch/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserves_inline_table/in/Cargo.toml b/tests/cargo-upgrade/preserves_inline_table/in/Cargo.toml new file mode 100644 index 0000000000..d27c14ed94 --- /dev/null +++ b/tests/cargo-upgrade/preserves_inline_table/in/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package={version="0.1.1"} # Hello, world diff --git a/tests/cargo-upgrade/preserves_inline_table/in/src/lib.rs b/tests/cargo-upgrade/preserves_inline_table/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserves_inline_table/mod.rs b/tests/cargo-upgrade/preserves_inline_table/mod.rs new file mode 100644 index 0000000000..0c7d03aa22 --- /dev/null +++ b/tests/cargo-upgrade/preserves_inline_table/mod.rs @@ -0,0 +1,24 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/preserves_inline_table/out/Cargo.toml b/tests/cargo-upgrade/preserves_inline_table/out/Cargo.toml new file mode 100644 index 0000000000..47bc24904b --- /dev/null +++ b/tests/cargo-upgrade/preserves_inline_table/out/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package={version="99999.0.0"} # Hello, world diff --git a/tests/cargo-upgrade/preserves_inline_table/out/src/lib.rs b/tests/cargo-upgrade/preserves_inline_table/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserves_inline_table/stderr.log b/tests/cargo-upgrade/preserves_inline_table/stderr.log new file mode 100644 index 0000000000..74c5b6f685 --- /dev/null +++ b/tests/cargo-upgrade/preserves_inline_table/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading my-package: v0.1.1 -> v99999.0.0 diff --git a/tests/cargo-upgrade/preserves_inline_table/stdout.log b/tests/cargo-upgrade/preserves_inline_table/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserves_std_table/in/Cargo.toml b/tests/cargo-upgrade/preserves_std_table/in/Cargo.toml new file mode 100644 index 0000000000..1eb4e478c7 --- /dev/null +++ b/tests/cargo-upgrade/preserves_std_table/in/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies.my-package] +version="0.1.1" # Hello, world diff --git a/tests/cargo-upgrade/preserves_std_table/in/src/lib.rs b/tests/cargo-upgrade/preserves_std_table/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserves_std_table/mod.rs b/tests/cargo-upgrade/preserves_std_table/mod.rs new file mode 100644 index 0000000000..0c7d03aa22 --- /dev/null +++ b/tests/cargo-upgrade/preserves_std_table/mod.rs @@ -0,0 +1,24 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/preserves_std_table/out/Cargo.toml b/tests/cargo-upgrade/preserves_std_table/out/Cargo.toml new file mode 100644 index 0000000000..eb3c2d3930 --- /dev/null +++ b/tests/cargo-upgrade/preserves_std_table/out/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies.my-package] +version="99999.0.0" # Hello, world diff --git a/tests/cargo-upgrade/preserves_std_table/out/src/lib.rs b/tests/cargo-upgrade/preserves_std_table/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/preserves_std_table/stderr.log b/tests/cargo-upgrade/preserves_std_table/stderr.log new file mode 100644 index 0000000000..74c5b6f685 --- /dev/null +++ b/tests/cargo-upgrade/preserves_std_table/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading my-package: v0.1.1 -> v99999.0.0 diff --git a/tests/cargo-upgrade/preserves_std_table/stdout.log b/tests/cargo-upgrade/preserves_std_table/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/single_dep/in/Cargo.toml b/tests/cargo-upgrade/single_dep/in/Cargo.toml new file mode 100644 index 0000000000..8d96c67ea1 --- /dev/null +++ b/tests/cargo-upgrade/single_dep/in/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/single_dep/in/src/lib.rs b/tests/cargo-upgrade/single_dep/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/single_dep/mod.rs b/tests/cargo-upgrade/single_dep/mod.rs new file mode 100644 index 0000000000..0c7d03aa22 --- /dev/null +++ b/tests/cargo-upgrade/single_dep/mod.rs @@ -0,0 +1,24 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/single_dep/out/Cargo.toml b/tests/cargo-upgrade/single_dep/out/Cargo.toml new file mode 100644 index 0000000000..5e2ebf198a --- /dev/null +++ b/tests/cargo-upgrade/single_dep/out/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "99999.0.0" diff --git a/tests/cargo-upgrade/single_dep/out/src/lib.rs b/tests/cargo-upgrade/single_dep/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/single_dep/stderr.log b/tests/cargo-upgrade/single_dep/stderr.log new file mode 100644 index 0000000000..74c5b6f685 --- /dev/null +++ b/tests/cargo-upgrade/single_dep/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading my-package: v0.1.1 -> v99999.0.0 diff --git a/tests/cargo-upgrade/single_dep/stdout.log b/tests/cargo-upgrade/single_dep/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/skip_compatible/in/Cargo.toml b/tests/cargo-upgrade/skip_compatible/in/Cargo.toml new file mode 100644 index 0000000000..d0cd69fe72 --- /dev/null +++ b/tests/cargo-upgrade/skip_compatible/in/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +test_breaking = "0.1" +test_nonbreaking = "0.1" diff --git a/tests/cargo-upgrade/skip_compatible/in/src/lib.rs b/tests/cargo-upgrade/skip_compatible/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/skip_compatible/mod.rs b/tests/cargo-upgrade/skip_compatible/mod.rs new file mode 100644 index 0000000000..b55e769327 --- /dev/null +++ b/tests/cargo-upgrade/skip_compatible/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--verbose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/skip_compatible/out/Cargo.toml b/tests/cargo-upgrade/skip_compatible/out/Cargo.toml new file mode 100644 index 0000000000..f7a775d431 --- /dev/null +++ b/tests/cargo-upgrade/skip_compatible/out/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +test_breaking = "0.2" +test_nonbreaking = "0.1" diff --git a/tests/cargo-upgrade/skip_compatible/out/src/lib.rs b/tests/cargo-upgrade/skip_compatible/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/skip_compatible/stderr.log b/tests/cargo-upgrade/skip_compatible/stderr.log new file mode 100644 index 0000000000..d876305b05 --- /dev/null +++ b/tests/cargo-upgrade/skip_compatible/stderr.log @@ -0,0 +1,5 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading test_breaking: v0.1 -> v0.2 +warning: ignoring test_nonbreaking, version (0.1) is compatible with 0.1.1 +note: Re-run with `--to-lockfile` to upgrade compatible version requirements diff --git a/tests/cargo-upgrade/skip_compatible/stdout.log b/tests/cargo-upgrade/skip_compatible/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/specified/in/Cargo.toml b/tests/cargo-upgrade/specified/in/Cargo.toml new file mode 100644 index 0000000000..440c22d382 --- /dev/null +++ b/tests/cargo-upgrade/specified/in/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package1 = "0.1" +my-package2 = "0.2" diff --git a/tests/cargo-upgrade/specified/in/src/lib.rs b/tests/cargo-upgrade/specified/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/specified/mod.rs b/tests/cargo-upgrade/specified/mod.rs new file mode 100644 index 0000000000..a27ea111b5 --- /dev/null +++ b/tests/cargo-upgrade/specified/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["my-package1"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/specified/out/Cargo.toml b/tests/cargo-upgrade/specified/out/Cargo.toml new file mode 100644 index 0000000000..f37ad81c01 --- /dev/null +++ b/tests/cargo-upgrade/specified/out/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package1 = "99999.0" +my-package2 = "0.2" diff --git a/tests/cargo-upgrade/specified/out/src/lib.rs b/tests/cargo-upgrade/specified/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/specified/stderr.log b/tests/cargo-upgrade/specified/stderr.log new file mode 100644 index 0000000000..b6b1747126 --- /dev/null +++ b/tests/cargo-upgrade/specified/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading my-package1: v0.1 -> v99999.0 diff --git a/tests/cargo-upgrade/specified/stdout.log b/tests/cargo-upgrade/specified/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/to_lockfile/in/Cargo.lock b/tests/cargo-upgrade/to_lockfile/in/Cargo.lock new file mode 100644 index 0000000000..bfa52c6287 --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/in/Cargo.lock @@ -0,0 +1,38 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "four" +version = "0.1.5" +dependencies = [ + "my-package", +] + +[[package]] +name = "my-package" +version = "0.2.3+my-package" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64091705b8802c92a5d2aed241bf6bc0b4fad664dfd7a5d89667280730d13a5f" + +[[package]] +name = "one" +version = "0.1.0" +dependencies = [ + "my-package", + "three", +] + +[[package]] +name = "three" +version = "0.1.5" +dependencies = [ + "my-package", +] + +[[package]] +name = "two" +version = "0.1.0" +dependencies = [ + "my-package", +] diff --git a/tests/cargo-upgrade/to_lockfile/in/Cargo.toml b/tests/cargo-upgrade/to_lockfile/in/Cargo.toml new file mode 100644 index 0000000000..165bb54e20 --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/in/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] \ No newline at end of file diff --git a/tests/cargo-upgrade/to_lockfile/in/dummy.rs b/tests/cargo-upgrade/to_lockfile/in/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/to_lockfile/in/explicit/four/Cargo.toml b/tests/cargo-upgrade/to_lockfile/in/explicit/four/Cargo.toml new file mode 100644 index 0000000000..1f61e45a1a --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/in/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/to_lockfile/in/implicit/three/Cargo.toml b/tests/cargo-upgrade/to_lockfile/in/implicit/three/Cargo.toml new file mode 100644 index 0000000000..05305ab0e5 --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/in/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/to_lockfile/in/one/Cargo.toml b/tests/cargo-upgrade/to_lockfile/in/one/Cargo.toml new file mode 100644 index 0000000000..888063b0d3 --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/in/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.0" +three = { path = "../implicit/three", version = "0.1.0" } diff --git a/tests/cargo-upgrade/to_lockfile/in/two/Cargo.toml b/tests/cargo-upgrade/to_lockfile/in/two/Cargo.toml new file mode 100644 index 0000000000..054a48778f --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/in/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/to_lockfile/mod.rs b/tests/cargo-upgrade/to_lockfile/mod.rs new file mode 100644 index 0000000000..d7768cb967 --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--workspace", "--to-lockfile", "--verbose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/to_lockfile/out/Cargo.lock b/tests/cargo-upgrade/to_lockfile/out/Cargo.lock new file mode 100644 index 0000000000..bfa52c6287 --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/out/Cargo.lock @@ -0,0 +1,38 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "four" +version = "0.1.5" +dependencies = [ + "my-package", +] + +[[package]] +name = "my-package" +version = "0.2.3+my-package" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64091705b8802c92a5d2aed241bf6bc0b4fad664dfd7a5d89667280730d13a5f" + +[[package]] +name = "one" +version = "0.1.0" +dependencies = [ + "my-package", + "three", +] + +[[package]] +name = "three" +version = "0.1.5" +dependencies = [ + "my-package", +] + +[[package]] +name = "two" +version = "0.1.0" +dependencies = [ + "my-package", +] diff --git a/tests/cargo-upgrade/to_lockfile/out/Cargo.toml b/tests/cargo-upgrade/to_lockfile/out/Cargo.toml new file mode 100644 index 0000000000..165bb54e20 --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/out/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] \ No newline at end of file diff --git a/tests/cargo-upgrade/to_lockfile/out/dummy.rs b/tests/cargo-upgrade/to_lockfile/out/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/to_lockfile/out/explicit/four/Cargo.toml b/tests/cargo-upgrade/to_lockfile/out/explicit/four/Cargo.toml new file mode 100644 index 0000000000..bb39b355f0 --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/out/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.3" diff --git a/tests/cargo-upgrade/to_lockfile/out/implicit/three/Cargo.toml b/tests/cargo-upgrade/to_lockfile/out/implicit/three/Cargo.toml new file mode 100644 index 0000000000..706709de3c --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/out/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.3" diff --git a/tests/cargo-upgrade/to_lockfile/out/one/Cargo.toml b/tests/cargo-upgrade/to_lockfile/out/one/Cargo.toml new file mode 100644 index 0000000000..d4f8e640ad --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/out/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.3" +three = { path = "../implicit/three", version = "0.1.0" } diff --git a/tests/cargo-upgrade/to_lockfile/out/two/Cargo.toml b/tests/cargo-upgrade/to_lockfile/out/two/Cargo.toml new file mode 100644 index 0000000000..b805543033 --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/out/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.3" diff --git a/tests/cargo-upgrade/to_lockfile/stderr.log b/tests/cargo-upgrade/to_lockfile/stderr.log new file mode 100644 index 0000000000..e160e3a6a0 --- /dev/null +++ b/tests/cargo-upgrade/to_lockfile/stderr.log @@ -0,0 +1,9 @@ + Checking one's dependencies + Upgrading my-package: v0.2.0 -> v0.2.3 +warning: ignoring three, could not find package: not in lock file + Checking three's dependencies + Upgrading my-package: v0.2.0 -> v0.2.3 + Checking two's dependencies + Upgrading my-package: v0.2.0 -> v0.2.3 + Checking four's dependencies + Upgrading my-package: v0.2.0 -> v0.2.3 diff --git a/tests/cargo-upgrade/to_lockfile/stdout.log b/tests/cargo-upgrade/to_lockfile/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/to_version/in/Cargo.toml b/tests/cargo-upgrade/to_version/in/Cargo.toml new file mode 100644 index 0000000000..813c7c219f --- /dev/null +++ b/tests/cargo-upgrade/to_version/in/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +docopt = "0.8.0" diff --git a/tests/cargo-upgrade/to_version/in/src/lib.rs b/tests/cargo-upgrade/to_version/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/to_version/mod.rs b/tests/cargo-upgrade/to_version/mod.rs new file mode 100644 index 0000000000..3d34e417e6 --- /dev/null +++ b/tests/cargo-upgrade/to_version/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["docopt@1000000.0.0", "--verbose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/to_version/out/Cargo.toml b/tests/cargo-upgrade/to_version/out/Cargo.toml new file mode 100644 index 0000000000..83aad42c0d --- /dev/null +++ b/tests/cargo-upgrade/to_version/out/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +docopt = "1000000.0.0" diff --git a/tests/cargo-upgrade/to_version/out/src/lib.rs b/tests/cargo-upgrade/to_version/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/to_version/stderr.log b/tests/cargo-upgrade/to_version/stderr.log new file mode 100644 index 0000000000..c70fa7c476 --- /dev/null +++ b/tests/cargo-upgrade/to_version/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading docopt: v0.8.0 -> v1000000.0.0 diff --git a/tests/cargo-upgrade/to_version/stdout.log b/tests/cargo-upgrade/to_version/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/upgrade_all/in/Cargo.lock b/tests/cargo-upgrade/upgrade_all/in/Cargo.lock new file mode 100644 index 0000000000..59bda66005 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/in/Cargo.lock @@ -0,0 +1,137 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "four" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "one" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "three 0.1.0", +] + +[[package]] +name = "rand" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "three" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "two" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" +"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" +"checksum log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f91d813fb009895c01b1b5c095fc88aea17138355bc0e4d53a277c466f62161f" +"checksum rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28cb601e872bcf1e2667d0433d2b5f2c53d37a6ca05e948fd1a977fa087e42e3" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/tests/cargo-upgrade/upgrade_all/in/Cargo.toml b/tests/cargo-upgrade/upgrade_all/in/Cargo.toml new file mode 100644 index 0000000000..165bb54e20 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/in/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] \ No newline at end of file diff --git a/tests/cargo-upgrade/upgrade_all/in/dummy.rs b/tests/cargo-upgrade/upgrade_all/in/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/upgrade_all/in/explicit/four/Cargo.toml b/tests/cargo-upgrade/upgrade_all/in/explicit/four/Cargo.toml new file mode 100644 index 0000000000..1f61e45a1a --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/in/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/upgrade_all/in/implicit/three/Cargo.toml b/tests/cargo-upgrade/upgrade_all/in/implicit/three/Cargo.toml new file mode 100644 index 0000000000..05305ab0e5 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/in/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/upgrade_all/in/one/Cargo.toml b/tests/cargo-upgrade/upgrade_all/in/one/Cargo.toml new file mode 100644 index 0000000000..888063b0d3 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/in/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.0" +three = { path = "../implicit/three", version = "0.1.0" } diff --git a/tests/cargo-upgrade/upgrade_all/in/two/Cargo.toml b/tests/cargo-upgrade/upgrade_all/in/two/Cargo.toml new file mode 100644 index 0000000000..054a48778f --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/in/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/upgrade_all/mod.rs b/tests/cargo-upgrade/upgrade_all/mod.rs new file mode 100644 index 0000000000..d13f4d6fe6 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--all"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/upgrade_all/out/Cargo.lock b/tests/cargo-upgrade/upgrade_all/out/Cargo.lock new file mode 100644 index 0000000000..59bda66005 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/out/Cargo.lock @@ -0,0 +1,137 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "four" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "one" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "three 0.1.0", +] + +[[package]] +name = "rand" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "three" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "two" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" +"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" +"checksum log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f91d813fb009895c01b1b5c095fc88aea17138355bc0e4d53a277c466f62161f" +"checksum rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28cb601e872bcf1e2667d0433d2b5f2c53d37a6ca05e948fd1a977fa087e42e3" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/tests/cargo-upgrade/upgrade_all/out/Cargo.toml b/tests/cargo-upgrade/upgrade_all/out/Cargo.toml new file mode 100644 index 0000000000..165bb54e20 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/out/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] \ No newline at end of file diff --git a/tests/cargo-upgrade/upgrade_all/out/dummy.rs b/tests/cargo-upgrade/upgrade_all/out/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/upgrade_all/out/explicit/four/Cargo.toml b/tests/cargo-upgrade/upgrade_all/out/explicit/four/Cargo.toml new file mode 100644 index 0000000000..e4b5869168 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/out/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "99999.0.0" diff --git a/tests/cargo-upgrade/upgrade_all/out/implicit/three/Cargo.toml b/tests/cargo-upgrade/upgrade_all/out/implicit/three/Cargo.toml new file mode 100644 index 0000000000..3deb90aa4b --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/out/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "99999.0.0" diff --git a/tests/cargo-upgrade/upgrade_all/out/one/Cargo.toml b/tests/cargo-upgrade/upgrade_all/out/one/Cargo.toml new file mode 100644 index 0000000000..c4a66a88b4 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/out/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "99999.0.0" +three = { path = "../implicit/three", version = "0.1.0" } diff --git a/tests/cargo-upgrade/upgrade_all/out/two/Cargo.toml b/tests/cargo-upgrade/upgrade_all/out/two/Cargo.toml new file mode 100644 index 0000000000..bfcaff39d6 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/out/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "99999.0.0" diff --git a/tests/cargo-upgrade/upgrade_all/stderr.log b/tests/cargo-upgrade/upgrade_all/stderr.log new file mode 100644 index 0000000000..5e69b98ea1 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_all/stderr.log @@ -0,0 +1,10 @@ +The flag `--all` has been deprecated in favor of `--workspace` + Updating '[ROOTURL]/registry' index + Checking one's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 + Checking three's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 + Checking two's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 + Checking four's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 diff --git a/tests/cargo-upgrade/upgrade_all/stdout.log b/tests/cargo-upgrade/upgrade_all/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/upgrade_everything/in/Cargo.toml b/tests/cargo-upgrade/upgrade_everything/in/Cargo.toml new file mode 100644 index 0000000000..019788d4ba --- /dev/null +++ b/tests/cargo-upgrade/upgrade_everything/in/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "None" +version = "0.1.0" + +[lib] +path = "dummy.rs" + +[dependencies] +docopt = "0.8" +pad = "0.1" +serde_json = "1.0" +syn = { version = "0.11.10", default-features = false, features = ["parsing"] } +tar = { version = "0.4", default-features = false } +ftp = "2.2.1" +te = { package = "toml_edit", version = "0.1.5" } + +[dependencies.semver] +features = ["serde"] +version = "0.7" + +[dependencies.rn] +package = "renamed" +version = "0.1" + +[dev-dependencies] +assert_cli = "0.2.0" +tempdir = "0.3" + +[build-dependencies] +serde = { version = "1.0", git= "https://github.com/serde-rs/serde.git" } + +[target.'cfg(unix)'.dependencies] +openssl = "0.9" + +[target."windows.json"] +# let's make it an inline table +dependencies = { rget = "0.3.0" } + +[target.'cfg(target_arch = "x86_64")'.dev-dependencies] +geo = { version = "0.7.0", default-features = false, features = ["postgis-integration"] } + +[target.foo.build-dependencies] +ftp = "2.2.1" + +[features] +default = [] +test-external-apis = [] +unstable = [] diff --git a/tests/cargo-upgrade/upgrade_everything/in/src/lib.rs b/tests/cargo-upgrade/upgrade_everything/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/upgrade_everything/mod.rs b/tests/cargo-upgrade/upgrade_everything/mod.rs new file mode 100644 index 0000000000..c164b5dd2a --- /dev/null +++ b/tests/cargo-upgrade/upgrade_everything/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--pinned"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/upgrade_everything/out/Cargo.toml b/tests/cargo-upgrade/upgrade_everything/out/Cargo.toml new file mode 100644 index 0000000000..6309bdb730 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_everything/out/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "None" +version = "0.1.0" + +[lib] +path = "dummy.rs" + +[dependencies] +docopt = "99999.0" +pad = "99999.0" +serde_json = "99999.0" +syn = { version = "99999.0.0", default-features = false, features = ["parsing"] } +tar = { version = "99999.0", default-features = false } +ftp = "99999.0.0" +te = { package = "toml_edit", version = "99999.0.0" } + +[dependencies.semver] +features = ["serde"] +version = "99999.0" + +[dependencies.rn] +package = "renamed" +version = "99999.0" + +[dev-dependencies] +assert_cli = "99999.0.0" +tempdir = "99999.0" + +[build-dependencies] +serde = { version = "1.0", git= "https://github.com/serde-rs/serde.git" } + +[target.'cfg(unix)'.dependencies] +openssl = "99999.0" + +[target."windows.json"] +# let's make it an inline table +dependencies = { rget = "99999.0.0" } + +[target.'cfg(target_arch = "x86_64")'.dev-dependencies] +geo = { version = "99999.0.0", default-features = false, features = ["postgis-integration"] } + +[target.foo.build-dependencies] +ftp = "99999.0.0" + +[features] +default = [] +test-external-apis = [] +unstable = [] diff --git a/tests/cargo-upgrade/upgrade_everything/stderr.log b/tests/cargo-upgrade/upgrade_everything/stderr.log new file mode 100644 index 0000000000..5c00d837d8 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_everything/stderr.log @@ -0,0 +1,17 @@ + Updating '[ROOTURL]/registry' index + Checking None's dependencies + Upgrading docopt: v0.8 -> v99999.0 + Upgrading pad: v0.1 -> v99999.0 + Upgrading serde_json: v1.0 -> v99999.0 + Upgrading syn: v0.11.10 -> v99999.0.0 + Upgrading tar: v0.4 -> v99999.0 + Upgrading ftp: v2.2.1 -> v99999.0.0 + Upgrading te: v0.1.5 -> v99999.0.0 + Upgrading semver: v0.7 -> v99999.0 + Upgrading rn: v0.1 -> v99999.0 + Upgrading assert_cli: v0.2.0 -> v99999.0.0 + Upgrading tempdir: v0.3 -> v99999.0 + Upgrading openssl: v0.9 -> v99999.0 + Upgrading rget: v0.3.0 -> v99999.0.0 + Upgrading geo: v0.7.0 -> v99999.0.0 + Upgrading ftp: v2.2.1 -> v99999.0.0 diff --git a/tests/cargo-upgrade/upgrade_everything/stdout.log b/tests/cargo-upgrade/upgrade_everything/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/upgrade_renamed/in/Cargo.toml b/tests/cargo-upgrade/upgrade_renamed/in/Cargo.toml new file mode 100644 index 0000000000..8b9de9aff5 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_renamed/in/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[lib] +path = "dummy.rs" + +[dependencies] +m1 = { package = "my-package1", version = "0.1.1" } + +[dependencies.m2] +package = "my-package2" +version = "0.2" diff --git a/tests/cargo-upgrade/upgrade_renamed/in/src/lib.rs b/tests/cargo-upgrade/upgrade_renamed/in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/upgrade_renamed/mod.rs b/tests/cargo-upgrade/upgrade_renamed/mod.rs new file mode 100644 index 0000000000..a9cf401fdf --- /dev/null +++ b/tests/cargo-upgrade/upgrade_renamed/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--pinned", "--verbose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/upgrade_renamed/out/Cargo.toml b/tests/cargo-upgrade/upgrade_renamed/out/Cargo.toml new file mode 100644 index 0000000000..34067dfccd --- /dev/null +++ b/tests/cargo-upgrade/upgrade_renamed/out/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[lib] +path = "dummy.rs" + +[dependencies] +m1 = { package = "my-package1", version = "99999.0.0" } + +[dependencies.m2] +package = "my-package2" +version = "99999.0" diff --git a/tests/cargo-upgrade/upgrade_renamed/out/src/lib.rs b/tests/cargo-upgrade/upgrade_renamed/out/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/upgrade_renamed/stderr.log b/tests/cargo-upgrade/upgrade_renamed/stderr.log new file mode 100644 index 0000000000..63d86a46fa --- /dev/null +++ b/tests/cargo-upgrade/upgrade_renamed/stderr.log @@ -0,0 +1,4 @@ + Updating '[ROOTURL]/registry' index + Checking cargo-list-test-fixture's dependencies + Upgrading m1: v0.1.1 -> v99999.0.0 + Upgrading m2: v0.2 -> v99999.0 diff --git a/tests/cargo-upgrade/upgrade_renamed/stdout.log b/tests/cargo-upgrade/upgrade_renamed/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/upgrade_workspace/in/Cargo.lock b/tests/cargo-upgrade/upgrade_workspace/in/Cargo.lock new file mode 100644 index 0000000000..59bda66005 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/in/Cargo.lock @@ -0,0 +1,137 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "four" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "one" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "three 0.1.0", +] + +[[package]] +name = "rand" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "three" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "two" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" +"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" +"checksum log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f91d813fb009895c01b1b5c095fc88aea17138355bc0e4d53a277c466f62161f" +"checksum rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28cb601e872bcf1e2667d0433d2b5f2c53d37a6ca05e948fd1a977fa087e42e3" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/tests/cargo-upgrade/upgrade_workspace/in/Cargo.toml b/tests/cargo-upgrade/upgrade_workspace/in/Cargo.toml new file mode 100644 index 0000000000..165bb54e20 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/in/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] \ No newline at end of file diff --git a/tests/cargo-upgrade/upgrade_workspace/in/dummy.rs b/tests/cargo-upgrade/upgrade_workspace/in/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/upgrade_workspace/in/explicit/four/Cargo.toml b/tests/cargo-upgrade/upgrade_workspace/in/explicit/four/Cargo.toml new file mode 100644 index 0000000000..1f61e45a1a --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/in/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/upgrade_workspace/in/implicit/three/Cargo.toml b/tests/cargo-upgrade/upgrade_workspace/in/implicit/three/Cargo.toml new file mode 100644 index 0000000000..05305ab0e5 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/in/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/upgrade_workspace/in/one/Cargo.toml b/tests/cargo-upgrade/upgrade_workspace/in/one/Cargo.toml new file mode 100644 index 0000000000..888063b0d3 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/in/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.0" +three = { path = "../implicit/three", version = "0.1.0" } diff --git a/tests/cargo-upgrade/upgrade_workspace/in/two/Cargo.toml b/tests/cargo-upgrade/upgrade_workspace/in/two/Cargo.toml new file mode 100644 index 0000000000..054a48778f --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/in/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/upgrade_workspace/mod.rs b/tests/cargo-upgrade/upgrade_workspace/mod.rs new file mode 100644 index 0000000000..353cb62322 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--workspace"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/upgrade_workspace/out/Cargo.lock b/tests/cargo-upgrade/upgrade_workspace/out/Cargo.lock new file mode 100644 index 0000000000..59bda66005 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/out/Cargo.lock @@ -0,0 +1,137 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "four" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "one" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "three 0.1.0", +] + +[[package]] +name = "rand" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "three" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "two" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" +"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" +"checksum log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f91d813fb009895c01b1b5c095fc88aea17138355bc0e4d53a277c466f62161f" +"checksum rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28cb601e872bcf1e2667d0433d2b5f2c53d37a6ca05e948fd1a977fa087e42e3" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/tests/cargo-upgrade/upgrade_workspace/out/Cargo.toml b/tests/cargo-upgrade/upgrade_workspace/out/Cargo.toml new file mode 100644 index 0000000000..165bb54e20 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/out/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] \ No newline at end of file diff --git a/tests/cargo-upgrade/upgrade_workspace/out/dummy.rs b/tests/cargo-upgrade/upgrade_workspace/out/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/upgrade_workspace/out/explicit/four/Cargo.toml b/tests/cargo-upgrade/upgrade_workspace/out/explicit/four/Cargo.toml new file mode 100644 index 0000000000..e4b5869168 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/out/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "99999.0.0" diff --git a/tests/cargo-upgrade/upgrade_workspace/out/implicit/three/Cargo.toml b/tests/cargo-upgrade/upgrade_workspace/out/implicit/three/Cargo.toml new file mode 100644 index 0000000000..3deb90aa4b --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/out/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "99999.0.0" diff --git a/tests/cargo-upgrade/upgrade_workspace/out/one/Cargo.toml b/tests/cargo-upgrade/upgrade_workspace/out/one/Cargo.toml new file mode 100644 index 0000000000..c4a66a88b4 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/out/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "99999.0.0" +three = { path = "../implicit/three", version = "0.1.0" } diff --git a/tests/cargo-upgrade/upgrade_workspace/out/two/Cargo.toml b/tests/cargo-upgrade/upgrade_workspace/out/two/Cargo.toml new file mode 100644 index 0000000000..bfcaff39d6 --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/out/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "99999.0.0" diff --git a/tests/cargo-upgrade/upgrade_workspace/stderr.log b/tests/cargo-upgrade/upgrade_workspace/stderr.log new file mode 100644 index 0000000000..2d14b0b4de --- /dev/null +++ b/tests/cargo-upgrade/upgrade_workspace/stderr.log @@ -0,0 +1,9 @@ + Updating '[ROOTURL]/registry' index + Checking one's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 + Checking three's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 + Checking two's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 + Checking four's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 diff --git a/tests/cargo-upgrade/upgrade_workspace/stdout.log b/tests/cargo-upgrade/upgrade_workspace/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/virtual_manifest/in/Cargo.lock b/tests/cargo-upgrade/virtual_manifest/in/Cargo.lock new file mode 100644 index 0000000000..59bda66005 --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/in/Cargo.lock @@ -0,0 +1,137 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "four" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "one" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "three 0.1.0", +] + +[[package]] +name = "rand" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "three" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "two" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" +"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" +"checksum log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f91d813fb009895c01b1b5c095fc88aea17138355bc0e4d53a277c466f62161f" +"checksum rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28cb601e872bcf1e2667d0433d2b5f2c53d37a6ca05e948fd1a977fa087e42e3" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/tests/cargo-upgrade/virtual_manifest/in/Cargo.toml b/tests/cargo-upgrade/virtual_manifest/in/Cargo.toml new file mode 100644 index 0000000000..165bb54e20 --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/in/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] \ No newline at end of file diff --git a/tests/cargo-upgrade/virtual_manifest/in/dummy.rs b/tests/cargo-upgrade/virtual_manifest/in/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/virtual_manifest/in/explicit/four/Cargo.toml b/tests/cargo-upgrade/virtual_manifest/in/explicit/four/Cargo.toml new file mode 100644 index 0000000000..1f61e45a1a --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/in/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/virtual_manifest/in/implicit/three/Cargo.toml b/tests/cargo-upgrade/virtual_manifest/in/implicit/three/Cargo.toml new file mode 100644 index 0000000000..05305ab0e5 --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/in/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/virtual_manifest/in/one/Cargo.toml b/tests/cargo-upgrade/virtual_manifest/in/one/Cargo.toml new file mode 100644 index 0000000000..888063b0d3 --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/in/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.0" +three = { path = "../implicit/three", version = "0.1.0" } diff --git a/tests/cargo-upgrade/virtual_manifest/in/two/Cargo.toml b/tests/cargo-upgrade/virtual_manifest/in/two/Cargo.toml new file mode 100644 index 0000000000..054a48778f --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/in/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/virtual_manifest/mod.rs b/tests/cargo-upgrade/virtual_manifest/mod.rs new file mode 100644 index 0000000000..c16008b1b0 --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["--manifest-path", "Cargo.toml"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/virtual_manifest/out/Cargo.lock b/tests/cargo-upgrade/virtual_manifest/out/Cargo.lock new file mode 100644 index 0000000000..59bda66005 --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/out/Cargo.lock @@ -0,0 +1,137 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "four" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "one" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "three 0.1.0", +] + +[[package]] +name = "rand" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "three" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "two" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" +"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" +"checksum log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f91d813fb009895c01b1b5c095fc88aea17138355bc0e4d53a277c466f62161f" +"checksum rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28cb601e872bcf1e2667d0433d2b5f2c53d37a6ca05e948fd1a977fa087e42e3" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/tests/cargo-upgrade/virtual_manifest/out/Cargo.toml b/tests/cargo-upgrade/virtual_manifest/out/Cargo.toml new file mode 100644 index 0000000000..165bb54e20 --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/out/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] \ No newline at end of file diff --git a/tests/cargo-upgrade/virtual_manifest/out/dummy.rs b/tests/cargo-upgrade/virtual_manifest/out/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/virtual_manifest/out/explicit/four/Cargo.toml b/tests/cargo-upgrade/virtual_manifest/out/explicit/four/Cargo.toml new file mode 100644 index 0000000000..e4b5869168 --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/out/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "99999.0.0" diff --git a/tests/cargo-upgrade/virtual_manifest/out/implicit/three/Cargo.toml b/tests/cargo-upgrade/virtual_manifest/out/implicit/three/Cargo.toml new file mode 100644 index 0000000000..3deb90aa4b --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/out/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "99999.0.0" diff --git a/tests/cargo-upgrade/virtual_manifest/out/one/Cargo.toml b/tests/cargo-upgrade/virtual_manifest/out/one/Cargo.toml new file mode 100644 index 0000000000..c4a66a88b4 --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/out/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "99999.0.0" +three = { path = "../implicit/three", version = "0.1.0" } diff --git a/tests/cargo-upgrade/virtual_manifest/out/two/Cargo.toml b/tests/cargo-upgrade/virtual_manifest/out/two/Cargo.toml new file mode 100644 index 0000000000..bfcaff39d6 --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/out/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "99999.0.0" diff --git a/tests/cargo-upgrade/virtual_manifest/stderr.log b/tests/cargo-upgrade/virtual_manifest/stderr.log new file mode 100644 index 0000000000..2d14b0b4de --- /dev/null +++ b/tests/cargo-upgrade/virtual_manifest/stderr.log @@ -0,0 +1,9 @@ + Updating '[ROOTURL]/registry' index + Checking one's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 + Checking three's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 + Checking two's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 + Checking four's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 diff --git a/tests/cargo-upgrade/virtual_manifest/stdout.log b/tests/cargo-upgrade/virtual_manifest/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/workspace_member_cwd/in/Cargo.lock b/tests/cargo-upgrade/workspace_member_cwd/in/Cargo.lock new file mode 100644 index 0000000000..59bda66005 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/in/Cargo.lock @@ -0,0 +1,137 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "four" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "one" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "three 0.1.0", +] + +[[package]] +name = "rand" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "three" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "two" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" +"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" +"checksum log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f91d813fb009895c01b1b5c095fc88aea17138355bc0e4d53a277c466f62161f" +"checksum rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28cb601e872bcf1e2667d0433d2b5f2c53d37a6ca05e948fd1a977fa087e42e3" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/tests/cargo-upgrade/workspace_member_cwd/in/Cargo.toml b/tests/cargo-upgrade/workspace_member_cwd/in/Cargo.toml new file mode 100644 index 0000000000..85f0efa783 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/in/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] diff --git a/tests/cargo-upgrade/workspace_member_cwd/in/dummy.rs b/tests/cargo-upgrade/workspace_member_cwd/in/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/workspace_member_cwd/in/explicit/four/Cargo.toml b/tests/cargo-upgrade/workspace_member_cwd/in/explicit/four/Cargo.toml new file mode 100644 index 0000000000..1070488791 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/in/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.0" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/workspace_member_cwd/in/implicit/three/Cargo.toml b/tests/cargo-upgrade/workspace_member_cwd/in/implicit/three/Cargo.toml new file mode 100644 index 0000000000..3953740319 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/in/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.0" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/workspace_member_cwd/in/one/Cargo.toml b/tests/cargo-upgrade/workspace_member_cwd/in/one/Cargo.toml new file mode 100644 index 0000000000..630108f833 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/in/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "0.1.1" +three = { path = "../implicit/three"} diff --git a/tests/cargo-upgrade/workspace_member_cwd/in/two/Cargo.toml b/tests/cargo-upgrade/workspace_member_cwd/in/two/Cargo.toml new file mode 100644 index 0000000000..1614378880 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/in/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/workspace_member_cwd/mod.rs b/tests/cargo-upgrade/workspace_member_cwd/mod.rs new file mode 100644 index 0000000000..9894b9a351 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = project_root.join("one"); + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["my-package"]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/workspace_member_cwd/out/Cargo.lock b/tests/cargo-upgrade/workspace_member_cwd/out/Cargo.lock new file mode 100644 index 0000000000..59bda66005 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/out/Cargo.lock @@ -0,0 +1,137 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "four" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "one" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "three 0.1.0", +] + +[[package]] +name = "rand" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "three" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "two" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" +"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" +"checksum log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f91d813fb009895c01b1b5c095fc88aea17138355bc0e4d53a277c466f62161f" +"checksum rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28cb601e872bcf1e2667d0433d2b5f2c53d37a6ca05e948fd1a977fa087e42e3" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/tests/cargo-upgrade/workspace_member_cwd/out/Cargo.toml b/tests/cargo-upgrade/workspace_member_cwd/out/Cargo.toml new file mode 100644 index 0000000000..85f0efa783 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/out/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] diff --git a/tests/cargo-upgrade/workspace_member_cwd/out/dummy.rs b/tests/cargo-upgrade/workspace_member_cwd/out/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/workspace_member_cwd/out/explicit/four/Cargo.toml b/tests/cargo-upgrade/workspace_member_cwd/out/explicit/four/Cargo.toml new file mode 100644 index 0000000000..1070488791 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/out/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.0" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/workspace_member_cwd/out/implicit/three/Cargo.toml b/tests/cargo-upgrade/workspace_member_cwd/out/implicit/three/Cargo.toml new file mode 100644 index 0000000000..3953740319 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/out/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.0" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/workspace_member_cwd/out/one/Cargo.toml b/tests/cargo-upgrade/workspace_member_cwd/out/one/Cargo.toml new file mode 100644 index 0000000000..7aa443bcf9 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/out/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "99999.0.0" +three = { path = "../implicit/three"} diff --git a/tests/cargo-upgrade/workspace_member_cwd/out/two/Cargo.toml b/tests/cargo-upgrade/workspace_member_cwd/out/two/Cargo.toml new file mode 100644 index 0000000000..1614378880 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/out/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "0.1.1" diff --git a/tests/cargo-upgrade/workspace_member_cwd/stderr.log b/tests/cargo-upgrade/workspace_member_cwd/stderr.log new file mode 100644 index 0000000000..a6ca9ef75f --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_cwd/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking one's dependencies + Upgrading my-package: v0.1.1 -> v99999.0.0 diff --git a/tests/cargo-upgrade/workspace_member_cwd/stdout.log b/tests/cargo-upgrade/workspace_member_cwd/stdout.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/in/Cargo.lock b/tests/cargo-upgrade/workspace_member_manifest_path/in/Cargo.lock new file mode 100644 index 0000000000..59bda66005 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/in/Cargo.lock @@ -0,0 +1,137 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "four" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "one" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "three 0.1.0", +] + +[[package]] +name = "rand" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "three" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "two" +version = "0.1.0" +dependencies = [ + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" +"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" +"checksum log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f91d813fb009895c01b1b5c095fc88aea17138355bc0e4d53a277c466f62161f" +"checksum rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28cb601e872bcf1e2667d0433d2b5f2c53d37a6ca05e948fd1a977fa087e42e3" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/in/Cargo.toml b/tests/cargo-upgrade/workspace_member_manifest_path/in/Cargo.toml new file mode 100644 index 0000000000..165bb54e20 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/in/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] \ No newline at end of file diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/in/dummy.rs b/tests/cargo-upgrade/workspace_member_manifest_path/in/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/in/explicit/four/Cargo.toml b/tests/cargo-upgrade/workspace_member_manifest_path/in/explicit/four/Cargo.toml new file mode 100644 index 0000000000..1f61e45a1a --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/in/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/in/implicit/three/Cargo.toml b/tests/cargo-upgrade/workspace_member_manifest_path/in/implicit/three/Cargo.toml new file mode 100644 index 0000000000..05305ab0e5 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/in/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/in/one/Cargo.toml b/tests/cargo-upgrade/workspace_member_manifest_path/in/one/Cargo.toml new file mode 100644 index 0000000000..888063b0d3 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/in/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.0" +three = { path = "../implicit/three", version = "0.1.0" } diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/in/two/Cargo.toml b/tests/cargo-upgrade/workspace_member_manifest_path/in/two/Cargo.toml new file mode 100644 index 0000000000..054a48778f --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/in/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/mod.rs b/tests/cargo-upgrade/workspace_member_manifest_path/mod.rs new file mode 100644 index 0000000000..b863713b7e --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::Project; + +use crate::init_registry; +use crate::CargoCommand; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = project_root.join("one"); + + snapbox::cmd::Command::cargo_ui() + .arg("upgrade") + .args(["my-package", "--manifest-path", "Cargo.toml"]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/out/Cargo.toml b/tests/cargo-upgrade/workspace_member_manifest_path/out/Cargo.toml new file mode 100644 index 0000000000..165bb54e20 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/out/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "one", + "two", + "explicit/*" +] \ No newline at end of file diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/out/dummy.rs b/tests/cargo-upgrade/workspace_member_manifest_path/out/dummy.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/out/explicit/four/Cargo.toml b/tests/cargo-upgrade/workspace_member_manifest_path/out/explicit/four/Cargo.toml new file mode 100644 index 0000000000..1f61e45a1a --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/out/explicit/four/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "four" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/out/implicit/three/Cargo.toml b/tests/cargo-upgrade/workspace_member_manifest_path/out/implicit/three/Cargo.toml new file mode 100644 index 0000000000..05305ab0e5 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/out/implicit/three/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "three" +version = "0.1.5" + +[lib] +path = "../../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/out/one/Cargo.toml b/tests/cargo-upgrade/workspace_member_manifest_path/out/one/Cargo.toml new file mode 100644 index 0000000000..c4a66a88b4 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/out/one/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "one" +version = "0.1.0" + +[lib] +path = "../dummy.rs" + +[dependencies] +my-package = "99999.0.0" +three = { path = "../implicit/three", version = "0.1.0" } diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/out/two/Cargo.toml b/tests/cargo-upgrade/workspace_member_manifest_path/out/two/Cargo.toml new file mode 100644 index 0000000000..054a48778f --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/out/two/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "two" +version = "0.1.0" + +[[bin]] +name = "two" +path = "../dummy.rs" + +[dependencies] +my-package = "0.2.0" diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/stderr.log b/tests/cargo-upgrade/workspace_member_manifest_path/stderr.log new file mode 100644 index 0000000000..241801fb91 --- /dev/null +++ b/tests/cargo-upgrade/workspace_member_manifest_path/stderr.log @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Checking one's dependencies + Upgrading my-package: v0.2.0 -> v99999.0.0 diff --git a/tests/cargo-upgrade/workspace_member_manifest_path/stdout.log b/tests/cargo-upgrade/workspace_member_manifest_path/stdout.log new file mode 100644 index 0000000000..e69de29bb2 From aea37fc298033404171084032781885ad6bf941c Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 27 Jul 2022 13:14:58 -0500 Subject: [PATCH 2/2] chore(ci): Get full coverage on failure --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf8f49dd4a..faefc68260 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,7 @@ jobs: build: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] toolchain: [stable, beta, nightly]