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 use test::ColorConfig;
18 #[derive(Clone, Copy, PartialEq, Debug)]
37 impl FromStr for Mode {
39 fn from_str(s: &str) -> Result<Mode, ()> {
41 "compile-fail" => Ok(CompileFail),
42 "parse-fail" => Ok(ParseFail),
43 "run-fail" => Ok(RunFail),
44 "run-pass" => Ok(RunPass),
45 "run-pass-valgrind" => Ok(RunPassValgrind),
46 "pretty" => Ok(Pretty),
47 "debuginfo-lldb" => Ok(DebugInfoLldb),
48 "debuginfo-gdb" => Ok(DebugInfoGdb),
49 "codegen" => Ok(Codegen),
50 "rustdoc" => Ok(Rustdoc),
51 "codegen-units" => Ok(CodegenUnits),
52 "incremental" => Ok(Incremental),
53 "run-make" => Ok(RunMake),
55 "mir-opt" => Ok(MirOpt),
61 impl fmt::Display for Mode {
62 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
63 fmt::Display::fmt(match *self {
64 CompileFail => "compile-fail",
65 ParseFail => "parse-fail",
66 RunFail => "run-fail",
67 RunPass => "run-pass",
68 RunPassValgrind => "run-pass-valgrind",
70 DebugInfoGdb => "debuginfo-gdb",
71 DebugInfoLldb => "debuginfo-lldb",
74 CodegenUnits => "codegen-units",
75 Incremental => "incremental",
76 RunMake => "run-make",
86 // The library paths required for running the compiler
87 pub compile_lib_path: PathBuf,
89 // The library paths required for running compiled programs
90 pub run_lib_path: PathBuf,
92 // The rustc executable
93 pub rustc_path: PathBuf,
95 // The rustdoc executable
96 pub rustdoc_path: PathBuf,
98 // The python executable to use for LLDB
99 pub lldb_python: String,
101 // The python executable to use for htmldocck
102 pub docck_python: String,
104 // The llvm FileCheck binary path
105 pub llvm_filecheck: Option<PathBuf>,
108 pub valgrind_path: Option<String>,
110 // Whether to fail if we can't run run-pass-valgrind tests under valgrind
111 // (or, alternatively, to silently run them like regular run-pass tests).
112 pub force_valgrind: bool,
114 // The directory containing the tests to run
115 pub src_base: PathBuf,
117 // The directory where programs should be built
118 pub build_base: PathBuf,
120 // The name of the stage being built (stage1, etc)
121 pub stage_id: String,
123 // The test mode, compile-fail, run-fail, run-pass
127 pub run_ignored: bool,
129 // Only run tests that match this filter
130 pub filter: Option<String>,
132 // Exactly match the filter, rather than a substring
133 pub filter_exact: bool,
135 // Write out a parseable log of tests that were run
136 pub logfile: Option<PathBuf>,
138 // A command line to prefix program execution with,
139 // for running under valgrind
140 pub runtool: Option<String>,
142 // Flags to pass to the compiler when building for the host
143 pub host_rustcflags: Option<String>,
145 // Flags to pass to the compiler when building for the target
146 pub target_rustcflags: Option<String>,
148 // Target system to be tested
151 // Host triple for the compiler being invoked
154 // Path to / name of the GDB executable
155 pub gdb: Option<String>,
157 // Version of GDB, encoded as ((major * 1000) + minor) * 1000 + patch
158 pub gdb_version: Option<u32>,
160 // Whether GDB has native rust support
161 pub gdb_native_rust: bool,
164 pub lldb_version: Option<String>,
167 pub llvm_version: Option<String>,
169 // Path to the android tools
170 pub android_cross_path: PathBuf,
172 // Extra parameter to run adb on arm-linux-androideabi
173 pub adb_path: String,
175 // Extra parameter to run test suite on arm-linux-androideabi
176 pub adb_test_dir: String,
178 // status whether android device available or not
179 pub adb_device_status: bool,
181 // the path containing LLDB's Python module
182 pub lldb_python_dir: Option<String>,
184 // Explain what's going on
187 // Print one character per test instead of one line
190 // Whether to use colors in test.
191 pub color: ColorConfig,
193 // where to find the remote test client process, if we're using it
194 pub remote_test_client: Option<PathBuf>,
196 // Configuration for various run-make tests frobbing things like C compilers
197 // or querying about various LLVM component information.
201 pub llvm_components: String,
202 pub llvm_cxxflags: String,
203 pub nodejs: Option<String>,