Skip to content

Commit df8e749

Browse files
committed
Run tree builder and tokenizer tests again.
libtest now ignores our #[start] trick: https://github.com/rust-lang/rust/blob/8dba06aeee28e9ed6a1b9918a91cbef242af53d3/src/libsyntax/test.rs#L205-L207 This runs a test harness nested in another. It’s not pretty, but it works.
1 parent 0e685c7 commit df8e749

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

tests/tokenizer.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
#![cfg_attr(feature = "unstable", feature(start, rt, test, plugin))]
10+
#![cfg_attr(feature = "unstable", feature(test, plugin))]
1111
#![cfg_attr(feature = "unstable", plugin(string_cache_plugin))]
1212

1313
#[cfg(feature = "unstable")] extern crate test;
@@ -20,7 +20,7 @@ extern crate html5ever;
2020
mod foreach_html5lib_test;
2121
use foreach_html5lib_test::foreach_html5lib_test;
2222

23-
use std::{char, env, rt};
23+
use std::{char, env};
2424
use std::ffi::OsStr;
2525
use std::mem::replace;
2626
use std::default::Default;
@@ -422,12 +422,8 @@ fn tests(src_dir: &Path) -> Vec<TestDescAndFn> {
422422
}
423423

424424
#[cfg(feature = "unstable")]
425-
#[start]
426-
fn start(argc: isize, argv: *const *const u8) -> isize {
427-
unsafe {
428-
rt::args::init(argc, argv);
429-
}
425+
#[test]
426+
fn run() {
430427
let args: Vec<_> = env::args().collect();
431428
test::test_main(&args, tests(Path::new(env!("CARGO_MANIFEST_DIR"))));
432-
0
433429
}

tests/tree_builder.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
#![cfg_attr(feature = "unstable", feature(start, rt, test, plugin))]
10+
#![cfg_attr(feature = "unstable", feature(test, plugin))]
1111
#![cfg_attr(feature = "unstable", plugin(string_cache_plugin))]
1212

1313
#[cfg(feature = "unstable")] extern crate test;
@@ -19,7 +19,7 @@ extern crate html5ever;
1919
mod foreach_html5lib_test;
2020
use foreach_html5lib_test::foreach_html5lib_test;
2121

22-
use std::{fs, io, env, rt};
22+
use std::{fs, io, env};
2323
use std::io::BufRead;
2424
use std::ffi::OsStr;
2525
use std::iter::repeat;
@@ -266,11 +266,8 @@ fn tests(src_dir: &Path, ignores: &HashSet<String>) -> Vec<TestDescAndFn> {
266266
}
267267

268268
#[cfg(feature = "unstable")]
269-
#[start]
270-
fn start(argc: isize, argv: *const *const u8) -> isize {
271-
unsafe {
272-
rt::args::init(argc, argv);
273-
}
269+
#[test]
270+
fn run() {
274271
let args: Vec<_> = env::args().collect();
275272
let src_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
276273
let mut ignores = HashSet::new();
@@ -283,5 +280,4 @@ fn start(argc: isize, argv: *const *const u8) -> isize {
283280
}
284281

285282
test::test_main(&args, tests(src_dir, &ignores));
286-
0
287283
}

0 commit comments

Comments
 (0)