Skip to content

Commit 9fc1ca9

Browse files
committed
---
yaml --- r: 69110 b: refs/heads/auto c: 79677f0 h: refs/heads/master v: v3
1 parent 374a96a commit 9fc1ca9

File tree

11 files changed

+73
-449
lines changed

11 files changed

+73
-449
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 0ba6a51f3269796e4b1e8fe4141ec6798fb8e5a3
17+
refs/heads/auto: 79677f05562ecc076feb2ee26958f53fb5fe5603
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/mk/snap.mk

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@ define DEF_SNAP_FOR_STAGE_H
1212
# $(1) stage
1313
# $(2) triple
1414

15-
ifdef CFG_INSTALL_SNAP
16-
snap-stage$(1)-H-$(2): $$(HSREQ$(1)_H_$(2))
17-
$(CFG_PYTHON) $(S)src/etc/make-snapshot.py stage$(1) $(2) install
18-
else
1915
snap-stage$(1)-H-$(2): $$(HSREQ$(1)_H_$(2))
2016
$(CFG_PYTHON) $(S)src/etc/make-snapshot.py stage$(1) $(2)
21-
endif
2217

2318
endef
2419

branches/auto/src/etc/make-snapshot.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@
33

44
import snapshot, sys
55

6-
if len(sys.argv) == 3:
7-
print(snapshot.make_snapshot(sys.argv[1], sys.argv[2], ""))
8-
else:
9-
print(snapshot.make_snapshot(sys.argv[1], sys.argv[2], sys.argv[3]))
6+
print(snapshot.make_snapshot(sys.argv[1], sys.argv[2]))

branches/auto/src/etc/snapshot.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def hash_file(x):
156156
return scrub(h.hexdigest())
157157

158158

159-
def make_snapshot(stage, triple, flag):
159+
def make_snapshot(stage, triple):
160160
kernel = get_kernel(triple)
161161
platform = get_platform(triple)
162162
rev = local_rev_short_sha()
@@ -190,33 +190,4 @@ def in_tar_name(fn):
190190

191191
shutil.move(file0, file1)
192192

193-
if flag == "install":
194-
# FIXME (#2664): this is an ugly quick hack; pls make it better
195-
path = file1
196-
comps = path.split("-")
197-
parts = { 'year': comps[2], \
198-
'month': comps[3], \
199-
'date': comps[4], \
200-
'check': comps[5], \
201-
'plat': comps[6], \
202-
'arch': comps[7], \
203-
'sha': comps[8].split(".")[0] }
204-
205-
shutil.move(path, "dl/" + path)
206-
shutil.move('src/snapshots.txt', 'src/snapshots-old.txt')
207-
208-
newf = open('src/snapshots.txt', 'w')
209-
newf.write("T %(year)s-%(month)s-%(date)s %(check)s\n" % parts)
210-
newf.write(" %(plat)s-%(arch)s %(sha)s\n\n" % parts)
211-
212-
oldf = open('src/snapshots-old.txt', 'r')
213-
for line in oldf:
214-
newf.write(line)
215-
oldf.close()
216-
217-
newf.close()
218-
219-
os.remove('src/snapshots-old.txt')
220-
221-
222193
return file1

branches/auto/src/libextra/base64.rs

Lines changed: 67 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -284,109 +284,81 @@ impl<'self> FromBase64 for &'self str {
284284
}
285285
}
286286

