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 clang executable
84 pub clang_path: Option<PathBuf>,
86 // The llvm binaries path
87 pub llvm_bin_path: Option<PathBuf>,
90 pub valgrind_path: Option<String>,
92 // Whether to fail if we can't run run-pass-valgrind tests under valgrind
93 // (or, alternatively, to silently run them like regular run-pass tests).
94 pub force_valgrind: bool,
96 // The directory containing the tests to run
97 pub src_base: PathBuf,
99 // The directory where programs should be built
100 pub build_base: PathBuf,
102 // Directory for auxiliary libraries
103 pub aux_base: PathBuf,
105 // The name of the stage being built (stage1, etc)
106 pub stage_id: String,
108 // The test mode, compile-fail, run-fail, run-pass
112 pub run_ignored: bool,
114 // Only run tests that match this filter
115 pub filter: Option<String>,
117 // Write out a parseable log of tests that were run
118 pub logfile: Option<PathBuf>,
120 // A command line to prefix program execution with,
121 // for running under valgrind
122 pub runtool: Option<String>,
124 // Flags to pass to the compiler when building for the host
125 pub host_rustcflags: Option<String>,
127 // Flags to pass to the compiler when building for the target
128 pub target_rustcflags: Option<String>,
130 // Run tests using the JIT
133 // Target system to be tested
136 // Host triple for the compiler being invoked
140 pub gdb_version: Option<String>,
143 pub lldb_version: Option<String>,
145 // Path to the android tools
146 pub android_cross_path: PathBuf,
148 // Extra parameter to run adb on arm-linux-androideabi
149 pub adb_path: String,
151 // Extra parameter to run test suite on arm-linux-androideabi
152 pub adb_test_dir: String,
154 // status whether android device available or not
155 pub adb_device_status: bool,
157 // the path containing LLDB's Python module
158 pub lldb_python_dir: Option<String>,
160 // Explain what's going on