]>
git.proxmox.com Git - rustc.git/blob - src/tools/compiletest/src/common.rs
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)]
35 impl FromStr
for Mode
{
37 fn from_str(s
: &str) -> Result
<Mode
, ()> {
39 "compile-fail" => Ok(CompileFail
),
40 "parse-fail" => Ok(ParseFail
),
41 "run-fail" => Ok(RunFail
),
42 "run-pass" => Ok(RunPass
),
43 "run-pass-valgrind" => Ok(RunPassValgrind
),
44 "pretty" => Ok(Pretty
),
45 "debuginfo-lldb" => Ok(DebugInfoLldb
),
46 "debuginfo-gdb" => Ok(DebugInfoGdb
),
47 "codegen" => Ok(Codegen
),
48 "rustdoc" => Ok(Rustdoc
),
49 "codegen-units" => Ok(CodegenUnits
),
50 "incremental" => Ok(Incremental
),
51 "run-make" => Ok(RunMake
),
53 "mir-opt" => Ok(MirOpt
),
59 impl fmt
::Display
for Mode
{
60 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
61 fmt
::Display
::fmt(match *self {
62 CompileFail
=> "compile-fail",
63 ParseFail
=> "parse-fail",
64 RunFail
=> "run-fail",
65 RunPass
=> "run-pass",
66 RunPassValgrind
=> "run-pass-valgrind",
68 DebugInfoGdb
=> "debuginfo-gdb",
69 DebugInfoLldb
=> "debuginfo-lldb",
72 CodegenUnits
=> "codegen-units",
73 Incremental
=> "incremental",
74 RunMake
=> "run-make",
84 // The library paths required for running the compiler
85 pub compile_lib_path
: PathBuf
,
87 // The library paths required for running compiled programs
88 pub run_lib_path
: PathBuf
,
90 // The rustc executable
91 pub rustc_path
: PathBuf
,
93 // The rustdoc executable
94 pub rustdoc_path
: PathBuf
,
96 // The python executable to use for LLDB
97 pub lldb_python
: String
,
99 // The python executable to use for htmldocck
100 pub docck_python
: String
,
102 // The llvm FileCheck binary path
103 pub llvm_filecheck
: Option
<PathBuf
>,
106 pub valgrind_path
: Option
<String
>,
108 // Whether to fail if we can't run run-pass-valgrind tests under valgrind
109 // (or, alternatively, to silently run them like regular run-pass tests).
110 pub force_valgrind
: bool
,
112 // The directory containing the tests to run
113 pub src_base
: PathBuf
,
115 // The directory where programs should be built
116 pub build_base
: PathBuf
,
118 // The name of the stage being built (stage1, etc)
119 pub stage_id
: String
,
121 // The test mode, compile-fail, run-fail, run-pass
125 pub run_ignored
: bool
,
127 // Only run tests that match this filter
128 pub filter
: Option
<String
>,
130 // Write out a parseable log of tests that were run
131 pub logfile
: Option
<PathBuf
>,
133 // A command line to prefix program execution with,
134 // for running under valgrind
135 pub runtool
: Option
<String
>,
137 // Flags to pass to the compiler when building for the host
138 pub host_rustcflags
: Option
<String
>,
140 // Flags to pass to the compiler when building for the target
141 pub target_rustcflags
: Option
<String
>,
143 // Target system to be tested
146 // Host triple for the compiler being invoked
149 // Path to / name of the GDB executable
150 pub gdb
: Option
<String
>,
152 // Version of GDB, encoded as ((major * 1000) + minor) * 1000 + patch
153 pub gdb_version
: Option
<u32>,
155 // Whether GDB has native rust support
156 pub gdb_native_rust
: bool
,
159 pub lldb_version
: Option
<String
>,
162 pub llvm_version
: Option
<String
>,
164 // Path to the android tools
165 pub android_cross_path
: PathBuf
,
167 // Extra parameter to run adb on arm-linux-androideabi
168 pub adb_path
: String
,
170 // Extra parameter to run test suite on arm-linux-androideabi
171 pub adb_test_dir
: String
,
173 // status whether android device available or not
174 pub adb_device_status
: bool
,
176 // the path containing LLDB's Python module
177 pub lldb_python_dir
: Option
<String
>,
179 // Explain what's going on
182 // Print one character per test instead of one line
185 // Configuration for various run-make tests frobbing things like C compilers
186 // or querying about various LLVM component information.
190 pub llvm_components
: String
,
191 pub llvm_cxxflags
: String
,
192 pub nodejs
: Option
<String
>,