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