Skip to content

Commit 4c7f9d0

Browse files
committed
Move pkg to testsuite/utils
1 parent ff31445 commit 4c7f9d0

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

tests/testsuite/install.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::path::PathBuf;
88
use std::thread;
99

1010
use crate::prelude::*;
11-
use crate::utils::cargo_process;
11+
use crate::utils::{cargo_process, pkg};
1212
use cargo_test_support::compare::assert_e2e;
1313
use cargo_test_support::cross_compile;
1414
use cargo_test_support::git;
@@ -21,16 +21,6 @@ use crate::utils::cross_compile::disabled as cross_compile_disabled;
2121
use cargo_test_support::install::{assert_has_installed_exe, assert_has_not_installed_exe, exe};
2222
use cargo_test_support::paths;
2323

24-
fn pkg(name: &str, vers: &str) {
25-
Package::new(name, vers)
26-
.file("src/lib.rs", "")
27-
.file(
28-
"src/main.rs",
29-
&format!("extern crate {}; fn main() {{}}", name),
30-
)
31-
.publish();
32-
}
33-
3424
#[cargo_test]
3525
fn simple() {
3626
pkg("foo", "0.0.1");

tests/testsuite/utils/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::path::PathBuf;
22

3+
use cargo_test_support::registry::Package;
34
use cargo_test_support::{ArgLineCommandExt, Execs, execs, process};
45

56
pub mod cross_compile;
@@ -19,3 +20,13 @@ pub fn cargo_process(arg_line: &str) -> Execs {
1920
pub fn cargo_exe() -> PathBuf {
2021
snapbox::cmd::cargo_bin!("cargo").to_path_buf()
2122
}
23+
24+
pub fn pkg(name: &str, vers: &str) {
25+
Package::new(name, vers)
26+
.file("src/lib.rs", "")
27+
.file(
28+
"src/main.rs",
29+
&format!("extern crate {}; fn main() {{}}", name),
30+
)
31+
.publish();
32+
}

0 commit comments

Comments
 (0)