Skip to content

Commit 7b5543d

Browse files
committed
Move the TestPaths structure from libtest to compiletest.
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.
1 parent 79b25c6 commit 7b5543d

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

Diff for: src/libtest/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,6 @@ pub struct TestDesc {
203203
pub allow_fail: bool,
204204
}
205205

206-
#[derive(Clone)]
207-
pub struct TestPaths {
208-
pub file: PathBuf, // e.g., compile-test/foo/bar/baz.rs
209-
pub base: PathBuf, // e.g., compile-test, auxiliary
210-
pub relative_dir: PathBuf, // e.g., foo/bar
211-
}
212-
213206
#[derive(Debug)]
214207
pub struct TestDescAndFn {
215208
pub desc: TestDesc,

Diff for: src/tools/compiletest/src/common.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fmt;
1313
use std::str::FromStr;
1414
use std::path::PathBuf;
1515

16-
use test::{ColorConfig, TestPaths};
16+
use test::ColorConfig;
1717

1818
#[derive(Clone, Copy, PartialEq, Debug)]
1919
pub enum Mode {
@@ -222,6 +222,13 @@ pub struct Config {
222222
pub nodejs: Option<String>,
223223
}
224224

225+
#[derive(Clone)]
226+
pub struct TestPaths {
227+
pub file: PathBuf, // e.g., compile-test/foo/bar/baz.rs
228+
pub base: PathBuf, // e.g., compile-test, auxiliary
229+
pub relative_dir: PathBuf, // e.g., foo/bar
230+
}
231+
225232
/// Used by `ui` tests to generate things like `foo.stderr` from `foo.rs`.
226233
pub fn expected_output_path(testpaths: &TestPaths, revision: Option<&str>, kind: &str) -> PathBuf {
227234
assert!(UI_EXTENSIONS.contains(&kind));

Diff for: src/tools/compiletest/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ use std::path::{Path, PathBuf};
3333
use std::process::Command;
3434
use filetime::FileTime;
3535
use getopts::Options;
36-
use common::Config;
36+
use common::{Config, TestPaths};
3737
use common::{DebugInfoGdb, DebugInfoLldb, Mode, Pretty};
3838
use common::{expected_output_path, UI_EXTENSIONS};
39-
use test::{ColorConfig, TestPaths};
39+
use test::ColorConfig;
4040
use util::logv;
4141

4242
use self::header::EarlyProps;

Diff for: src/tools/compiletest/src/runtest.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use common::Config;
11+
use common::{Config, TestPaths};
1212
use common::{CompileFail, ParseFail, Pretty, RunFail, RunPass, RunPassValgrind};
1313
use common::{Codegen, CodegenUnits, DebugInfoGdb, DebugInfoLldb, Rustdoc};
1414
use common::{Incremental, MirOpt, RunMake, Ui};
@@ -18,7 +18,6 @@ use errors::{self, Error, ErrorKind};
1818
use filetime::FileTime;
1919
use json;
2020
use header::TestProps;
21-
use test::TestPaths;
2221
use util::logv;
2322
use regex::Regex;
2423

0 commit comments

Comments
 (0)