@@ -17,6 +17,8 @@ pub struct TestProps {
17
17
pub error_patterns : Vec < ~str > ,
18
18
// Extra flags to pass to the compiler
19
19
pub compile_flags : Option < ~str > ,
20
+ // Extra flags to pass when the compiled code is run (such as --bench)
21
+ pub run_flags : Option < ~str > ,
20
22
// If present, the name of a file that this test should match when
21
23
// pretty-printed
22
24
pub pp_exact : Option < Path > ,
@@ -42,6 +44,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
42
44
let mut aux_builds = Vec :: new ( ) ;
43
45
let mut exec_env = Vec :: new ( ) ;
44
46
let mut compile_flags = None ;
47
+ let mut run_flags = None ;
45
48
let mut pp_exact = None ;
46
49
let mut debugger_cmds = Vec :: new ( ) ;
47
50
let mut check_lines = Vec :: new ( ) ;
@@ -58,6 +61,10 @@ pub fn load_props(testfile: &Path) -> TestProps {
58
61
compile_flags = parse_compile_flags ( ln) ;
59
62
}
60
63
64
+ if run_flags. is_none ( ) {
65
+ run_flags = parse_run_flags ( ln) ;
66
+ }
67
+
61
68
if pp_exact. is_none ( ) {
62
69
pp_exact = parse_pp_exact ( ln, testfile) ;
63
70
}
@@ -96,9 +103,11 @@ pub fn load_props(testfile: &Path) -> TestProps {
96
103
97
104
true
98
105
} ) ;
99
- return TestProps {
106
+
107
+ TestProps {
100
108
error_patterns : error_patterns,
101
109
compile_flags : compile_flags,
110
+ run_flags : run_flags,
102
111
pp_exact : pp_exact,
103
112
aux_builds : aux_builds,
104
113
exec_env : exec_env,
@@ -107,7 +116,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
107
116
force_host : force_host,
108
117
check_stdout : check_stdout,
109
118
no_prefer_dynamic : no_prefer_dynamic,
110
- } ;
119
+ }
111
120
}
112
121
113
122
pub fn is_test_ignored ( config : & config , testfile : & Path ) -> bool {
@@ -160,6 +169,10 @@ fn parse_compile_flags(line: &str) -> Option<~str> {
160
169
parse_name_value_directive ( line, "compile-flags" . to_owned ( ) )
161
170
}
162
171
172
+ fn parse_run_flags ( line : & str ) -> Option < ~str > {
173
+ parse_name_value_directive ( line, ~"run-flags")
174
+ }
175
+
163
176
fn parse_debugger_cmd ( line : & str ) -> Option < ~str > {
164
177
parse_name_value_directive ( line, "debugger" . to_owned ( ) )
165
178
}
0 commit comments