@@ -16,7 +16,7 @@ fn run(config: config, testfile: ~str) {
16
16
// We're going to be dumping a lot of info. Start on a new line.
17
17
io:: stdout ( ) . write_str ( ~"\n \n ") ;
18
18
}
19
- debug ! { "running %s" , testfile} ;
19
+ debug ! ( "running %s" , testfile) ;
20
20
let props = load_props ( testfile) ;
21
21
match config. mode {
22
22
mode_compile_fail => run_cfail_test ( config, props, testfile) ,
@@ -68,8 +68,8 @@ fn check_correct_failure_status(procres: procres) {
68
68
const rust_err: int = 101 ;
69
69
if procres. status != rust_err {
70
70
fatal_procres (
71
- fmt ! { "failure produced the wrong error code: %d" ,
72
- procres. status} ,
71
+ fmt ! ( "failure produced the wrong error code: %d" ,
72
+ procres. status) ,
73
73
procres) ;
74
74
}
75
75
}
@@ -96,11 +96,11 @@ fn run_pretty_test(config: config, props: test_props, testfile: ~str) {
96
96
97
97
let mut round = 0 ;
98
98
while round < rounds {
99
- logv ( config, fmt ! { "pretty-printing round %d" , round} ) ;
99
+ logv ( config, fmt ! ( "pretty-printing round %d" , round) ) ;
100
100
let procres = print_source ( config, testfile, srcs[ round] ) ;
101
101
102
102
if procres. status != 0 {
103
- fatal_procres ( fmt ! { "pretty-printing failed in round %d" , round} ,
103
+ fatal_procres ( fmt ! ( "pretty-printing failed in round %d" , round) ,
104
104
procres) ;
105
105
}
106
106
@@ -151,7 +151,7 @@ fn run_pretty_test(config: config, props: test_props, testfile: ~str) {
151
151
if expected != actual {
152
152
error( ~"pretty-printed source does not match expected source") ;
153
153
let msg =
154
- fmt ! { "\n \
154
+ fmt ! ( "\n \
155
155
expected:\n \
156
156
------------------------------------------\n \
157
157
%s\n \
@@ -161,7 +161,7 @@ actual:\n\
161
161
%s\n \
162
162
------------------------------------------\n \
163
163
\n ",
164
- expected, actual} ;
164
+ expected, actual) ;
165
165
io:: stdout( ) . write_str ( msg) ;
166
166
fail;
167
167
}
@@ -201,10 +201,10 @@ fn check_error_patterns(props: test_props,
201
201
let mut done = false ;
202
202
for str:: split_char( procres. stderr, '\n' ) . each |line| {
203
203
if str:: contains ( line, next_err_pat) {
204
- debug ! { "found error pattern %s" , next_err_pat} ;
204
+ debug ! ( "found error pattern %s" , next_err_pat) ;
205
205
next_err_idx += 1 u;
206
206
if next_err_idx == vec:: len ( props. error_patterns ) {
207
- debug ! { "found all error patterns" } ;
207
+ debug ! ( "found all error patterns" ) ;
208
208
done = true ;
209
209
break ;
210
210
}
@@ -217,11 +217,11 @@ fn check_error_patterns(props: test_props,
217
217
vec:: slice ( props. error_patterns , next_err_idx,
218
218
vec:: len ( props. error_patterns ) ) ;
219
219
if vec:: len ( missing_patterns) == 1 u {
220
- fatal_procres ( fmt ! { "error pattern '%s' not found!" ,
221
- missing_patterns[ 0 ] } , procres) ;
220
+ fatal_procres ( fmt ! ( "error pattern '%s' not found!" ,
221
+ missing_patterns[ 0 ] ) , procres) ;
222
222
} else {
223
223
for missing_patterns. each |pattern| {
224
- error( fmt ! { "error pattern '%s' not found!" , pattern} ) ;
224
+ error( fmt ! ( "error pattern '%s' not found!" , pattern) ) ;
225
225
}
226
226
fatal_procres ( ~"multiple error patterns not found", procres) ;
227
227
}
@@ -240,7 +240,7 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
240
240
}
241
241
242
242
let prefixes = vec:: map ( expected_errors, |ee| {
243
- fmt ! { "%s:%u:" , testfile, ee. line}
243
+ fmt ! ( "%s:%u:" , testfile, ee. line)
244
244
} ) ;
245
245
246
246
// Scan and extract our error/warning messages,
@@ -253,8 +253,8 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
253
253
let mut was_expected = false ;
254
254
for vec:: eachi( expected_errors) |i, ee| {
255
255
if !found_flags[ i] {
256
- debug ! { "prefix=%s ee.kind=%s ee.msg=%s line=%s" ,
257
- prefixes[ i] , ee. kind, ee. msg, line} ;
256
+ debug ! ( "prefix=%s ee.kind=%s ee.msg=%s line=%s" ,
257
+ prefixes[ i] , ee. kind, ee. msg, line) ;
258
258
if ( str:: starts_with ( line, prefixes[ i] ) &&
259
259
str:: contains ( line, ee. kind ) &&
260
260
str:: contains ( line, ee. msg ) ) {
@@ -272,16 +272,16 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
272
272
273
273
if !was_expected && ( str:: contains ( line, ~"error") ||
274
274
str:: contains ( line, ~"warning") ) {
275
- fatal_procres ( fmt ! { "unexpected error pattern '%s'!" , line} ,
275
+ fatal_procres ( fmt ! ( "unexpected error pattern '%s'!" , line) ,
276
276
procres) ;
277
277
}
278
278
}
279
279
280
280
for uint:: range( 0 u, vec:: len( found_flags) ) |i| {
281
281
if !found_flags[ i] {
282
282
let ee = expected_errors[ i] ;
283
- fatal_procres ( fmt ! { "expected %s on line %u not found: %s" ,
284
- ee. kind, ee. line, ee. msg} , procres) ;
283
+ fatal_procres ( fmt ! ( "expected %s on line %u not found: %s" ,
284
+ ee. kind, ee. line, ee. msg) , procres) ;
285
285
}
286
286
}
287
287
}
@@ -330,7 +330,7 @@ fn compose_and_run_compiler(
330
330
config. compile_lib_path , option:: none) ;
331
331
if auxres. status != 0 {
332
332
fatal_procres (
333
- fmt ! { "auxiliary build of %s failed to compile: " , abs_ab} ,
333
+ fmt ! ( "auxiliary build of %s failed to compile: " , abs_ab) ,
334
334
auxres) ;
335
335
}
336
336
}
@@ -342,7 +342,7 @@ fn compose_and_run_compiler(
342
342
fn ensure_dir( path: Path ) {
343
343
if os:: path_is_dir ( path) { return ; }
344
344
if !os:: make_dir ( path, 0x1c0i32 ) {
345
- fail fmt ! { "can't make dir %s" , path} ;
345
+ fail fmt ! ( "can't make dir %s" , path) ;
346
346
}
347
347
}
348
348
@@ -414,7 +414,7 @@ fn program_output(config: config, testfile: ~str, lib_path: ~str, prog: ~str,
414
414
let cmdline =
415
415
{
416
416
let cmdline = make_cmdline ( lib_path, prog, args) ;
417
- logv ( config, fmt ! { "executing %s" , cmdline} ) ;
417
+ logv ( config, fmt ! ( "executing %s" , cmdline) ) ;
418
418
cmdline
419
419
} ;
420
420
let res = procsrv:: run ( lib_path, prog, args, env, input) ;
@@ -430,19 +430,19 @@ fn program_output(config: config, testfile: ~str, lib_path: ~str, prog: ~str,
430
430
#[ cfg( target_os = "macos" ) ]
431
431
#[ cfg( target_os = "freebsd" ) ]
432
432
fn make_cmdline( _libpath : ~str , prog : ~str , args : ~[ ~str ] ) -> ~str {
433
- fmt ! { "%s %s" , prog, str :: connect( args, ~" ")}
433
+ fmt ! ( "%s %s" , prog, str :: connect( args, ~" "))
434
434
}
435
435
436
436
#[cfg(target_os = " win32")]
437
437
fn make_cmdline(libpath: ~str, prog: ~str, args: ~[~str]) -> ~str {
438
- fmt!{ " %s %s %s", lib_path_cmd_prefix(libpath), prog,
439
- str::connect(args, ~" ")}
438
+ fmt!( " %s %s %s", lib_path_cmd_prefix(libpath), prog,
439
+ str::connect(args, ~" "))
440
440
}
441
441
442
442
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
443
443
// for diagnostic purposes
444
444
fn lib_path_cmd_prefix(path: ~str) -> ~str {
445
- fmt!{ " %s=\" %s\" ", util:: lib_path_env_var( ) , util:: make_new_path( path) }
445
+ fmt!( " %s=\" %s\" ", util:: lib_path_env_var( ) , util:: make_new_path( path) )
446
446
}
447
447
448
448
fn dump_output( config: config, testfile: ~str , out: ~str , err: ~str ) {
@@ -475,13 +475,13 @@ fn output_testname(testfile: ~str) -> ~str {
475
475
fn output_base_name(config: config, testfile: ~str) -> ~str {
476
476
let base = config.build_base;
477
477
let filename = output_testname(testfile);
478
- fmt ! { "%s%s.%s" , base, filename, config. stage_id}
478
+ fmt!( " %s%s. %s", base, filename, config.stage_id)
479
479
}
480
480
481
481
fn maybe_dump_to_stdout(config: config, out: ~str, err: ~str) {
482
482
if config.verbose {
483
- let sep1 = fmt ! { "------%s------------------------------" , ~"stdout"} ;
484
- let sep2 = fmt!{ " ------%s------------------------------", ~" stderr"} ;
483
+ let sep1 = fmt!( " ------%s------------------------------", ~" stdout") ;
484
+ let sep2 = fmt!( " ------%s------------------------------", ~" stderr") ;
485
485
let sep3 = ~" ------------------------------------------";
486
486
io::stdout().write_line(sep1);
487
487
io::stdout().write_line(out);
@@ -491,13 +491,13 @@ fn maybe_dump_to_stdout(config: config, out: ~str, err: ~str) {
491
491
}
492
492
}
493
493
494
- fn error(err: ~str) { io::stdout().write_line(fmt!{ " \n error: %s", err} ); }
494
+ fn error(err: ~str) { io::stdout().write_line(fmt!( " \n error: %s", err) ); }
495
495
496
496
fn fatal(err: ~str) -> ! { error(err); fail; }
497
497
498
498
fn fatal_procres(err: ~str, procres: procres) -> ! {
499
499
let msg =
500
- fmt!{ "\n \
500
+ fmt!( "\n \
501
501
error: %s\n \
502
502
command: %s\n \
503
503
stdout:\n \
@@ -509,7 +509,7 @@ stderr:\n\
509
509
%s\n \
510
510
------------------------------------------\n \
511
511
\n ",
512
- err, procres. cmdline, procres. stdout, procres. stderr} ;
512
+ err, procres. cmdline, procres. stdout, procres. stderr) ;
513
513
io:: stdout( ) . write_str( msg) ;
514
514
fail;
515
515
}
0 commit comments