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