1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10 pub use self::Mode::*;
13 use std::str::FromStr;
15 #[derive(Clone, Copy, PartialEq, Debug)]
28 impl FromStr for Mode {
30 fn from_str(s: &str) -> Result<Mode, ()> {
32 "compile-fail" => Ok(CompileFail),
33 "parse-fail" => Ok(ParseFail),
34 "run-fail" => Ok(RunFail),
35 "run-pass" => Ok(RunPass),
36 "run-pass-valgrind" => Ok(RunPassValgrind),
37 "pretty" => Ok(Pretty),
38 "debuginfo-lldb" => Ok(DebugInfoLldb),
39 "debuginfo-gdb" => Ok(DebugInfoGdb),
40 "codegen" => Ok(Codegen),
46 impl fmt::Display for Mode {
47 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
48 fmt::Display::fmt(match *self {
49 CompileFail => "compile-fail",
50 ParseFail => "parse-fail",
51 RunFail => "run-fail",
52 RunPass => "run-pass",
53 RunPassValgrind => "run-pass-valgrind",
55 DebugInfoGdb => "debuginfo-gdb",
56 DebugInfoLldb => "debuginfo-lldb",
64 // The library paths required for running the compiler
65 pub compile_lib_path: String,
67 // The library paths required for running compiled programs
68 pub run_lib_path: String,
70 // The rustc executable
73 // The clang executable
74 pub clang_path: Option<Path>,
76 // The llvm binaries path
77 pub llvm_bin_path: Option<Path>,
80 pub valgrind_path: Option<String>,
82 // Whether to fail if we can't run run-pass-valgrind tests under valgrind
83 // (or, alternatively, to silently run them like regular run-pass tests).
84 pub force_valgrind: bool,
86 // The directory containing the tests to run
89 // The directory where programs should be built
92 // Directory for auxiliary libraries
95 // The name of the stage being built (stage1, etc)
98 // The test mode, compile-fail, run-fail, run-pass
102 pub run_ignored: bool,
104 // Only run tests that match this filter
105 pub filter: Option<String>,
107 // Write out a parseable log of tests that were run
108 pub logfile: Option<Path>,
110 // A command line to prefix program execution with,
111 // for running under valgrind
112 pub runtool: Option<String>,
114 // Flags to pass to the compiler when building for the host
115 pub host_rustcflags: Option<String>,
117 // Flags to pass to the compiler when building for the target
118 pub target_rustcflags: Option<String>,
120 // Run tests using the JIT
123 // Target system to be tested
126 // Host triple for the compiler being invoked
130 pub gdb_version: Option<String>,
133 pub lldb_version: Option<String>,
135 // Path to the android tools
136 pub android_cross_path: Path,
138 // Extra parameter to run adb on arm-linux-androideabi
139 pub adb_path: String,
141 // Extra parameter to run test suite on arm-linux-androideabi
142 pub adb_test_dir: String,
144 // status whether android device available or not
145 pub adb_device_status: bool,
147 // the path containing LLDB's Python module
148 pub lldb_python_dir: Option<String>,
150 // Explain what's going on