@@ -11,16 +11,15 @@ fn write_file(filename: str, content: str) {
11
11
result:: get (
12
12
io:: file_writer ( filename, [ io:: create, io:: truncate] ) )
13
13
. write_str ( content) ;
14
- // Work around https://github.com/graydon/rust/issues/726
15
- std:: run:: run_program ( "chmod" , [ "644" , filename] ) ;
16
14
}
17
15
18
16
fn contains ( haystack : str , needle : str ) -> bool {
19
17
str:: find ( haystack, needle) != -1
20
18
}
21
19
22
20
fn find_rust_files ( & files: [ str ] , path : str ) {
23
- if str:: ends_with ( path, ".rs" ) {
21
+ if str:: ends_with ( path, ".rs" ) && !contains ( path, "utf8" ) {
22
+ // ignoring "utf8" tests: https://github.com/graydon/rust/pull/1470 ?
24
23
files += [ path] ;
25
24
} else if fs:: path_is_dir ( path)
26
25
&& !contains ( path, "compile-fail" )
@@ -95,6 +94,9 @@ pure fn safe_to_use_expr(e: ast::expr, tm: test_mode) -> bool {
95
94
// https://github.com/graydon/rust/issues/928
96
95
//ast::expr_cast(_, _) { false }
97
96
97
+ // https://github.com/graydon/rust/issues/1458
98
+ ast:: expr_call ( _, _, _) { false }
99
+
98
100
_ { true }
99
101
}
100
102
}
@@ -139,11 +141,16 @@ fn steal(crate: ast::crate, tm: test_mode) -> stolen_stuff {
139
141
{ exprs: * exprs, tys: * tys}
140
142
}
141
143
142
- // https://github.com/graydon/rust/issues/652
144
+
143
145
fn safe_to_replace_expr ( e : ast:: expr_ , _tm : test_mode ) -> bool {
144
146
alt e {
147
+ // https://github.com/graydon/rust/issues/652
145
148
ast : : expr_if ( _, _, _) { false }
146
149
ast:: expr_block ( _) { false }
150
+
151
+ // expr_call is also missing a constraint
152
+ ast:: expr_fn_block ( _, _) { false }
153
+
147
154
_ { true }
148
155
}
149
156
}
@@ -168,10 +175,7 @@ fn replace_expr_in_crate(crate: ast::crate, i: uint, newexpr: ast::expr, tm: tes
168
175
if i_ + 1 u == * j_ && safe_to_replace_expr ( original, tm_) {
169
176
newexpr_
170
177
} else {
171
- alt ( original) {
172
- ast:: expr_fail ( _) { original /* Don't replace inside fail: https://github.com/graydon/rust/issues/930 */ }
173
- _ { fold : : noop_fold_expr ( original, fld) }
174
- }
178
+ fold:: noop_fold_expr ( original, fld)
175
179
}
176
180
}
177
181
let afp =
@@ -322,9 +326,7 @@ fn check_running(exe_filename: str) -> happiness {
322
326
log ( error, "comb comb comb: " + comb) ;
323
327
}
324
328
325
- if contains ( comb, "Assertion failed: (0), function alloc, file ../src/rt/rust_obstack.cpp" ) {
326
- known_bug ( "https://github.com/graydon/rust/issues/32 / https://github.com/graydon/rust/issues/445" )
327
- } else if contains ( comb, "Assertion failed:" ) {
329
+ if contains ( comb, "Assertion failed:" ) {
328
330
failed ( "C++ assertion failure" )
329
331
} else if contains ( comb, "leaked memory in rust main loop" ) {
330
332
// might also use exit code 134
@@ -333,40 +335,31 @@ fn check_running(exe_filename: str) -> happiness {
333
335
} else if contains ( comb, "src/rt/" ) {
334
336
failed ( "Mentioned src/rt/" )
335
337
} else if contains ( comb, "malloc" ) {
336
- failed ( "Mentioned malloc" )
337
- } else if contains ( comb, "Out of stack space, sorry" ) {
338
- known_bug ( "https://github.com/graydon/rust/issues/32 / https://github.com/graydon/rust/issues/445" )
338
+ //failed("Mentioned malloc")
339
+ known_bug ( "https://github.com/graydon/rust/issues/1461" )
339
340
} else {
340
341
alt p. status {
341
342
0 { passed }
342
343
100 { cleanly_rejected ( "running: explicit fail" ) }
343
344
101 | 247 { cleanly_rejected ( "running: timed out" ) }
344
- 245 | 246 | 138 | 252 { known_bug ( "https://github.com/graydon/rust/issues/32 ?? " ) }
345
+ 245 | 246 | 138 | 252 { known_bug ( "https://github.com/graydon/rust/issues/1466 " ) }
345
346
136 | 248 { known_bug ( "SIGFPE - https://github.com/graydon/rust/issues/944" ) }
346
347
rc { failed( "Rust program ran but exited with status " + int:: str ( rc) ) }
347
348
}
348
349
}
349
350
}
350
351
351
352
fn check_compiling ( filename : str ) -> happiness {
352
- /*
353
353
let p = std:: run:: program_output (
354
- "/Users/jruderman/code/rust/build/stage1/rustc",
355
- ["-c", filename]);
356
- */
357
-
358
- let p = std:: run:: program_output ( "bash" , [ "-c" , "DYLD_LIBRARY_PATH=/Users/jruderman/code/rust/build/stage0/lib:/Users/jruderman/code/rust/build/rustllvm/ /Users/jruderman/code/rust/build/stage1/rustc " + filename] ) ;
354
+ "/Users/jruderman/code/rust/build/x86_64-apple-darwin/stage1/bin/rustc" ,
355
+ [ filename] ) ;
359
356
360
357
//#error("Status: %d", p.status);
361
358
if p. err != "" {
362
359
if contains ( p. err , "Ptr must be a pointer to Val type" ) {
363
360
known_bug ( "https://github.com/graydon/rust/issues/897" )
364
- } else if contains ( p. err , "(castIsValid(op, S, Ty) && \" Invalid cast!\" ), function Create" ) {
365
- known_bug ( "https://github.com/graydon/rust/issues/901" )
366
- } else if contains ( p. err , "cast() argument of incompatible type!" ) {
367
- known_bug ( "https://github.com/graydon/rust/issues/973" )
368
- } else if contains ( p. err , "cast<Ty>() argument of incompatible type!" ) {
369
- known_bug ( "https://github.com/graydon/rust/issues/973" )
361
+ } else if contains ( p. err , "Assertion failed: ((i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && \" Calling a function with a bad signature!\" ), function init" ) {
362
+ known_bug ( "https://github.com/graydon/rust/issues/1459" )
370
363
} else {
371
364
log ( error, "Stderr: " + p. err ) ;
372
365
failed ( "Unfamiliar error message" )
@@ -375,23 +368,24 @@ fn check_compiling(filename: str) -> happiness {
375
368
passed
376
369
} else if contains ( p. out , "Out of stack space, sorry" ) {
377
370
known_bug ( "Recursive types - https://github.com/graydon/rust/issues/742" )
378
- } else if contains ( p. out , "Assertion !cx.terminated failed" ) {
379
- known_bug ( "https://github.com/graydon/rust/issues/893" )
380
- // } else if contains(p.out, "upcall fail 'non-exhaustive match failure', ../src/comp/middle/trans.rs") {
381
- } else if contains ( p. out , "trans_rec expected a rec but found _|_" ) {
382
- known_bug ( "https://github.com/graydon/rust/issues/924" )
383
371
} else if contains ( p. out , "Assertion" ) && contains ( p. out , "failed" ) {
384
372
log ( error, "Stdout: " + p. out ) ;
385
373
failed ( "Looks like an llvm assertion failure" )
386
374
387
- } else if contains ( p. out , "internal compiler error fail called with unsupported type _|_" ) {
388
- known_bug ( "https://github.com/graydon/rust/issues/942" )
389
- } else if contains ( p. out , "internal compiler error Translating unsupported cast" ) {
390
- known_bug ( "https://github.com/graydon/rust/issues/932" )
391
- } else if contains ( p. out , "internal compiler error sequence_element_type called on non-sequence value" ) {
392
- known_bug ( "https://github.com/graydon/rust/issues/931" )
375
+ } else if contains ( p. out , "upcall fail 'option none'" ) {
376
+ known_bug ( "https://github.com/graydon/rust/issues/1463" )
377
+ } else if contains ( p. out , "upcall fail 'non-exhaustive match failure', ../src/comp/middle/typeck.rs:1554" ) {
378
+ known_bug ( "https://github.com/graydon/rust/issues/1462" )
379
+ } else if contains ( p. out , "upcall fail 'Assertion cx.fcx.llupvars.contains_key(did.node) failed'" ) {
380
+ known_bug ( "https://github.com/graydon/rust/issues/1467" )
381
+ } else if contains ( p. out , "Taking the value of a method does not work yet (issue #435)" ) {
382
+ known_bug ( "https://github.com/graydon/rust/issues/435" )
393
383
} else if contains ( p. out , "internal compiler error bit_num: asked for pred constraint, found an init constraint" ) {
394
384
known_bug ( "https://github.com/graydon/rust/issues/933" )
385
+ } else if contains ( p. out , "internal compiler error" ) && contains ( p. out , "called on non-fn type" ) {
386
+ known_bug ( "https://github.com/graydon/rust/issues/1460" )
387
+ } else if contains ( p. out , "internal compiler error fail called with unsupported type _|_" ) {
388
+ known_bug ( "https://github.com/graydon/rust/issues/1465" )
395
389
} else if contains ( p. out , "internal compiler error unimplemented" ) {
396
390
known_bug ( "Something unimplemented" )
397
391
} else if contains ( p. out , "internal compiler error" ) {
@@ -453,7 +447,8 @@ fn content_is_dangerous_to_compile(code: str) -> bool {
453
447
[ "xfail-test" ,
454
448
"-> !" , // https://github.com/graydon/rust/issues/897
455
449
"tag" , // typeck hang with ty variants: https://github.com/graydon/rust/issues/742 (from dup #900)
456
- "with" // tstate hang with expr variants: https://github.com/graydon/rust/issues/948
450
+ "with" , // tstate hang with expr variants: https://github.com/graydon/rust/issues/948
451
+ "import comm" // mysterious hang: https://github.com/graydon/rust/issues/1464
457
452
] ;
458
453
459
454
for p: str in dangerous_patterns { if contains ( code, p) { ret true ; } }
@@ -468,7 +463,6 @@ fn content_might_not_converge(code: str) -> bool {
468
463
"spawn" , // precedence issues?
469
464
"bind" , // precedence issues?
470
465
" be " , // don't want to replace its child with a non-call: "Non-call expression in tail call"
471
- "&!" , // https://github.com/graydon/rust/issues/972
472
466
"\n \n \n \n \n " // https://github.com/graydon/rust/issues/850
473
467
] ;
474
468
@@ -477,7 +471,13 @@ fn content_might_not_converge(code: str) -> bool {
477
471
}
478
472
479
473
fn file_might_not_converge ( filename : str ) -> bool {
480
- let confusing_files = [ "expr-alt.rs" ] ; // pretty-printing "(a = b) = c" vs "a = b = c" and wrapping
474
+ let confusing_files = [
475
+ "expr-alt.rs" , // pretty-printing "(a = b) = c" vs "a = b = c" and wrapping
476
+ "block-arg-in-ternary.rs" , // wrapping
477
+ "move-3-unique.rs" , // 0 becomes (0), but both seem reasonable. wtf?
478
+ "move-3.rs" , // 0 becomes (0), but both seem reasonable. wtf?
479
+ ] ;
480
+
481
481
482
482
for f in confusing_files { if contains ( filename, f) { ret true ; } }
483
483
@@ -528,6 +528,7 @@ fn check_convergence(files: [str]) {
528
528
fn check_variants ( files : [ str ] , cx : context ) {
529
529
for file in files {
530
530
if cx. mode == tm_converge && file_might_not_converge ( file) {
531
+ #error ( "Skipping convergence test based on file_might_not_converge" ) ;
531
532
cont;
532
533
}
533
534
@@ -566,8 +567,11 @@ fn main(args: [str]) {
566
567
let root = args[ 1 ] ;
567
568
568
569
find_rust_files ( files, root) ;
570
+ #error ( "== check_convergence ==" ) ;
569
571
check_convergence ( files) ;
572
+ #error ( "== check_variants: converge ==" ) ;
570
573
check_variants ( files, { mode: tm_converge } ) ;
574
+ #error ( "== check_variants: run ==" ) ;
571
575
check_variants ( files, { mode: tm_run } ) ;
572
576
573
577
#error ( "Fuzzer done" ) ;
0 commit comments