1 // Copyright 2012-2013 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.
11 use std::from_str::FromStr;
14 #[deriving(Clone, Eq)]
25 impl FromStr for Mode {
26 fn from_str(s: &str) -> Option<Mode> {
28 "compile-fail" => Some(CompileFail),
29 "run-fail" => Some(RunFail),
30 "run-pass" => Some(RunPass),
31 "pretty" => Some(Pretty),
32 "debuginfo-lldb" => Some(DebugInfoLldb),
33 "debuginfo-gdb" => Some(DebugInfoGdb),
34 "codegen" => Some(Codegen),
40 impl fmt::Show for Mode {
41 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
42 let msg = match *self {
43 CompileFail => "compile-fail",
44 RunFail => "run-fail",
45 RunPass => "run-pass",
47 DebugInfoGdb => "debuginfo-gdb",
48 DebugInfoLldb => "debuginfo-lldb",
51 write!(f.buf, "{}", msg)
57 // The library paths required for running the compiler
58 pub compile_lib_path: ~str,
60 // The library paths required for running compiled programs
61 pub run_lib_path: ~str,
63 // The rustc executable
66 // The clang executable
67 pub clang_path: Option<Path>,
69 // The llvm binaries path
70 pub llvm_bin_path: Option<Path>,
72 // The directory containing the tests to run
75 // The directory where programs should be built
78 // Directory for auxiliary libraries
81 // The name of the stage being built (stage1, etc)
84 // The test mode, compile-fail, run-fail, run-pass
88 pub run_ignored: bool,
90 // Only run tests that match this filter
91 pub filter: Option<~str>,
93 // Write out a parseable log of tests that were run
94 pub logfile: Option<Path>,
96 // Write out a json file containing any metrics of the run
97 pub save_metrics: Option<Path>,
99 // Write and ratchet a metrics file
100 pub ratchet_metrics: Option<Path>,
102 // Percent change in metrics to consider noise
103 pub ratchet_noise_percent: Option<f64>,
105 // "Shard" of the testsuite to pub run: this has the form of
106 // two numbers (a,b), and causes only those tests with
107 // positional order equal to a mod b to run.
108 pub test_shard: Option<(uint,uint)>,
110 // A command line to prefix program execution with,
111 // for running under valgrind
112 pub runtool: Option<~str>,
114 // Flags to pass to the compiler when building for the host
115 pub host_rustcflags: Option<~str>,
117 // Flags to pass to the compiler when building for the target
118 pub target_rustcflags: Option<~str>,
120 // Run tests using the JIT
123 // Target system to be tested
126 // Host triple for the compiler being invoked
129 // Extra parameter to run adb on arm-linux-androideabi
132 // Extra parameter to run test sute on arm-linux-androideabi
133 pub adb_test_dir: ~str,
135 // status whether android device available or not
136 pub adb_device_status: bool,
138 // the path containing LLDB's Python module
139 pub lldb_python_dir: Option<~str>,
141 // Explain what's going on