Skip to content

Commit 847f1f7

Browse files
committed
Auto merge of #5063 - Eh2406:TestssuiteV3, r=matklad
Reorganize integration tests as one crate with many modules. Issue #4867. Rebased V3 This is an automatic rebase of @rochamatcomp's work in #5022, as requested in [#5038](#5038 (comment)). I take no credit for the changes; I just wanted faster test for my work. :-)
2 parents b80af35 + 7a56457 commit 847f1f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+110
-239
lines changed

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,15 @@ features = [
8080

8181
[dev-dependencies]
8282
bufstream = "0.1"
83-
cargotest = { path = "tests/cargotest", version = "0.1" }
83+
cargotest = { path = "tests/testsuite/cargotest", version = "0.1" }
8484
filetime = "0.1"
8585
hamcrest = "=0.1.1"
8686

8787
[[bin]]
8888
name = "cargo"
8989
test = false
9090
doc = false
91+
92+
[[test]]
93+
name = "testsuite"
94+
path = "tests/testsuite/lib.rs"

tests/alt-registry.rs renamed to tests/testsuite/alt_registry.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
41
use cargotest::ChannelChanger;
52
use cargotest::support::registry::{self, Package, alt_api_path};
63
use cargotest::support::{paths, project, execs};

tests/bad-config.rs renamed to tests/testsuite/bad_config.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
41
use cargotest::support::{project, execs};
52
use cargotest::support::registry::Package;
63
use hamcrest::assert_that;

tests/bad-manifest-path.rs renamed to tests/testsuite/bad_manifest_path.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate hamcrest;
2-
extern crate cargotest;
3-
41
use cargotest::support::{project, execs, main_file, basic_bin_manifest};
52
use hamcrest::{assert_that};
63

tests/bench.rs renamed to tests/testsuite/bench.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
extern crate cargotest;
2-
extern crate cargo;
3-
extern crate hamcrest;
4-
51
use std::str;
62

73
use cargo::util::process;

tests/build.rs renamed to tests/testsuite/build.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
extern crate cargo;
2-
#[macro_use]
3-
extern crate cargotest;
4-
extern crate hamcrest;
5-
extern crate tempdir;
6-
71
use std::env;
82
use std::fs::{self, File};
93
use std::io::prelude::*;

tests/build-auth.rs renamed to tests/testsuite/build_auth.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
extern crate bufstream;
2-
extern crate git2;
3-
extern crate cargotest;
4-
extern crate hamcrest;
5-
1+
use std;
62
use std::collections::HashSet;
73
use std::io::prelude::*;
84
use std::net::TcpListener;
95
use std::thread;
106

7+
use git2;
118
use bufstream::BufStream;
129
use cargotest::support::paths;
1310
use cargotest::support::{project, execs};
File renamed without changes.

tests/build-script.rs renamed to tests/testsuite/build_script.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
41
use std::env;
52
use std::fs::{self, File};
63
use std::io::prelude::*;

tests/build-script-env.rs renamed to tests/testsuite/build_script_env.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
41
use std::fs::File;
52

63
use cargotest::sleep_ms;

tests/cargo_alias_config.rs renamed to tests/testsuite/cargo_alias_config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
31
use cargotest::support::{project, execs, basic_bin_manifest};
42
use hamcrest::{assert_that};
53

tests/cargo.rs renamed to tests/testsuite/cargo_command.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
extern crate cargo;
2-
extern crate cargotest;
3-
extern crate hamcrest;
4-
51
use std::env;
62
use std::fs::{self, File};
73
use std::io::prelude::*;
84
use std::path::{Path, PathBuf};
95
use std::str;
106

7+
use cargo;
118
use cargotest::cargo_process;
129
use cargotest::support::paths::{self, CargoPathExt};
1310
use cargotest::support::{execs, project, Project, basic_bin_manifest};

tests/cargo-features.rs renamed to tests/testsuite/cargo_features.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
41
use cargotest::ChannelChanger;
52
use cargotest::support::{project, execs};
63
use hamcrest::assert_that;

tests/cargotest/Cargo.toml renamed to tests/testsuite/cargotest/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = ["Alex Crichton <[email protected]>"]
77
path = "lib.rs"
88

99
[dependencies]
10-
cargo = { path = "../.." }
10+
cargo = { path = "../../.." }
1111
filetime = "0.1"
1212
flate2 = "1.0"
1313
git2 = { version = "0.6", default-features = false }
File renamed without changes.
File renamed without changes.

tests/cfg.rs renamed to tests/testsuite/cfg.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
extern crate cargo;
2-
extern crate cargotest;
3-
extern crate hamcrest;
4-
51
use std::str::FromStr;
62
use std::fmt;
73

File renamed without changes.

tests/check.rs renamed to tests/testsuite/check.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
extern crate glob;
4-
51
use cargotest::is_nightly;
62
use cargotest::support::{execs, project};
73
use cargotest::support::registry::Package;

tests/clean.rs renamed to tests/testsuite/clean.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate hamcrest;
2-
extern crate cargotest;
3-
41
use std::env;
52

63
use cargotest::support::{git, project, execs, main_file, basic_bin_manifest};

tests/concurrent.rs renamed to tests/testsuite/concurrent.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
extern crate cargotest;
2-
extern crate git2;
3-
extern crate hamcrest;
4-
51
use std::{env, str};
62
use std::fs::{self, File};
73
use std::io::Write;
@@ -11,6 +7,8 @@ use std::thread;
117
use std::sync::mpsc::channel;
128
use std::time::Duration;
139

10+
use git2;
11+
use cargotest;
1412
use cargotest::install::{has_installed_exe, cargo_home};
1513
use cargotest::support::git;
1614
use cargotest::support::registry::Package;

tests/config.rs renamed to tests/testsuite/config.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate hamcrest;
2-
extern crate cargotest;
3-
41
use cargotest::support::{project, execs};
52
use hamcrest::assert_that;
63

tests/cross-compile.rs renamed to tests/testsuite/cross_compile.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
extern crate cargo;
2-
extern crate cargotest;
3-
extern crate hamcrest;
4-
51
use cargo::util::process;
62
use cargotest::{is_nightly, rustc_host};
73
use cargotest::support::{project, execs, basic_bin_manifest, cross_compile};

tests/cross-publish.rs renamed to tests/testsuite/cross_publish.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
extern crate cargo;
2-
extern crate cargotest;
3-
extern crate hamcrest;
4-
extern crate flate2;
5-
extern crate tar;
6-
71
use std::fs::File;
82
use std::path::PathBuf;
93
use std::io::prelude::*;

tests/death.rs renamed to tests/testsuite/death.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
extern crate cargotest;
2-
extern crate libc;
3-
#[cfg(windows)]
4-
extern crate winapi;
5-
61
use std::fs;
72
use std::io::{self, Read};
83
use std::net::TcpListener;
@@ -33,8 +28,8 @@ fn enabled() -> bool {
3328
let me = processthreadsapi::GetCurrentProcess();
3429
let mut ret = 0;
3530
let r = jobapi::IsProcessInJob(me, 0 as *mut _, &mut ret);
36-
assert!(r != 0);
37-
if ret == winapi::shared::minwindef::FALSE {
31+
assert_ne!(r, 0);
32+
if ret == ::winapi::shared::minwindef::FALSE {
3833
return true
3934
}
4035

tests/dep-info.rs renamed to tests/testsuite/dep_info.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
41
use cargotest::support::{basic_bin_manifest, main_file, execs, project};
52
use hamcrest::{assert_that, existing_file};
63

tests/directory.rs renamed to tests/testsuite/directory.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
#[macro_use]
2-
extern crate cargotest;
3-
extern crate hamcrest;
4-
#[macro_use]
5-
extern crate serde_derive;
6-
extern crate serde_json;
7-
1+
use serde_json;
82
use std::collections::HashMap;
93
use std::fs::{self, File};
104
use std::io::prelude::*;

tests/doc.rs renamed to tests/testsuite/doc.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
extern crate cargo;
4-
1+
use cargotest;
52
use std::str;
63
use std::fs::{self, File};
74
use std::io::Read;

tests/features.rs renamed to tests/testsuite/features.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#[macro_use]
2-
extern crate cargotest;
3-
extern crate hamcrest;
4-
51
use std::fs::File;
62
use std::io::prelude::*;
73

tests/fetch.rs renamed to tests/testsuite/fetch.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
41
use cargotest::support::{project, execs};
52
use hamcrest::assert_that;
63

tests/freshness.rs renamed to tests/testsuite/freshness.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
41
use std::fs::{self, File};
52
use std::io::prelude::*;
63

tests/generate-lockfile.rs renamed to tests/testsuite/generate_lockfile.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
41
use std::fs::{self, File};
52
use std::io::prelude::*;
63

tests/git.rs renamed to tests/testsuite/git.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
extern crate cargo;
2-
extern crate cargotest;
3-
extern crate git2;
4-
extern crate hamcrest;
5-
1+
use git2;
62
use std::fs::{self, File};
73
use std::io::prelude::*;
84
use std::net::{TcpListener, TcpStream};

tests/init.rs renamed to tests/testsuite/init.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
extern crate cargotest;
2-
extern crate cargo;
3-
extern crate tempdir;
4-
extern crate hamcrest;
5-
1+
use cargotest;
62
use std::fs::{self, File};
73
use std::io::prelude::*;
84
use std::env;

tests/install.rs renamed to tests/testsuite/install.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
extern crate cargo;
2-
extern crate cargotest;
3-
extern crate hamcrest;
4-
1+
use cargotest;
52
use std::fs::{self, File, OpenOptions};
63
use std::io::prelude::*;
74

tests/jobserver.rs renamed to tests/testsuite/jobserver.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
41
use std::net::TcpListener;
52
use std::thread;
63
use std::process::Command;

tests/testsuite/lib.rs

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
extern crate cargo;
2+
#[macro_use]
3+
extern crate cargotest;
4+
extern crate hamcrest;
5+
extern crate tempdir;
6+
extern crate bufstream;
7+
extern crate git2;
8+
extern crate glob;
9+
extern crate flate2;
10+
extern crate tar;
11+
extern crate libc;
12+
#[cfg(windows)]
13+
extern crate winapi;
14+
#[macro_use]
15+
extern crate serde_derive;
16+
extern crate serde_json;
17+
extern crate toml;
18+
extern crate url;
19+
20+
21+
mod alt_registry;
22+
mod bad_config;
23+
mod bad_manifest_path;
24+
mod bench;
25+
mod build_auth;
26+
mod build_lib;
27+
mod build;
28+
mod build_script_env;
29+
mod build_script;
30+
mod cargo_alias_config;
31+
mod cargo_features;
32+
mod cargo_command;
33+
mod cfg;
34+
mod check;
35+
mod clean;
36+
mod concurrent;
37+
mod config;
38+
mod cross_compile;
39+
mod cross_publish;
40+
mod death;
41+
mod dep_info;
42+
mod directory;
43+
mod doc;
44+
mod features;
45+
mod fetch;
46+
mod freshness;
47+
mod generate_lockfile;
48+
mod git;
49+
mod init;
50+
mod install;
51+
mod jobserver;
52+
mod local_registry;
53+
mod lockfile_compat;
54+
mod login;
55+
mod metadata;
56+
mod net_config;
57+
mod new;
58+
mod overrides;
59+
mod package;
60+
mod patch;
61+
mod path;
62+
mod plugins;
63+
mod proc_macro;
64+
mod profiles;
65+
mod publish;
66+
mod read_manifest;
67+
mod registry;
68+
mod required_features;
69+
mod resolve;
70+
mod run;
71+
mod rustc;
72+
mod rustdocflags;
73+
mod rustdoc;
74+
mod rustflags;
75+
mod search;
76+
mod small_fd_limits;
77+
mod test;
78+
mod tool_paths;
79+
mod verify_project;
80+
mod version;
81+
mod warn_on_failure;
82+
mod workspaces;

tests/local-registry.rs renamed to tests/testsuite/local_registry.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#[macro_use]
2-
extern crate cargotest;
3-
extern crate hamcrest;
4-
51
use std::fs::{self, File};
62
use std::io::prelude::*;
73

tests/lockfile-compat.rs renamed to tests/testsuite/lockfile_compat.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate cargotest;
2-
extern crate hamcrest;
3-
41
use cargotest::support::git;
52
use cargotest::support::registry::Package;
63
use cargotest::support::{execs, project, lines_match};

0 commit comments

Comments
 (0)