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)]
31 impl FromStr for Mode {
33 fn from_str(s: &str) -> Result<Mode, ()> {
35 "compile-fail" => Ok(CompileFail),
36 "parse-fail" => Ok(ParseFail),
37 "run-fail" => Ok(RunFail),
38 "run-pass" => Ok(RunPass),
39 "run-pass-valgrind" => Ok(RunPassValgrind),
40 "pretty" => Ok(Pretty),
41 "debuginfo-lldb" => Ok(DebugInfoLldb),
42 "debuginfo-gdb" => Ok(DebugInfoGdb),
43 "codegen" => Ok(Codegen),
44 "rustdoc" => Ok(Rustdoc),
45 "codegen-units" => Ok(CodegenUnits),
51 impl fmt::Display for Mode {
52 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
53 fmt::Display::fmt(match *self {
54 CompileFail => "compile-fail",
55 ParseFail => "parse-fail",
56 RunFail => "run-fail",
57 RunPass => "run-pass",
58 RunPassValgrind => "run-pass-valgrind",
60 DebugInfoGdb => "debuginfo-gdb",
61 DebugInfoLldb => "debuginfo-lldb",
64 CodegenUnits => "codegen-units",
71 // The library paths required for running the compiler
72 pub compile_lib_path: String,
74 // The library paths required for running compiled programs
75 pub run_lib_path: String,
77 // The rustc executable
78 pub rustc_path: PathBuf,
80 // The rustdoc executable
81 pub rustdoc_path: PathBuf,
83 // The python executable
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 // Target system to be tested
133 // Host triple for the compiler being invoked
137 pub gdb_version: Option<String>,
140 pub lldb_version: Option<String>,
142 // Path to the android tools
143 pub android_cross_path: PathBuf,
145 // Extra parameter to run adb on arm-linux-androideabi
146 pub adb_path: String,
148 // Extra parameter to run test suite on arm-linux-androideabi
149 pub adb_test_dir: String,
151 // status whether android device available or not
152 pub adb_device_status: bool,
154 // the path containing LLDB's Python module
155 pub lldb_python_dir: Option<String>,
157 // Explain what's going on
160 // Print one character per test instead of one line