Skip to content

Commit

Permalink
Auto merge of #5762 - dwijnand:test-mod-reorg, r=alexcrichton
Browse files Browse the repository at this point in the history
Reorganise the testsuite crate module hierarchy

* Collapse the nested cargotest::support module into the cargotest
  module (merge the mod.rs's)
* Rename the cargotest module to support
* Nest the top-level hamcrest module into support

Fixes #5744

I apologise ahead-of-time to the authors of the PRs this is going to break..
  • Loading branch information
bors committed Jul 22, 2018
2 parents ffcf739 + 43b42d6 commit 6b38295
Show file tree
Hide file tree
Showing 84 changed files with 476 additions and 485 deletions.
8 changes: 4 additions & 4 deletions tests/testsuite/alt_registry.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use cargotest::ChannelChanger;
use cargotest::support::registry::{self, alt_api_path, Package};
use cargotest::support::{execs, paths, project};
use hamcrest::assert_that;
use support::ChannelChanger;
use support::registry::{self, alt_api_path, Package};
use support::{execs, paths, project};
use support::hamcrest::assert_that;
use std::fs::File;
use std::io::Write;

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

#[test]
fn bad1() {
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/bad_manifest_path.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cargotest::support::{basic_bin_manifest, execs, main_file, project};
use hamcrest::assert_that;
use support::{basic_bin_manifest, execs, main_file, project};
use support::hamcrest::assert_that;

fn assert_not_a_cargo_toml(command: &str, manifest_path_argument: &str) {
let p = project()
Expand Down
8 changes: 4 additions & 4 deletions tests/testsuite/bench.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::str;

use cargo::util::process;
use cargotest::{is_nightly, ChannelChanger};
use cargotest::support::paths::CargoPathExt;
use cargotest::support::{basic_bin_manifest, basic_lib_manifest, execs, project};
use hamcrest::{assert_that, existing_file};
use support::{is_nightly, ChannelChanger};
use support::paths::CargoPathExt;
use support::{basic_bin_manifest, basic_lib_manifest, execs, project};
use support::hamcrest::{assert_that, existing_file};

#[test]
fn cargo_bench_simple() {
Expand Down
14 changes: 7 additions & 7 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use std::io::prelude::*;

use cargo::util::paths::dylib_path_envvar;
use cargo::util::{process, ProcessBuilder};
use cargotest::{is_nightly, rustc_host, sleep_ms};
use cargotest::support::paths::{root, CargoPathExt};
use cargotest::support::ProjectBuilder;
use cargotest::support::{basic_bin_manifest, execs, main_file, project};
use cargotest::support::registry::Package;
use cargotest::ChannelChanger;
use hamcrest::{assert_that, existing_dir, existing_file, is_not};
use support::{is_nightly, rustc_host, sleep_ms};
use support::paths::{root, CargoPathExt};
use support::ProjectBuilder;
use support::{basic_bin_manifest, execs, main_file, project};
use support::registry::Package;
use support::ChannelChanger;
use support::hamcrest::{assert_that, existing_dir, existing_file, is_not};
use tempfile;

#[test]
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/build_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use std::thread;

use git2;
use bufstream::BufStream;
use cargotest::support::paths;
use cargotest::support::{execs, project};
use hamcrest::assert_that;
use support::paths;
use support::{execs, project};
use support::hamcrest::assert_that;

// Test that HTTP auth is offered from `credential.helper`
#[test]
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/build_lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cargotest::support::{basic_bin_manifest, execs, project, Project};
use hamcrest::assert_that;
use support::{basic_bin_manifest, execs, project, Project};
use support::hamcrest::assert_that;

fn verbose_output_for_lib(p: &Project) -> String {
format!(
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/build_plan.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cargotest::ChannelChanger;
use cargotest::support::{basic_bin_manifest, execs, main_file, project};
use hamcrest::{assert_that, existing_file, is_not};
use support::ChannelChanger;
use support::{basic_bin_manifest, execs, main_file, project};
use support::hamcrest::{assert_that, existing_file, is_not};

#[test]
fn cargo_build_plan_simple() {
Expand Down
10 changes: 5 additions & 5 deletions tests/testsuite/build_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use std::thread;
use std::time::Duration;

use cargo::util::paths::remove_dir_all;
use cargotest::{rustc_host, sleep_ms};
use cargotest::support::{cross_compile, execs, project};
use cargotest::support::paths::CargoPathExt;
use cargotest::support::registry::Package;
use hamcrest::{assert_that, existing_dir, existing_file};
use support::{rustc_host, sleep_ms};
use support::{cross_compile, execs, project};
use support::paths::CargoPathExt;
use support::registry::Package;
use support::hamcrest::{assert_that, existing_dir, existing_file};

#[test]
fn custom_build_script_failed() {
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/build_script_env.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::fs::File;

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

#[test]
fn rerun_if_env_changes() {
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_alias_config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cargotest::support::{basic_bin_manifest, execs, project};
use hamcrest::assert_that;
use support::{basic_bin_manifest, execs, project};
use support::hamcrest::assert_that;

#[test]
fn alias_incorrect_config_type() {
Expand Down
10 changes: 5 additions & 5 deletions tests/testsuite/cargo_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use std::path::{Path, PathBuf};
use std::str;

use cargo;
use cargotest::cargo_process;
use cargotest::support::paths::{self, CargoPathExt};
use cargotest::support::registry::Package;
use cargotest::support::{basic_bin_manifest, cargo_exe, execs, project, Project};
use hamcrest::{assert_that, existing_file};
use support::cargo_process;
use support::paths::{self, CargoPathExt};
use support::registry::Package;
use support::{basic_bin_manifest, cargo_exe, execs, project, Project};
use support::hamcrest::{assert_that, existing_file};

#[cfg_attr(windows, allow(dead_code))]
enum FakeKind<'a> {
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/cargo_features.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cargotest::ChannelChanger;
use cargotest::support::{execs, project, publish};
use hamcrest::assert_that;
use support::ChannelChanger;
use support::{execs, project, publish};
use support::hamcrest::assert_that;

#[test]
fn feature_required() {
Expand Down
179 changes: 0 additions & 179 deletions tests/testsuite/cargotest/mod.rs

This file was deleted.

8 changes: 4 additions & 4 deletions tests/testsuite/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use std::str::FromStr;
use std::fmt;

use cargo::util::{Cfg, CfgExpr};
use cargotest::rustc_host;
use cargotest::support::registry::Package;
use cargotest::support::{execs, project};
use hamcrest::assert_that;
use support::rustc_host;
use support::registry::Package;
use support::{execs, project};
use support::hamcrest::assert_that;

macro_rules! c {
($a:ident) => (
Expand Down
12 changes: 6 additions & 6 deletions tests/testsuite/check.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use cargotest::install::exe;
use cargotest::is_nightly;
use cargotest::support::paths::CargoPathExt;
use cargotest::support::registry::Package;
use cargotest::support::{execs, project};
use support::install::exe;
use support::is_nightly;
use support::paths::CargoPathExt;
use support::registry::Package;
use support::{execs, project};
use glob::glob;
use hamcrest::{assert_that, existing_file, is_not};
use support::hamcrest::{assert_that, existing_file, is_not};

const SIMPLE_MANIFEST: &str = r#"
[package]
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/clean.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::env;

use cargotest::support::{basic_bin_manifest, execs, git, main_file, project};
use cargotest::support::registry::Package;
use hamcrest::{assert_that, existing_dir, existing_file, is_not};
use support::{basic_bin_manifest, execs, git, main_file, project};
use support::registry::Package;
use support::hamcrest::{assert_that, existing_dir, existing_file, is_not};

#[test]
fn cargo_clean_simple() {
Expand Down
Loading

0 comments on commit 6b38295

Please sign in to comment.