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;
16 #[deriving(Clone, PartialEq)]
28 impl FromStr for Mode {
29 fn from_str(s: &str) -> Option<Mode> {
31 "compile-fail" => Some(CompileFail),
32 "run-fail" => Some(RunFail),
33 "run-pass" => Some(RunPass),
34 "run-pass-valgrind" => Some(RunPassValgrind),
35 "pretty" => Some(Pretty),
36 "debuginfo-lldb" => Some(DebugInfoLldb),
37 "debuginfo-gdb" => Some(DebugInfoGdb),
38 "codegen" => Some(Codegen),
44 impl fmt::Show for Mode {
45 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
46 let msg = match *self {
47 CompileFail => "compile-fail",
48 RunFail => "run-fail",
49 RunPass => "run-pass",
50 RunPassValgrind => "run-pass-valgrind",
52 DebugInfoGdb => "debuginfo-gdb",
53 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<Regex>,
105 // Precompiled regex for finding expected errors in cfail
106 pub cfail_regex: Regex,
108 // Write out a parseable log of tests that were run
109 pub logfile: Option<Path>,
111 // Write out a json file containing any metrics of the run
112 pub save_metrics: Option<Path>,
114 // Write and ratchet a metrics file
115 pub ratchet_metrics: Option<Path>,
117 // Percent change in metrics to consider noise
118 pub ratchet_noise_percent: Option<f64>,
120 // "Shard" of the testsuite to pub run: this has the form of
121 // two numbers (a,b), and causes only those tests with
122 // positional order equal to a mod b to run.
123 pub test_shard: Option<(uint,uint)>,
125 // A command line to prefix program execution with,
126 // for running under valgrind
127 pub runtool: Option<String>,
129 // Flags to pass to the compiler when building for the host
130 pub host_rustcflags: Option<String>,
132 // Flags to pass to the compiler when building for the target
133 pub target_rustcflags: Option<String>,
135 // Run tests using the JIT
138 // Target system to be tested
141 // Host triple for the compiler being invoked
145 pub gdb_version: Option<String>,
148 pub lldb_version: Option<String>,
150 // Path to the android tools
151 pub android_cross_path: Path,
153 // Extra parameter to run adb on arm-linux-androideabi
154 pub adb_path: String,
156 // Extra parameter to run test suite on arm-linux-androideabi
157 pub adb_test_dir: String,
159 // status whether android device available or not
160 pub adb_device_status: bool,
162 // the path containing LLDB's Python module
163 pub lldb_python_dir: Option<String>,
165 // Explain what's going on