5
5
# can run it "fast": spawning zillions of windows processes is our major build
6
6
# bottleneck (and it doesn't hurt to run faster on other platforms as well).
7
7
8
- import sys , os , re , codecs
8
+ import sys
9
+ import os
10
+ import codecs
11
+
9
12
10
13
def scrub (b ):
11
- if sys .version_info >= (3 ,) and type (b ) == bytes :
12
- return b .decode ('ascii' )
13
- else :
14
- return b
14
+ if sys .version_info >= (3 ,) and type (b ) == bytes :
15
+ return b .decode ('ascii' )
16
+ else :
17
+ return b
15
18
16
19
src_dir = scrub (os .getenv ("CFG_SRC_DIR" ))
17
20
if not src_dir :
18
- raise Exception ("missing env var CFG_SRC_DIR" )
21
+ raise Exception ("missing env var CFG_SRC_DIR" )
19
22
20
23
run_pass = os .path .join (src_dir , "src" , "test" , "run-pass" )
21
24
run_pass = os .path .abspath (run_pass )
22
25
stage2_tests = []
23
26
24
27
for t in os .listdir (run_pass ):
25
28
if t .endswith (".rs" ) and not (
26
- t .startswith ("." ) or t .startswith ("#" ) or t .startswith ("~" )):
29
+ t .startswith ("." ) or t .startswith ("#" ) or t .startswith ("~" )):
27
30
f = codecs .open (os .path .join (run_pass , t ), "r" , "utf8" )
28
31
s = f .read ()
29
32
if not ("xfail-test" in s or
@@ -41,10 +44,11 @@ def scrub(b):
41
44
c .write ("// AUTO-GENERATED FILE: DO NOT EDIT\n " )
42
45
c .write ("#[link(name=\" run_pass_stage2\" , vers=\" 0.1\" )];\n " )
43
46
c .write ("#[feature(globs, macro_rules, struct_variant, managed_boxes)];\n " )
47
+ c .write ("#[allow(attribute_usage)];\n " )
44
48
for t in stage2_tests :
45
49
p = os .path .join (run_pass , t )
46
50
p = p .replace ("\\ " , "\\ \\ " )
47
- c .write ("#[path = \" %s\" ]" % p );
51
+ c .write ("#[path = \" %s\" ]" % p )
48
52
c .write ("pub mod t_%d;\n " % i )
49
53
i += 1
50
54
c .close ()
@@ -56,10 +60,10 @@ def scrub(b):
56
60
d .write ("extern mod extra;\n " )
57
61
d .write ("extern mod run_pass_stage2;\n " )
58
62
d .write ("use run_pass_stage2::*;\n " )
59
- d .write ("use std::io;\n " );
60
- d .write ("use std::io::Writer;\n " );
61
- d .write ("fn main() {\n " );
62
- d .write (" let mut out = io::stdout();\n " );
63
+ d .write ("use std::io;\n " )
64
+ d .write ("use std::io::Writer;\n " )
65
+ d .write ("fn main() {\n " )
66
+ d .write (" let mut out = io::stdout();\n " )
63
67
i = 0
64
68
for t in stage2_tests :
65
69
p = os .path .join ("test" , "run-pass" , t )
0 commit comments