287-
#[cfg(test)]
288-
mod test {
289-
use test::BenchHarness;
290-
use base64::*;
291-
292-
#[test]
293-
fn test_to_base64_basic() {
294-
assert_eq!("".to_base64(STANDARD), ~"");
295-
assert_eq!("f".to_base64(STANDARD), ~"Zg==");
296-
assert_eq!("fo".to_base64(STANDARD), ~"Zm8=");
297-
assert_eq!("foo".to_base64(STANDARD), ~"Zm9v");
298-
assert_eq!("foob".to_base64(STANDARD), ~"Zm9vYg==");
299-
assert_eq!("fooba".to_base64(STANDARD), ~"Zm9vYmE=");
300-
assert_eq!("foobar".to_base64(STANDARD), ~"Zm9vYmFy");
301-
}
302-
303-
#[test]
304-
fn test_to_base64_line_break() {
305-
assert!(![0u8, 1000].to_base64(Config {line_length: None, ..STANDARD})
306-
.contains("\r\n"));
307-
assert_eq!("foobar".to_base64(Config {line_length: Some(4), ..STANDARD}),
308-
~"Zm9v\r\nYmFy");
309-
}
310-
311-
#[test]
312-
fn test_to_base64_padding() {
313-
assert_eq!("f".to_base64(Config {pad: false, ..STANDARD}), ~"Zg");
314-
assert_eq!("fo".to_base64(Config {pad: false, ..STANDARD}), ~"Zm8");
315-
}
287+
#[test]
288+
fn test_to_base64_basic() {
289+
assert_eq!("".to_base64(STANDARD), ~"");
290+
assert_eq!("f".to_base64(STANDARD), ~"Zg==");
291+
assert_eq!("fo".to_base64(STANDARD), ~"Zm8=");
292+
assert_eq!("foo".to_base64(STANDARD), ~"Zm9v");
293+
assert_eq!("foob".to_base64(STANDARD), ~"Zm9vYg==");
294+
assert_eq!("fooba".to_base64(STANDARD), ~"Zm9vYmE=");
295+
assert_eq!("foobar".to_base64(STANDARD), ~"Zm9vYmFy");
296+
}
316297
317-
#[test]
318-
fn test_to_base64_url_safe() {
319-
assert_eq!([251, 255].to_base64(URL_SAFE), ~"-_8");
320-
assert_eq!([251, 255].to_base64(STANDARD), ~"+/8=");
321-
}
298+
#[test]
299+
fn test_to_base64_line_break() {
300+
assert!(![0u8, 1000].to_base64(Config {line_length: None, ..STANDARD})
301+
.contains("\r\n"));
302+
assert_eq!("foobar".to_base64(Config {line_length: Some(4), ..STANDARD}),
303+
~"Zm9v\r\nYmFy");
304+
}
322305
323-
#[test]
324-
fn test_from_base64_basic() {
325-
assert_eq!("".from_base64().get(), "".as_bytes().to_owned());
326-
assert_eq!("Zg==".from_base64().get(), "f".as_bytes().to_owned());
327-
assert_eq!("Zm8=".from_base64().get(), "fo".as_bytes().to_owned());
328-
assert_eq!("Zm9v".from_base64().get(), "foo".as_bytes().to_owned());
329-
assert_eq!("Zm9vYg==".from_base64().get(), "foob".as_bytes().to_owned());
330-
assert_eq!("Zm9vYmE=".from_base64().get(), "fooba".as_bytes().to_owned());
331-
assert_eq!("Zm9vYmFy".from_base64().get(), "foobar".as_bytes().to_owned());
332-
}
306+
#[test]
307+
fn test_to_base64_padding() {
308+
assert_eq!("f".to_base64(Config {pad: false, ..STANDARD}), ~"Zg");
309+
assert_eq!("fo".to_base64(Config {pad: false, ..STANDARD}), ~"Zm8");
310+
}
333311
334-
#[test]
335-
fn test_from_base64_newlines() {
336-
assert_eq!("Zm9v\r\nYmFy".from_base64().get(),
337-
"foobar".as_bytes().to_owned());
338-
}
312+
#[test]
313+
fn test_to_base64_url_safe() {
314+
assert_eq!([251, 255].to_base64(URL_SAFE), ~"-_8");
315+
assert_eq!([251, 255].to_base64(STANDARD), ~"+/8=");
316+
}
339317
340-
#[test]
341-
fn test_from_base64_urlsafe() {
342-
assert_eq!("-_8".from_base64().get(), "+/8=".from_base64().get());
343-
}
318+
#[test]
319+
fn test_from_base64_basic() {
320+
assert_eq!("".from_base64().get(), "".as_bytes().to_owned());
321+
assert_eq!("Zg==".from_base64().get(), "f".as_bytes().to_owned());
322+
assert_eq!("Zm8=".from_base64().get(), "fo".as_bytes().to_owned());
323+
assert_eq!("Zm9v".from_base64().get(), "foo".as_bytes().to_owned());
324+
assert_eq!("Zm9vYg==".from_base64().get(), "foob".as_bytes().to_owned());
325+
assert_eq!("Zm9vYmE=".from_base64().get(), "fooba".as_bytes().to_owned());
326+
assert_eq!("Zm9vYmFy".from_base64().get(), "foobar".as_bytes().to_owned());
327+
}
344328
345-
#[test]
346-
fn test_from_base64_invalid_char() {
347-
assert!("Zm$=".from_base64().is_err())
348-
assert!("Zg==$".from_base64().is_err());
349-
}
329+
#[test]
330+
fn test_from_base64_newlines() {
331+
assert_eq!("Zm9v\r\nYmFy".from_base64().get(),
332+
"foobar".as_bytes().to_owned());
333+
}
350334
351-
#[test]
352-
fn test_from_base64_invalid_padding() {
353-
assert!("Z===".from_base64().is_err());
354-
}
335+
#[test]
336+
fn test_from_base64_urlsafe() {
337+
assert_eq!("-_8".from_base64().get(), "+/8=".from_base64().get());
338+
}
355339
356-
#[test]
357-
fn test_base64_random() {
358-
use std::rand::{task_rng, random, RngUtil};
359-
use std::vec;
340+
#[test]
341+
fn test_from_base64_invalid_char() {
342+
assert!("Zm$=".from_base64().is_err())
343+
assert!("Zg==$".from_base64().is_err());
344+
}
360345
361-
for 1000.times {
362-
let v: ~[u8] = do vec::build |push| {
363-
for task_rng().gen_uint_range(1, 100).times {
364-
push(random());
365-
}
366-
};
367-
assert_eq!(v.to_base64(STANDARD).from_base64().get(), v);
368-
}
369-
}
346+
#[test]
347+
fn test_from_base64_invalid_padding() {
348+
assert!("Z===".from_base64().is_err());
349+
}
370350

371-
#[bench]
372-
pub fn to_base64(bh: & mut BenchHarness) {
373-
let s = "イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム \
374-
ウヰノオクヤマ ケフコエテ アサキユメミシ ヱヒモセスン";
375-
do bh.iter {
376-
s.to_base64(STANDARD);
377-
}
378-
bh.bytes = s.len() as u64;
379-
}
351+
#[test]
352+
fn test_base64_random() {
353+
use std::rand::{task_rng, random, RngUtil};
354+
use std::vec;
380355

381-
#[bench]
382-
pub fn from_base64(bh: & mut BenchHarness) {
383-
let s = "イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム \
384-
ウヰノオクヤマ ケフコエテ アサキユメミシ ヱヒモセスン";
385-
let b = s.to_base64(STANDARD);
386-
do bh.iter {
387-
b.from_base64();
388-
}
389-
bh.bytes = b.len() as u64;
356+
for 1000.times {
357+
let v: ~[u8] = do vec::build |push| {
358+
for task_rng().gen_uint_range(1, 100).times {
359+
push(random());
360+
}
361+
};
362+
assert_eq!(v.to_base64(STANDARD).from_base64().get(), v);
390363
}
391-
392-
}
364+
}

branches/auto/src/libextra/container.rs

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -38,86 +38,3 @@ pub trait Deque<T> : Mutable {
3838
/// Remove the first element and return it, or None if the sequence is empty
3939
fn pop_front(&mut self) -> Option<T>;
4040
}
41-
42-
#[cfg(test)]
43-
mod bench {
44-
45-
use std::container::MutableMap;
46-
use std::{vec,rand,uint};
47-
use std::rand::RngUtil;
48-
use test::BenchHarness;
49-
50-
pub fn insert_rand_n<M:MutableMap<uint,uint>>(n: uint,
51-
map: &mut M,
52-
bh: &mut BenchHarness) {
53-
// setup
54-
let mut rng = rand::XorShiftRng::new();
55-
56-
map.clear();
57-
for uint::range(0,n) |_i| {
58-
map.insert(rng.gen::<uint>() % n, 1);
59-
}
60-
61-
// measure
62-
do bh.iter {
63-
let k = rng.gen::<uint>() % n;
64-
map.insert(k, 1);
65-
map.remove(&k);
66-
}
67-
}
68-
69-
pub fn insert_seq_n<M:MutableMap<uint,uint>>(n: uint,
70-
map: &mut M,
71-
bh: &mut BenchHarness) {
72-
// setup
73-
map.clear();
74-
for uint::range(0, n) |i| {
75-
map.insert(i*2, 1);
76-
}
77-
78-
// measure
79-
let mut i = 1;
80-
do bh.iter {
81-
map.insert(i, 1);
82-
map.remove(&i);
83-
i = (i + 2) % n;
84-
}
85-
}
86-
87-
pub fn find_rand_n<M:MutableMap<uint,uint>>(n: uint,
88-
map: &mut M,
89-
bh: &mut BenchHarness) {
90-
// setup
91-
let mut rng = rand::XorShiftRng::new();
92-
let mut keys = vec::from_fn(n, |_| rng.gen::<uint>() % n);
93-
94-
for keys.iter().advance() |k| {
95-
map.insert(*k, 1);
96-
}
97-
98-
rng.shuffle_mut(keys);
99-
100-
// measure
101-
let mut i = 0;
102-
do bh.iter {
103-
map.find(&(keys[i]));
104-
i = (i + 1) % n;
105-
}
106-
}
107-
108-
pub fn find_seq_n<M:MutableMap<uint,uint>>(n: uint,
109-
map: &mut M,
110-
bh: &mut BenchHarness) {
111-
// setup
112-
for uint::range(0, n) |i| {
113-
map.insert(i, 1);
114-
}
115-
116-
// measure
117-
let mut i = 0;
118-
do bh.iter {
119-
map.find(&i);
120-
i = (i + 1) % n;
121-
}
122-
}
123-
}

branches/auto/src/libextra/crypto/sha1.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -367,41 +367,3 @@ mod tests {
367367
}
368368
}
369369
}
370-
371-
#[cfg(test)]
372-
mod bench {
373-
374-
use sha1::Sha1;
375-
use test::BenchHarness;
376-
377-
#[bench]
378-
pub fn sha1_10(bh: & mut BenchHarness) {
379-
let mut sh = Sha1::new();
380-
let bytes = [1u8, ..10];
381-
do bh.iter {
382-
sh.input(bytes);
383-
}
384-
bh.bytes = bytes.len() as u64;
385-
}
386-
387-
#[bench]
388-
pub fn sha1_1k(bh: & mut BenchHarness) {
389-
let mut sh = Sha1::new();
390-
let bytes = [1u8, ..1024];
391-
do bh.iter {
392-
sh.input(bytes);
393-
}
394-
bh.bytes = bytes.len() as u64;
395-
}
396-
397-
#[bench]
398-
pub fn sha1_64k(bh: & mut BenchHarness) {
399-
let mut sh = Sha1::new();
400-
let bytes = [1u8, ..65536];
401-
do bh.iter {
402-
sh.input(bytes);
403-
}
404-
bh.bytes = bytes.len() as u64;
405-
}
406-
407-
}

0 commit comments

Comments
 (0)