Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize integration tests as one crate with many modules. Issue #4867. Rebased V3 #5063

Merged
merged 3 commits into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,15 @@ features = [

[dev-dependencies]
bufstream = "0.1"
cargotest = { path = "tests/cargotest", version = "0.1" }
cargotest = { path = "tests/testsuite/cargotest", version = "0.1" }
filetime = "0.1"
hamcrest = "=0.1.1"

[[bin]]
name = "cargo"
test = false
doc = false

[[test]]
name = "testsuite"
path = "tests/testsuite/lib.rs"
3 changes: 0 additions & 3 deletions tests/alt-registry.rs → tests/testsuite/alt_registry.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate cargotest;
extern crate hamcrest;

use cargotest::ChannelChanger;
use cargotest::support::registry::{self, Package, alt_api_path};
use cargotest::support::{paths, project, execs};
Expand Down
3 changes: 0 additions & 3 deletions tests/bad-config.rs → tests/testsuite/bad_config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate cargotest;
extern crate hamcrest;

use cargotest::support::{project, execs};
use cargotest::support::registry::Package;
use hamcrest::assert_that;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate hamcrest;
extern crate cargotest;

use cargotest::support::{project, execs, main_file, basic_bin_manifest};
use hamcrest::{assert_that};

Expand Down
4 changes: 0 additions & 4 deletions tests/bench.rs → tests/testsuite/bench.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
extern crate cargotest;
extern crate cargo;
extern crate hamcrest;

use std::str;

use cargo::util::process;
Expand Down
6 changes: 0 additions & 6 deletions tests/build.rs → tests/testsuite/build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
extern crate cargo;
#[macro_use]
extern crate cargotest;
extern crate hamcrest;
extern crate tempdir;

use std::env;
use std::fs::{self, File};
use std::io::prelude::*;
Expand Down
7 changes: 2 additions & 5 deletions tests/build-auth.rs → tests/testsuite/build_auth.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
extern crate bufstream;
extern crate git2;
extern crate cargotest;
extern crate hamcrest;

use std;
use std::collections::HashSet;
use std::io::prelude::*;
use std::net::TcpListener;
use std::thread;

use git2;
use bufstream::BufStream;
use cargotest::support::paths;
use cargotest::support::{project, execs};
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions tests/build-script.rs → tests/testsuite/build_script.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate cargotest;
extern crate hamcrest;

use std::env;
use std::fs::{self, File};
use std::io::prelude::*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate cargotest;
extern crate hamcrest;

use std::fs::File;

use cargotest::sleep_ms;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate cargotest;
extern crate hamcrest;
use cargotest::support::{project, execs, basic_bin_manifest};
use hamcrest::{assert_that};

Expand Down
5 changes: 1 addition & 4 deletions tests/cargo.rs → tests/testsuite/cargo_command.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
extern crate cargo;
extern crate cargotest;
extern crate hamcrest;

use std::env;
use std::fs::{self, File};
use std::io::prelude::*;
use std::path::{Path, PathBuf};
use std::str;

use cargo;
use cargotest::cargo_process;
use cargotest::support::paths::{self, CargoPathExt};
use cargotest::support::{execs, project, Project, basic_bin_manifest};
Expand Down
3 changes: 0 additions & 3 deletions tests/cargo-features.rs → tests/testsuite/cargo_features.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate cargotest;
extern crate hamcrest;

use cargotest::ChannelChanger;
use cargotest::support::{project, execs};
use hamcrest::assert_that;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = ["Alex Crichton <[email protected]>"]
path = "lib.rs"

[dependencies]
cargo = { path = "../.." }
cargo = { path = "../../.." }
filetime = "0.1"
flate2 = "1.0"
git2 = { version = "0.6", default-features = false }
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions tests/cfg.rs → tests/testsuite/cfg.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
extern crate cargo;
extern crate cargotest;
extern crate hamcrest;

use std::str::FromStr;
use std::fmt;

Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions tests/check.rs → tests/testsuite/check.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
extern crate cargotest;
extern crate hamcrest;
extern crate glob;

use cargotest::is_nightly;
use cargotest::support::{execs, project};
use cargotest::support::registry::Package;
Expand Down
3 changes: 0 additions & 3 deletions tests/clean.rs → tests/testsuite/clean.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate hamcrest;
extern crate cargotest;

use std::env;

use cargotest::support::{git, project, execs, main_file, basic_bin_manifest};
Expand Down
6 changes: 2 additions & 4 deletions tests/concurrent.rs → tests/testsuite/concurrent.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
extern crate cargotest;
extern crate git2;
extern crate hamcrest;

use std::{env, str};
use std::fs::{self, File};
use std::io::Write;
Expand All @@ -11,6 +7,8 @@ use std::thread;
use std::sync::mpsc::channel;
use std::time::Duration;

use git2;
use cargotest;
use cargotest::install::{has_installed_exe, cargo_home};
use cargotest::support::git;
use cargotest::support::registry::Package;
Expand Down
3 changes: 0 additions & 3 deletions tests/config.rs → tests/testsuite/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate hamcrest;
extern crate cargotest;

use cargotest::support::{project, execs};
use hamcrest::assert_that;

Expand Down
4 changes: 0 additions & 4 deletions tests/cross-compile.rs → tests/testsuite/cross_compile.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
extern crate cargo;
extern crate cargotest;
extern crate hamcrest;

use cargo::util::process;
use cargotest::{is_nightly, rustc_host};
use cargotest::support::{project, execs, basic_bin_manifest, cross_compile};
Expand Down
6 changes: 0 additions & 6 deletions tests/cross-publish.rs → tests/testsuite/cross_publish.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
extern crate cargo;
extern crate cargotest;
extern crate hamcrest;
extern crate flate2;
extern crate tar;

use std::fs::File;
use std::path::PathBuf;
use std::io::prelude::*;
Expand Down
9 changes: 2 additions & 7 deletions tests/death.rs → tests/testsuite/death.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
extern crate cargotest;
extern crate libc;
#[cfg(windows)]
extern crate winapi;

use std::fs;
use std::io::{self, Read};
use std::net::TcpListener;
Expand Down Expand Up @@ -33,8 +28,8 @@ fn enabled() -> bool {
let me = processthreadsapi::GetCurrentProcess();
let mut ret = 0;
let r = jobapi::IsProcessInJob(me, 0 as *mut _, &mut ret);
assert!(r != 0);
if ret == winapi::shared::minwindef::FALSE {
assert_ne!(r, 0);
if ret == ::winapi::shared::minwindef::FALSE {
return true
}

Expand Down
3 changes: 0 additions & 3 deletions tests/dep-info.rs → tests/testsuite/dep_info.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate cargotest;
extern crate hamcrest;

use cargotest::support::{basic_bin_manifest, main_file, execs, project};
use hamcrest::{assert_that, existing_file};

Expand Down
8 changes: 1 addition & 7 deletions tests/directory.rs → tests/testsuite/directory.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#[macro_use]
extern crate cargotest;
extern crate hamcrest;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;

use serde_json;
use std::collections::HashMap;
use std::fs::{self, File};
use std::io::prelude::*;
Expand Down
5 changes: 1 addition & 4 deletions tests/doc.rs → tests/testsuite/doc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
extern crate cargotest;
extern crate hamcrest;
extern crate cargo;

use cargotest;
use std::str;
use std::fs::{self, File};
use std::io::Read;
Expand Down
4 changes: 0 additions & 4 deletions tests/features.rs → tests/testsuite/features.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#[macro_use]
extern crate cargotest;
extern crate hamcrest;

use std::fs::File;
use std::io::prelude::*;

Expand Down
3 changes: 0 additions & 3 deletions tests/fetch.rs → tests/testsuite/fetch.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate cargotest;
extern crate hamcrest;

use cargotest::support::{project, execs};
use hamcrest::assert_that;

Expand Down
3 changes: 0 additions & 3 deletions tests/freshness.rs → tests/testsuite/freshness.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate cargotest;
extern crate hamcrest;

use std::fs::{self, File};
use std::io::prelude::*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate cargotest;
extern crate hamcrest;

use std::fs::{self, File};
use std::io::prelude::*;

Expand Down
6 changes: 1 addition & 5 deletions tests/git.rs → tests/testsuite/git.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
extern crate cargo;
extern crate cargotest;
extern crate git2;
extern crate hamcrest;

use git2;
use std::fs::{self, File};
use std::io::prelude::*;
use std::net::{TcpListener, TcpStream};
Expand Down
6 changes: 1 addition & 5 deletions tests/init.rs → tests/testsuite/init.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
extern crate cargotest;
extern crate cargo;
extern crate tempdir;
extern crate hamcrest;

use cargotest;
use std::fs::{self, File};
use std::io::prelude::*;
use std::env;
Expand Down
5 changes: 1 addition & 4 deletions tests/install.rs → tests/testsuite/install.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
extern crate cargo;
extern crate cargotest;
extern crate hamcrest;

use cargotest;
use std::fs::{self, File, OpenOptions};
use std::io::prelude::*;

Expand Down
3 changes: 0 additions & 3 deletions tests/jobserver.rs → tests/testsuite/jobserver.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate cargotest;
extern crate hamcrest;

use std::net::TcpListener;
use std::thread;
use std::process::Command;
Expand Down
82 changes: 82 additions & 0 deletions tests/testsuite/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
extern crate cargo;
#[macro_use]
extern crate cargotest;
extern crate hamcrest;
extern crate tempdir;
extern crate bufstream;
extern crate git2;
extern crate glob;
extern crate flate2;
extern crate tar;
extern crate libc;
#[cfg(windows)]
extern crate winapi;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate toml;
extern crate url;


mod alt_registry;
mod bad_config;
mod bad_manifest_path;
mod bench;
mod build_auth;
mod build_lib;
mod build;
mod build_script_env;
mod build_script;
mod cargo_alias_config;
mod cargo_features;
mod cargo_command;
mod cfg;
mod check;
mod clean;
mod concurrent;
mod config;
mod cross_compile;
mod cross_publish;
mod death;
mod dep_info;
mod directory;
mod doc;
mod features;
mod fetch;
mod freshness;
mod generate_lockfile;
mod git;
mod init;
mod install;
mod jobserver;
mod local_registry;
mod lockfile_compat;
mod login;
mod metadata;
mod net_config;
mod new;
mod overrides;
mod package;
mod patch;
mod path;
mod plugins;
mod proc_macro;
mod profiles;
mod publish;
mod read_manifest;
mod registry;
mod required_features;
mod resolve;
mod run;
mod rustc;
mod rustdocflags;
mod rustdoc;
mod rustflags;
mod search;
mod small_fd_limits;
mod test;
mod tool_paths;
mod verify_project;
mod version;
mod warn_on_failure;
mod workspaces;
4 changes: 0 additions & 4 deletions tests/local-registry.rs → tests/testsuite/local_registry.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#[macro_use]
extern crate cargotest;
extern crate hamcrest;

use std::fs::{self, File};
use std::io::prelude::*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate cargotest;
extern crate hamcrest;

use cargotest::support::git;
use cargotest::support::registry::Package;
use cargotest::support::{execs, project, lines_match};
Expand Down
Loading