2014-05-20 12:15:34 -05:00
|
|
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
2014-01-04 14:16:57 -06:00
|
|
|
// file at the top-level directory of this distribution and at
|
2012-12-03 18:48:01 -06:00
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
2014-11-06 02:05:53 -06:00
|
|
|
pub use self::Mode::*;
|
2012-12-03 18:48:01 -06:00
|
|
|
|
2014-04-15 23:56:39 -05:00
|
|
|
use std::fmt;
|
2014-11-14 22:52:00 -06:00
|
|
|
use std::str::FromStr;
|
2014-04-15 23:56:39 -05:00
|
|
|
|
2015-01-23 08:21:11 -06:00
|
|
|
#[cfg(stage0)] // NOTE: remove impl after snapshot
|
|
|
|
#[derive(Clone, PartialEq, Show)]
|
|
|
|
pub enum Mode {
|
|
|
|
CompileFail,
|
|
|
|
RunFail,
|
|
|
|
RunPass,
|
|
|
|
RunPassValgrind,
|
|
|
|
Pretty,
|
|
|
|
DebugInfoGdb,
|
|
|
|
DebugInfoLldb,
|
|
|
|
Codegen
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(stage0))] // NOTE: remove cfg after snapshot
|
2015-01-20 17:45:07 -06:00
|
|
|
#[derive(Clone, PartialEq, Debug)]
|
2014-04-15 23:56:39 -05:00
|
|
|
pub enum Mode {
|
|
|
|
CompileFail,
|
|
|
|
RunFail,
|
|
|
|
RunPass,
|
2014-10-07 02:00:26 -05:00
|
|
|
RunPassValgrind,
|
2014-04-15 23:56:39 -05:00
|
|
|
Pretty,
|
|
|
|
DebugInfoGdb,
|
|
|
|
DebugInfoLldb,
|
|
|
|
Codegen
|
|
|
|
}
|
|
|
|
|
2015-01-23 08:21:11 -06:00
|
|
|
|
librustc: Make `Copy` opt-in.
This change makes the compiler no longer infer whether types (structures
and enumerations) implement the `Copy` trait (and thus are implicitly
copyable). Rather, you must implement `Copy` yourself via `impl Copy for
MyType {}`.
A new warning has been added, `missing_copy_implementations`, to warn
you if a non-generic public type has been added that could have
implemented `Copy` but didn't.
For convenience, you may *temporarily* opt out of this behavior by using
`#![feature(opt_out_copy)]`. Note though that this feature gate will never be
accepted and will be removed by the time that 1.0 is released, so you should
transition your code away from using it.
This breaks code like:
#[deriving(Show)]
struct Point2D {
x: int,
y: int,
}
fn main() {
let mypoint = Point2D {
x: 1,
y: 1,
};
let otherpoint = mypoint;
println!("{}{}", mypoint, otherpoint);
}
Change this code to:
#[deriving(Show)]
struct Point2D {
x: int,
y: int,
}
impl Copy for Point2D {}
fn main() {
let mypoint = Point2D {
x: 1,
y: 1,
};
let otherpoint = mypoint;
println!("{}{}", mypoint, otherpoint);
}
This is the backwards-incompatible part of #13231.
Part of RFC #3.
[breaking-change]
2014-12-05 19:01:33 -06:00
|
|
|
impl Copy for Mode {}
|
|
|
|
|
2014-04-15 23:56:39 -05:00
|
|
|
impl FromStr for Mode {
|
|
|
|
fn from_str(s: &str) -> Option<Mode> {
|
|
|
|
match s {
|
|
|
|
"compile-fail" => Some(CompileFail),
|
|
|
|
"run-fail" => Some(RunFail),
|
|
|
|
"run-pass" => Some(RunPass),
|
2014-10-07 02:00:26 -05:00
|
|
|
"run-pass-valgrind" => Some(RunPassValgrind),
|
2014-04-15 23:56:39 -05:00
|
|
|
"pretty" => Some(Pretty),
|
|
|
|
"debuginfo-lldb" => Some(DebugInfoLldb),
|
|
|
|
"debuginfo-gdb" => Some(DebugInfoGdb),
|
|
|
|
"codegen" => Some(Codegen),
|
|
|
|
_ => None,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-20 17:45:07 -06:00
|
|
|
impl fmt::Display for Mode {
|
2014-04-15 23:56:39 -05:00
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
2015-01-20 17:45:07 -06:00
|
|
|
fmt::Display::fmt(match *self {
|
2014-05-11 13:14:14 -05:00
|
|
|
CompileFail => "compile-fail",
|
|
|
|
RunFail => "run-fail",
|
|
|
|
RunPass => "run-pass",
|
2014-10-07 02:00:26 -05:00
|
|
|
RunPassValgrind => "run-pass-valgrind",
|
2014-05-11 13:14:14 -05:00
|
|
|
Pretty => "pretty",
|
|
|
|
DebugInfoGdb => "debuginfo-gdb",
|
|
|
|
DebugInfoLldb => "debuginfo-lldb",
|
|
|
|
Codegen => "codegen",
|
2014-12-20 02:09:35 -06:00
|
|
|
}, f)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-03 21:54:18 -06:00
|
|
|
#[derive(Clone)]
|
2014-04-15 23:56:39 -05:00
|
|
|
pub struct Config {
|
2011-07-30 23:11:14 -05:00
|
|
|
// The library paths required for running the compiler
|
2014-05-22 18:57:53 -05:00
|
|
|
pub compile_lib_path: String,
|
2012-02-27 23:23:49 -06:00
|
|
|
|
2011-07-30 23:11:14 -05:00
|
|
|
// The library paths required for running compiled programs
|
2014-05-22 18:57:53 -05:00
|
|
|
pub run_lib_path: String,
|
2012-02-27 23:23:49 -06:00
|
|
|
|
2011-07-30 23:11:14 -05:00
|
|
|
// The rustc executable
|
2014-03-28 13:10:15 -05:00
|
|
|
pub rustc_path: Path,
|
2012-02-27 23:23:49 -06:00
|
|
|
|
2013-07-06 02:44:40 -05:00
|
|
|
// The clang executable
|
2014-03-28 13:10:15 -05:00
|
|
|
pub clang_path: Option<Path>,
|
2013-07-06 02:44:40 -05:00
|
|
|
|
|
|
|
// The llvm binaries path
|
2014-03-28 13:10:15 -05:00
|
|
|
pub llvm_bin_path: Option<Path>,
|
2013-07-06 02:44:40 -05:00
|
|
|
|
2014-10-07 02:00:26 -05:00
|
|
|
// The valgrind path
|
|
|
|
pub valgrind_path: Option<String>,
|
|
|
|
|
2014-10-08 18:11:37 -05:00
|
|
|
// Whether to fail if we can't run run-pass-valgrind tests under valgrind
|
|
|
|
// (or, alternatively, to silently run them like regular run-pass tests).
|
|
|
|
pub force_valgrind: bool,
|
|
|
|
|
2011-07-30 23:11:14 -05:00
|
|
|
// The directory containing the tests to run
|
2014-03-28 13:10:15 -05:00
|
|
|
pub src_base: Path,
|
2012-02-27 23:23:49 -06:00
|
|
|
|
2011-07-30 23:11:14 -05:00
|
|
|
// The directory where programs should be built
|
2014-03-28 13:10:15 -05:00
|
|
|
pub build_base: Path,
|
2012-02-27 23:23:49 -06:00
|
|
|
|
|
|
|
// Directory for auxiliary libraries
|
2014-03-28 13:10:15 -05:00
|
|
|
pub aux_base: Path,
|
2012-02-27 23:23:49 -06:00
|
|
|
|
2011-07-30 23:11:14 -05:00
|
|
|
// The name of the stage being built (stage1, etc)
|
2014-05-22 18:57:53 -05:00
|
|
|
pub stage_id: String,
|
2012-02-27 23:23:49 -06:00
|
|
|
|
2011-07-30 23:11:14 -05:00
|
|
|
// The test mode, compile-fail, run-fail, run-pass
|
2014-04-15 23:56:39 -05:00
|
|
|
pub mode: Mode,
|
2012-02-27 23:23:49 -06:00
|
|
|
|
2011-07-30 23:11:14 -05:00
|
|
|
// Run ignored tests
|
2014-03-28 13:10:15 -05:00
|
|
|
pub run_ignored: bool,
|
2012-02-27 23:23:49 -06:00
|
|
|
|
2011-07-30 23:11:14 -05:00
|
|
|
// Only run tests that match this filter
|
2015-01-20 12:45:29 -06:00
|
|
|
pub filter: Option<String>,
|
2014-05-20 12:15:34 -05:00
|
|
|
|
2012-04-03 10:27:51 -05:00
|
|
|
// Write out a parseable log of tests that were run
|
2014-03-28 13:10:15 -05:00
|
|
|
pub logfile: Option<Path>,
|
2012-04-03 10:27:51 -05:00
|
|
|
|
2011-07-30 23:11:14 -05:00
|
|
|
// A command line to prefix program execution with,
|
|
|
|
// for running under valgrind
|
2014-05-22 18:57:53 -05:00
|
|
|
pub runtool: Option<String>,
|
2012-02-27 23:23:49 -06:00
|
|
|
|
2014-02-11 15:51:08 -06:00
|
|
|
// Flags to pass to the compiler when building for the host
|
2014-05-22 18:57:53 -05:00
|
|
|
pub host_rustcflags: Option<String>,
|
2014-02-11 15:51:08 -06:00
|
|
|
|
|
|
|
// Flags to pass to the compiler when building for the target
|
2014-05-22 18:57:53 -05:00
|
|
|
pub target_rustcflags: Option<String>,
|
2012-02-27 23:23:49 -06:00
|
|
|
|
2012-08-28 19:10:37 -05:00
|
|
|
// Run tests using the JIT
|
2014-03-28 13:10:15 -05:00
|
|
|
pub jit: bool,
|
2012-08-28 19:10:37 -05:00
|
|
|
|
2013-05-03 20:35:07 -05:00
|
|
|
// Target system to be tested
|
2014-05-22 18:57:53 -05:00
|
|
|
pub target: String,
|
2013-05-01 04:52:08 -05:00
|
|
|
|
2014-01-17 12:18:02 -06:00
|
|
|
// Host triple for the compiler being invoked
|
2014-05-22 18:57:53 -05:00
|
|
|
pub host: String,
|
2014-01-17 12:18:02 -06:00
|
|
|
|
2014-08-20 05:53:50 -05:00
|
|
|
// Version of GDB
|
|
|
|
pub gdb_version: Option<String>,
|
|
|
|
|
2014-10-02 04:35:24 -05:00
|
|
|
// Version of LLDB
|
|
|
|
pub lldb_version: Option<String>,
|
|
|
|
|
2014-05-13 13:44:30 -05:00
|
|
|
// Path to the android tools
|
|
|
|
pub android_cross_path: Path,
|
|
|
|
|
2013-05-01 23:16:01 -05:00
|
|
|
// Extra parameter to run adb on arm-linux-androideabi
|
2014-05-22 18:57:53 -05:00
|
|
|
pub adb_path: String,
|
2013-05-01 04:52:08 -05:00
|
|
|
|
2014-08-01 18:40:21 -05:00
|
|
|
// Extra parameter to run test suite on arm-linux-androideabi
|
2014-05-22 18:57:53 -05:00
|
|
|
pub adb_test_dir: String,
|
2013-05-01 23:16:01 -05:00
|
|
|
|
2013-05-03 20:35:07 -05:00
|
|
|
// status whether android device available or not
|
2014-03-28 13:10:15 -05:00
|
|
|
pub adb_device_status: bool,
|
2013-05-01 04:52:08 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// the path containing LLDB's Python module
|
2014-05-22 18:57:53 -05:00
|
|
|
pub lldb_python_dir: Option<String>,
|
2014-04-24 04:35:48 -05:00
|
|
|
|
2011-07-30 23:11:14 -05:00
|
|
|
// Explain what's going on
|
2014-03-28 13:10:15 -05:00
|
|
|
pub verbose: bool
|
2013-02-21 17:19:40 -06:00
|
|
|
}
|