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;
14 use std::path::PathBuf;
16 #[derive(Clone, Copy, PartialEq, Debug)]
30 impl FromStr for Mode {
32 fn from_str(s: &str) -> Result<Mode, ()> {
34 "compile-fail" => Ok(CompileFail),
35 "parse-fail" => Ok(ParseFail),
36 "run-fail" => Ok(RunFail),
37 "run-pass" => Ok(RunPass),
38 "run-pass-valgrind" => Ok(RunPassValgrind),
39 "pretty" => Ok(Pretty),
40 "debuginfo-lldb" => Ok(DebugInfoLldb),
41 "debuginfo-gdb" => Ok(DebugInfoGdb),
42 "codegen" => Ok(Codegen),
43 "rustdoc" => Ok(Rustdoc),
49 impl fmt::Display for Mode {
50 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
51 fmt::Display::fmt(match *self {
52 CompileFail => "compile-fail",
53 ParseFail => "parse-fail",
54 RunFail => "run-fail",
55 RunPass => "run-pass",
56 RunPassValgrind => "run-pass-valgrind",
58 DebugInfoGdb => "debuginfo-gdb",
59 DebugInfoLldb => "debuginfo-lldb",
68 // The library paths required for running the compiler
69 pub compile_lib_path: String,
71 // The library paths required for running compiled programs
72 pub run_lib_path: String,
74 // The rustc executable
75 pub rustc_path: PathBuf,
77 // The rustdoc executable
78 pub rustdoc_path: PathBuf,
80 // The python executable
83 // The llvm binaries path
84 pub llvm_bin_path: Option<PathBuf>,
87 pub valgrind_path: Option<String>,
89 // Whether to fail if we can't run run-pass-valgrind tests under valgrind
90 // (or, alternatively, to silently run them like regular run-pass tests).
91 pub force_valgrind: bool,
93 // The directory containing the tests to run
94 pub src_base: PathBuf,
96 // The directory where programs should be built
97 pub build_base: PathBuf,
99 // Directory for auxiliary libraries
100 pub aux_base: PathBuf,
102 // The name of the stage being built (stage1, etc)
103 pub stage_id: String,
105 // The test mode, compile-fail, run-fail, run-pass
109 pub run_ignored: bool,
111 // Only run tests that match this filter
112 pub filter: Option<String>,
114 // Write out a parseable log of tests that were run
115 pub logfile: Option<PathBuf>,
117 // A command line to prefix program execution with,
118 // for running under valgrind
119 pub runtool: Option<String>,
121 // Flags to pass to the compiler when building for the host
122 pub host_rustcflags: Option<String>,
124 // Flags to pass to the compiler when building for the target
125 pub target_rustcflags: Option<String>,
127 // Target system to be tested
130 // Host triple for the compiler being invoked
134 pub gdb_version: Option<String>,
137 pub lldb_version: Option<String>,
139 // Path to the android tools
140 pub android_cross_path: PathBuf,
142 // Extra parameter to run adb on arm-linux-androideabi
143 pub adb_path: String,
145 // Extra parameter to run test suite on arm-linux-androideabi
146 pub adb_test_dir: String,
148 // status whether android device available or not
149 pub adb_device_status: bool,
151 // the path containing LLDB's Python module
152 pub lldb_python_dir: Option<String>,
154 // Explain what's going on