]> git.lizzy.rs Git - rust.git/commitdiff
Move the TestPaths structure from libtest to compiletest.
authorEd Schouten <ed@nuxi.nl>
Mon, 1 Jan 2018 18:30:19 +0000 (19:30 +0100)
committerEd Schouten <ed@nuxi.nl>
Mon, 1 Jan 2018 18:30:19 +0000 (19:30 +0100)
This structure doesn't seem to be used by libtest itself. It is used by
compiletest, but never passed on to anything externally. This makes it
easier to get the testing framework to work for CloudABI crossbuilds, as
CloudABI currently lacks PathBuf, which is used by TestPaths.

src/libtest/lib.rs
src/tools/compiletest/src/common.rs
src/tools/compiletest/src/main.rs
src/tools/compiletest/src/runtest.rs

index 0d837c470a223dd7c3ae2ae20354a62ecd097407..839f697b39cfaf5a089edbb1469d7536dd5cff1b 100644 (file)
@@ -203,13 +203,6 @@ pub struct TestDesc {
     pub allow_fail: bool,
 }
 
-#[derive(Clone)]
-pub struct TestPaths {
-    pub file: PathBuf,         // e.g., compile-test/foo/bar/baz.rs
-    pub base: PathBuf,         // e.g., compile-test, auxiliary
-    pub relative_dir: PathBuf, // e.g., foo/bar
-}
-
 #[derive(Debug)]
 pub struct TestDescAndFn {
     pub desc: TestDesc,
index 48c3c5c819862a406d129363d1a23303a288dd55..1d8cef05b7dd3408f0e330c0cd529d8f49a89faf 100644 (file)
@@ -13,7 +13,7 @@
 use std::str::FromStr;
 use std::path::PathBuf;
 
-use test::{ColorConfig, TestPaths};
+use test::ColorConfig;
 
 #[derive(Clone, Copy, PartialEq, Debug)]
 pub enum Mode {
@@ -222,6 +222,13 @@ pub struct Config {
     pub nodejs: Option<String>,
 }
 
+#[derive(Clone)]
+pub struct TestPaths {
+    pub file: PathBuf,         // e.g., compile-test/foo/bar/baz.rs
+    pub base: PathBuf,         // e.g., compile-test, auxiliary
+    pub relative_dir: PathBuf, // e.g., foo/bar
+}
+
 /// Used by `ui` tests to generate things like `foo.stderr` from `foo.rs`.
 pub fn expected_output_path(testpaths: &TestPaths, revision: Option<&str>, kind: &str) -> PathBuf {
     assert!(UI_EXTENSIONS.contains(&kind));
index 80630b5e2cf4b3087605291b6defd079fb9b64d0..533aaf9cd27353bf9e0b78eab246f8df8728da72 100644 (file)
 use std::process::Command;
 use filetime::FileTime;
 use getopts::Options;
-use common::Config;
+use common::{Config, TestPaths};
 use common::{DebugInfoGdb, DebugInfoLldb, Mode, Pretty};
 use common::{expected_output_path, UI_EXTENSIONS};
-use test::{ColorConfig, TestPaths};
+use test::ColorConfig;
 use util::logv;
 
 use self::header::EarlyProps;
index 3aee88136a1ff1ab6488b68ea1521483d157dd04..aceb472ca63198b1b47567e8908585b15ea7a804 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use common::Config;
+use common::{Config, TestPaths};
 use common::{CompileFail, ParseFail, Pretty, RunFail, RunPass, RunPassValgrind};
 use common::{Codegen, CodegenUnits, DebugInfoGdb, DebugInfoLldb, Rustdoc};
 use common::{Incremental, MirOpt, RunMake, Ui};
@@ -18,7 +18,6 @@
 use filetime::FileTime;
 use json;
 use header::TestProps;
-use test::TestPaths;
 use util::logv;
 use regex::Regex;