Skip to content

Commit 9f9efae

Browse files
committed
auto merge of #10673 : klutzy/rust/quite, r=alexcrichton
2 parents e03f17e + 5b42962 commit 9f9efae

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/etc/combine-tests.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,28 @@
55
# can run it "fast": spawning zillions of windows processes is our major build
66
# bottleneck (and it doesn't hurt to run faster on other platforms as well).
77

8-
import sys, os, re, codecs
8+
import sys
9+
import os
10+
import codecs
11+
912

1013
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
1518

1619
src_dir = scrub(os.getenv("CFG_SRC_DIR"))
1720
if not src_dir:
18-
raise Exception("missing env var CFG_SRC_DIR")
21+
raise Exception("missing env var CFG_SRC_DIR")
1922

2023
run_pass = os.path.join(src_dir, "src", "test", "run-pass")
2124
run_pass = os.path.abspath(run_pass)
2225
stage2_tests = []
2326

2427
for t in os.listdir(run_pass):
2528
if t.endswith(".rs") and not (
26-
t.startswith(".") or t.startswith("#") or t.startswith("~")):
29+
t.startswith(".") or t.startswith("#") or t.startswith("~")):
2730
f = codecs.open(os.path.join(run_pass, t), "r", "utf8")
2831
s = f.read()
2932
if not ("xfail-test" in s or
@@ -41,10 +44,11 @@ def scrub(b):
4144
c.write("// AUTO-GENERATED FILE: DO NOT EDIT\n")
4245
c.write("#[link(name=\"run_pass_stage2\", vers=\"0.1\")];\n")
4346
c.write("#[feature(globs, macro_rules, struct_variant, managed_boxes)];\n")
47+
c.write("#[allow(attribute_usage)];\n")
4448
for t in stage2_tests:
4549
p = os.path.join(run_pass, t)
4650
p = p.replace("\\", "\\\\")
47-
c.write("#[path = \"%s\"]" % p);
51+
c.write("#[path = \"%s\"]" % p)
4852
c.write("pub mod t_%d;\n" % i)
4953
i += 1
5054
c.close()
@@ -56,10 +60,10 @@ def scrub(b):
5660
d.write("extern mod extra;\n")
5761
d.write("extern mod run_pass_stage2;\n")
5862
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")
6367
i = 0
6468
for t in stage2_tests:
6569
p = os.path.join("test", "run-pass", t)

0 commit comments

Comments
 (0)