@@ -17,6 +17,8 @@ pub struct TestProps {
1717 pub error_patterns : Vec < ~str > ,
1818 // Extra flags to pass to the compiler
1919 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 > ,
2022 // If present, the name of a file that this test should match when
2123 // pretty-printed
2224 pub pp_exact : Option < Path > ,
@@ -42,6 +44,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
4244 let mut aux_builds = Vec :: new ( ) ;
4345 let mut exec_env = Vec :: new ( ) ;
4446 let mut compile_flags = None ;
47+ let mut run_flags = None ;
4548 let mut pp_exact = None ;
4649 let mut debugger_cmds = Vec :: new ( ) ;
4750 let mut check_lines = Vec :: new ( ) ;
@@ -58,6 +61,10 @@ pub fn load_props(testfile: &Path) -> TestProps {
5861 compile_flags = parse_compile_flags ( ln) ;
5962 }
6063
64+ if run_flags. is_none ( ) {
65+ run_flags = parse_run_flags ( ln) ;
66+ }
67+
6168 if pp_exact. is_none ( ) {
6269 pp_exact = parse_pp_exact ( ln, testfile) ;
6370 }
@@ -96,9 +103,11 @@ pub fn load_props(testfile: &Path) -> TestProps {
96103
97104 true
98105 } ) ;
99- return TestProps {
106+
107+ TestProps {
100108 error_patterns : error_patterns,
101109 compile_flags : compile_flags,
110+ run_flags : run_flags,
102111 pp_exact : pp_exact,
103112 aux_builds : aux_builds,
104113 exec_env : exec_env,
@@ -107,7 +116,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
107116 force_host : force_host,
108117 check_stdout : check_stdout,
109118 no_prefer_dynamic : no_prefer_dynamic,
110- } ;
119+ }
111120}
112121
113122pub fn is_test_ignored ( config : & config , testfile : & Path ) -> bool {
@@ -160,6 +169,10 @@ fn parse_compile_flags(line: &str) -> Option<~str> {
160169 parse_name_value_directive ( line, "compile-flags" . to_owned ( ) )
161170}
162171
172+ fn parse_run_flags ( line : & str ) -> Option < ~str > {
173+ parse_name_value_directive ( line, ~"run-flags")
174+ }
175+
163176fn parse_debugger_cmd ( line : & str ) -> Option < ~str > {
164177 parse_name_value_directive ( line, "debugger" . to_owned ( ) )
165178}
0 commit comments