Skip to content

Tiny fixes to make compiletest work for CloudABI cross builds #47106

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

Merged
merged 2 commits into from
Jan 2, 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
7 changes: 0 additions & 7 deletions src/libtest/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 8 additions & 1 deletion src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::fmt;
use std::str::FromStr;
use std::path::PathBuf;

use test::{ColorConfig, TestPaths};
use test::ColorConfig;

#[derive(Clone, Copy, PartialEq, Debug)]
pub enum Mode {
Expand Down Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/tools/compiletest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ use std::path::{Path, PathBuf};
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;
Expand Down
3 changes: 1 addition & 2 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -18,7 +18,6 @@ use errors::{self, Error, ErrorKind};
use filetime::FileTime;
use json;
use header::TestProps;
use test::TestPaths;
use util::logv;
use regex::Regex;

Expand Down
1 change: 1 addition & 0 deletions src/tools/compiletest/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use common::Config;
const OS_TABLE: &'static [(&'static str, &'static str)] = &[
("android", "android"),
("bitrig", "bitrig"),
("cloudabi", "cloudabi"),
("darwin", "macos"),
("dragonfly", "dragonfly"),
("freebsd", "freebsd"),
Expand Down