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)]
34 impl FromStr for Mode {
36 fn from_str(s: &str) -> Result<Mode, ()> {
38 "compile-fail" => Ok(CompileFail),
39 "parse-fail" => Ok(ParseFail),
40 "run-fail" => Ok(RunFail),
41 "run-pass" => Ok(RunPass),
42 "run-pass-valgrind" => Ok(RunPassValgrind),
43 "pretty" => Ok(Pretty),
44 "debuginfo-lldb" => Ok(DebugInfoLldb),
45 "debuginfo-gdb" => Ok(DebugInfoGdb),
46 "codegen" => Ok(Codegen),
47 "rustdoc" => Ok(Rustdoc),
48 "codegen-units" => Ok(CodegenUnits),
49 "incremental" => Ok(Incremental),
50 "run-make" => Ok(RunMake),
57 impl fmt::Display for Mode {
58 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
59 fmt::Display::fmt(match *self {
60 CompileFail => "compile-fail",
61 ParseFail => "parse-fail",
62 RunFail => "run-fail",
63 RunPass => "run-pass",
64 RunPassValgrind => "run-pass-valgrind",
66 DebugInfoGdb => "debuginfo-gdb",
67 DebugInfoLldb => "debuginfo-lldb",
70 CodegenUnits => "codegen-units",
71 Incremental => "incremental",
72 RunMake => "run-make",
80 // The library paths required for running the compiler
81 pub compile_lib_path: PathBuf,
83 // The library paths required for running compiled programs
84 pub run_lib_path: PathBuf,
86 // The rustc executable
87 pub rustc_path: PathBuf,
89 // The rustdoc executable
90 pub rustdoc_path: PathBuf,
92 // The python executable to use for LLDB
93 pub lldb_python: String,
95 // The python executable to use for htmldocck
96 pub docck_python: String,
98 // The llvm FileCheck binary path
99 pub llvm_filecheck: Option<PathBuf>,
102 pub valgrind_path: Option<String>,
104 // Whether to fail if we can't run run-pass-valgrind tests under valgrind
105 // (or, alternatively, to silently run them like regular run-pass tests).
106 pub force_valgrind: bool,
108 // The directory containing the tests to run
109 pub src_base: PathBuf,
111 // The directory where programs should be built
112 pub build_base: PathBuf,
114 // The name of the stage being built (stage1, etc)
115 pub stage_id: String,
117 // The test mode, compile-fail, run-fail, run-pass
121 pub run_ignored: bool,
123 // Only run tests that match this filter
124 pub filter: Option<String>,
126 // Write out a parseable log of tests that were run
127 pub logfile: Option<PathBuf>,
129 // A command line to prefix program execution with,
130 // for running under valgrind
131 pub runtool: Option<String>,
133 // Flags to pass to the compiler when building for the host
134 pub host_rustcflags: Option<String>,
136 // Flags to pass to the compiler when building for the target
137 pub target_rustcflags: Option<String>,
139 // Target system to be tested
142 // Host triple for the compiler being invoked
146 pub gdb_version: Option<String>,
149 pub lldb_version: Option<String>,
151 // Path to the android tools
152 pub android_cross_path: PathBuf,
154 // Extra parameter to run adb on arm-linux-androideabi
155 pub adb_path: String,
157 // Extra parameter to run test suite on arm-linux-androideabi
158 pub adb_test_dir: String,
160 // status whether android device available or not
161 pub adb_device_status: bool,
163 // the path containing LLDB's Python module
164 pub lldb_python_dir: Option<String>,
166 // Explain what's going on
169 // Print one character per test instead of one line
172 // Configuration for various run-make tests frobbing things like C compilers
173 // or querying about various LLVM component information.
177 pub llvm_components: String,
178 pub llvm_cxxflags: String,