Skip to content

Commit bb4a79b

Browse files
authored
Auto merge of #34220 - srinivasreddy:rf_cargotest, r=brson
run rustfmt on cargotest folder in src/tools/cargotest
2 parents 5755936 + 028073d commit bb4a79b

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

src/tools/cargotest/main.rs

+38-38
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,18 @@ struct Test {
2121
lock: Option<&'static str>,
2222
}
2323

24-
const TEST_REPOS: &'static [Test] = &[
25-
Test {
26-
name: "cargo",
27-
repo: "https://github.com/rust-lang/cargo",
28-
sha: "7d79da08238e3d47e0bc4406155bdcc45ccb8c82",
29-
lock: None,
30-
},
31-
Test {
32-
name: "iron",
33-
repo: "https://github.com/iron/iron",
34-
sha: "16c858ec2901e2992fe5e529780f59fa8ed12903",
35-
lock: Some(include_str!("lockfiles/iron-Cargo.lock")),
36-
},
37-
];
24+
const TEST_REPOS: &'static [Test] = &[Test {
25+
name: "cargo",
26+
repo: "https://github.com/rust-lang/cargo",
27+
sha: "7d79da08238e3d47e0bc4406155bdcc45ccb8c82",
28+
lock: None,
29+
},
30+
Test {
31+
name: "iron",
32+
repo: "https://github.com/iron/iron",
33+
sha: "16c858ec2901e2992fe5e529780f59fa8ed12903",
34+
lock: Some(include_str!("lockfiles/iron-Cargo.lock")),
35+
}];
3836

3937

4038
fn main() {
@@ -52,8 +50,10 @@ fn test_repo(cargo: &Path, out_dir: &Path, test: &Test) {
5250
println!("testing {}", test.repo);
5351
let dir = clone_repo(test, out_dir);
5452
if let Some(lockfile) = test.lock {
55-
File::create(&dir.join("Cargo.lock")).expect("")
56-
.write_all(lockfile.as_bytes()).expect("");
53+
File::create(&dir.join("Cargo.lock"))
54+
.expect("")
55+
.write_all(lockfile.as_bytes())
56+
.expect("");
5757
}
5858
if !run_cargo_test(cargo, &dir) {
5959
panic!("tests failed for {}", test.repo);
@@ -65,10 +65,10 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
6565

6666
if !out_dir.join(".git").is_dir() {
6767
let status = Command::new("git")
68-
.arg("init")
69-
.arg(&out_dir)
70-
.status()
71-
.expect("");
68+
.arg("init")
69+
.arg(&out_dir)
70+
.status()
71+
.expect("");
7272
assert!(status.success());
7373
}
7474

@@ -77,23 +77,23 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
7777
for depth in &[0, 1, 10, 100, 1000, 100000] {
7878
if *depth > 0 {
7979
let status = Command::new("git")
80-
.arg("fetch")
81-
.arg(test.repo)
82-
.arg("master")
83-
.arg(&format!("--depth={}", depth))
84-
.current_dir(&out_dir)
85-
.status()
86-
.expect("");
80+
.arg("fetch")
81+
.arg(test.repo)
82+
.arg("master")
83+
.arg(&format!("--depth={}", depth))
84+
.current_dir(&out_dir)
85+
.status()
86+
.expect("");
8787
assert!(status.success());
8888
}
8989

9090
let status = Command::new("git")
91-
.arg("reset")
92-
.arg(test.sha)
93-
.arg("--hard")
94-
.current_dir(&out_dir)
95-
.status()
96-
.expect("");
91+
.arg("reset")
92+
.arg(test.sha)
93+
.arg("--hard")
94+
.current_dir(&out_dir)
95+
.status()
96+
.expect("");
9797

9898
if status.success() {
9999
found = true;
@@ -105,11 +105,11 @@ fn clone_repo(test: &Test, out_dir: &Path) -> PathBuf {
105105
panic!("unable to find commit {}", test.sha)
106106
}
107107
let status = Command::new("git")
108-
.arg("clean")
109-
.arg("-fdx")
110-
.current_dir(&out_dir)
111-
.status()
112-
.unwrap();
108+
.arg("clean")
109+
.arg("-fdx")
110+
.current_dir(&out_dir)
111+
.status()
112+
.unwrap();
113113
assert!(status.success());
114114

115115
out_dir

0 commit comments

Comments
 (0)