feat(test): Add CargoPathExt to prelude

This commit is contained in:
Ed Page 2024-07-18 15:22:29 -05:00
parent 5d4ac652f5
commit 3a615ca9c8
35 changed files with 17 additions and 34 deletions

View file

@ -74,6 +74,7 @@ pub mod tools;
pub mod prelude {
pub use crate::cargo_test;
pub use crate::paths::CargoPathExt;
pub use crate::ArgLine;
pub use crate::CargoCommand;
pub use crate::ChannelChanger;

View file

@ -1,6 +1,5 @@
//! Tests for the `cargo bench` command.
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::{basic_bin_manifest, basic_lib_manifest, basic_manifest, project, str};

View file

@ -12,7 +12,7 @@ use cargo::{
GlobalContext,
};
use cargo_test_support::compare::assert_e2e;
use cargo_test_support::paths::{root, CargoPathExt};
use cargo_test_support::paths::root;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::str;

View file

@ -7,7 +7,6 @@ use std::thread;
use cargo_test_support::compare::assert_e2e;
use cargo_test_support::install::cargo_home;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::str;

View file

@ -3,7 +3,7 @@
use std::thread::JoinHandle;
use cargo::util::cache_lock::{CacheLockMode, CacheLocker};
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use cargo_test_support::prelude::*;
use cargo_test_support::{retry, thread_wait_timeout, threaded_timeout};

View file

@ -8,7 +8,6 @@ use std::process::Stdio;
use std::str;
use cargo_test_support::basic_manifest;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::str;

View file

@ -4,7 +4,6 @@ use std::fmt::{self, Write};
use cargo_test_support::compare::assert_e2e;
use cargo_test_support::install::exe;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::str;

View file

@ -1,6 +1,5 @@
//! Tests for the `cargo clean` command.
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::str;

View file

@ -6,7 +6,7 @@ use std::path::Path;
use std::str;
use cargo_test_support::compare::assert_e2e;
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::str;

View file

@ -4,7 +4,6 @@ use std::fs;
use std::str;
use cargo::core::compiler::RustDocFingerprint;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::str;

View file

@ -1,6 +1,5 @@
//! Tests for `[features]` table.
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::{Dependency, Package};
use cargo_test_support::str;

View file

@ -4,7 +4,6 @@ use std::fs::File;
use cargo_test_support::cross_compile::{self, alternate};
use cargo_test_support::install::cargo_home;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::publish::validate_crate_contents;
use cargo_test_support::registry::{Dependency, Package};

View file

@ -3,7 +3,7 @@
use cargo::core::Edition;
use cargo_test_support::compare::assert_e2e;
use cargo_test_support::git::{self, init};
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::{Dependency, Package};
use cargo_test_support::str;

View file

@ -9,7 +9,7 @@ use std::process::Stdio;
use std::thread;
use std::time::SystemTime;
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::{

View file

@ -10,7 +10,7 @@ use std::sync::Arc;
use std::thread;
use cargo_test_support::git::cargo_uses_gitoxide;
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use cargo_test_support::prelude::IntoData;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;

View file

@ -20,7 +20,7 @@ use cargo::core::global_cache_tracker::{self, DeferredGlobalLastUse, GlobalCache
use cargo::util::cache_lock::CacheLockMode;
use cargo::util::interning::InternedString;
use cargo::GlobalContext;
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::{Package, RegistryBuilder};
use cargo_test_support::{

View file

@ -21,7 +21,7 @@ use cargo_util::{ProcessBuilder, ProcessError};
use cargo_test_support::install::{
assert_has_installed_exe, assert_has_not_installed_exe, cargo_home, exe,
};
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
fn pkg(name: &str, vers: &str) {
Package::new(name, vers)

View file

@ -8,7 +8,6 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use cargo::core::PackageId;
use cargo_test_support::install::{cargo_home, exe};
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::{self, Package};
use cargo_test_support::{

View file

@ -2,7 +2,7 @@
use std::fs;
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::{registry_path, Package};
use cargo_test_support::{basic_manifest, project, str, t};

View file

@ -4,7 +4,7 @@ use std::fs;
use std::path::PathBuf;
use cargo_test_support::cargo_process;
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::{self, RegistryBuilder};
use cargo_test_support::str;

View file

@ -1,7 +1,7 @@
//! Tests for the `cargo logout` command.
use super::login::check_token;
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::TestRegistry;
use cargo_test_support::{cargo_process, registry, str};

View file

@ -15,7 +15,6 @@
use std::fs;
use cargo::CargoResult;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::{self, Dependency, Package};
use cargo_test_support::{cargo_exe, execs, paths, process, project, rustc_host};

View file

@ -2,7 +2,6 @@
use std::fs;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::project;
use cargo_test_support::registry::{self, api_path};

View file

@ -3,7 +3,6 @@
use std::fs::{self, read_to_string, File};
use std::path::Path;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::publish::validate_crate_contents;
use cargo_test_support::registry::{self, Package};

View file

@ -2,7 +2,7 @@
use std::fs;
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::str;

View file

@ -1,6 +1,5 @@
//! Tests for profiles defined in config files.
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::{basic_lib_manifest, paths, project, str};

View file

@ -1,6 +1,5 @@
//! Tests for named profiles.
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::{basic_lib_manifest, project, str};

View file

@ -8,7 +8,7 @@ use std::sync::Mutex;
use cargo::core::SourceId;
use cargo_test_support::cargo_process;
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::{
self, registry_path, Dependency, Package, RegistryBuilder, Response, TestRegistry,

View file

@ -4,7 +4,6 @@ use cargo_test_support::install::{
assert_has_installed_exe, assert_has_not_installed_exe, cargo_home,
};
use cargo_test_support::is_nightly;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::project;
use cargo_test_support::str;

View file

@ -1603,7 +1603,7 @@ fn print_env_verbose() {
#[cargo_test]
#[cfg(target_os = "macos")]
fn run_link_system_path_macos() {
use cargo_test_support::paths::{self, CargoPathExt};
use cargo_test_support::paths;
use std::fs;
// Check that the default system library path is honored.
// First, build a shared library that will be accessed from

View file

@ -2,8 +2,8 @@
use std::env;
use cargo_test_support::basic_bin_manifest;
use cargo_test_support::prelude::*;
use cargo_test_support::{basic_bin_manifest, paths::CargoPathExt};
use cargo_test_support::{basic_manifest, project};
const MISS: &str = "[..] rustc info cache miss[..]";

View file

@ -6,7 +6,7 @@ use std::ffi::OsString;
use std::fs;
use std::path::{Path, PathBuf};
use cargo_test_support::paths::{home, root, CargoPathExt};
use cargo_test_support::paths::{home, root};
use cargo_test_support::prelude::*;
use cargo_test_support::{cargo_process, process, project, str};

View file

@ -2,7 +2,6 @@
use std::fs;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::Package;
use cargo_test_support::{

View file

@ -2,7 +2,6 @@
use std::fmt::Write;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::registry::{Dependency, Package, RegistryBuilder};
use cargo_test_support::str;

View file

@ -2,7 +2,6 @@
use std::fs;
use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::prelude::*;
use cargo_test_support::project;
use cargo_test_support::registry;