Skip to content

Commit 87ee6d3

Browse files
committed
Don't use tester on nightly
1 parent 326f119 commit 87ee6d3

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ serde = "1.0"
2525
serde_json = "1.0"
2626
serde_derive = "1.0"
2727
rustfix = "0.4.1"
28-
tester = { version = "0.5" }
28+
tester = { version = "0.5", package = "tester" }
2929

3030
[target."cfg(unix)".dependencies]
3131
libc = "0.2"

src/lib.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@
1111
#![crate_type = "lib"]
1212

1313
#![cfg_attr(feature = "rustc", feature(rustc_private))]
14+
#![cfg_attr(feature = "rustc", feature(test))]
1415

1516
#![deny(unused_imports)]
1617

1718
#[cfg(feature = "rustc")]
1819
extern crate rustc;
1920

21+
#[cfg(feature = "rustc")]
22+
extern crate test;
23+
24+
#[cfg(not(feature = "rustc"))]
25+
extern crate tester as test;
26+
2027
#[cfg(unix)]
2128
extern crate libc;
22-
extern crate test;
2329

2430
#[cfg(feature = "tmp")] extern crate tempfile;
2531

@@ -109,6 +115,10 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
109115
test::TestOpts {
110116
filter: config.filter.clone(),
111117
filter_exact: config.filter_exact,
118+
//#[cfg(feature = "rustc")]
119+
//force_run_in_process: false,
120+
#[cfg(feature = "rustc")]
121+
exclude_should_panic: false,
112122
run_ignored: if config.run_ignored { test::RunIgnored::Yes } else { test::RunIgnored::No },
113123
format: if config.quiet { test::OutputFormat::Terse } else { test::OutputFormat::Pretty },
114124
logfile: config.logfile.clone(),
@@ -123,6 +133,8 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
123133
skip: vec![],
124134
list: false,
125135
options: test::Options::new(),
136+
#[cfg(feature = "rustc")]
137+
time_options: None,
126138
}
127139
}
128140

@@ -254,6 +266,8 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> test::TestDescAndFn
254266
ignore: early_props.ignore,
255267
should_panic: should_panic,
256268
allow_fail: false,
269+
#[cfg(feature = "rustc")]
270+
test_type: test::TestType::IntegrationTest,
257271
},
258272
testfn: make_test_closure(config, testpaths),
259273
}

src/runtest.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,12 @@ impl<'test> TestCx<'test> {
266266
}
267267
}
268268

269-
#[cfg(feature = "stable")]
269+
#[cfg(not(feature = "rustc"))]
270270
fn run_pretty_test(&self) {
271271
self.fatal("pretty-printing tests can only be used with nightly Rust".into());
272272
}
273273

274-
#[cfg(not(feature = "stable"))]
274+
#[cfg(feature = "rustc")]
275275
fn run_pretty_test(&self) {
276276
if self.props.pp_exact.is_some() {
277277
logv(self.config, "testing for exact pretty-printing".to_owned());
@@ -348,7 +348,7 @@ impl<'test> TestCx<'test> {
348348
}
349349
}
350350

351-
#[cfg(not(feature = "stable"))]
351+
#[cfg(feature = "rustc")]
352352
fn print_source(&self, src: String, pretty_type: &str) -> ProcRes {
353353
let aux_dir = self.aux_output_dir_name();
354354

@@ -367,7 +367,7 @@ impl<'test> TestCx<'test> {
367367
Some(src))
368368
}
369369

370-
#[cfg(not(feature = "stable"))]
370+
#[cfg(feature = "rustc")]
371371
fn compare_source(&self,
372372
expected: &str,
373373
actual: &str) {
@@ -388,7 +388,7 @@ actual:\n\
388388
}
389389
}
390390

391-
#[cfg(not(feature = "stable"))]
391+
#[cfg(feature = "rustc")]
392392
fn typecheck_source(&self, src: String) -> ProcRes {
393393
let mut rustc = Command::new(&self.config.rustc_path);
394394

0 commit comments

Comments
 (0)