|
|
@ -4,7 +4,7 @@ extern crate test; |
|
|
|
|
|
|
|
|
|
|
|
use std::io; |
|
|
|
use std::io; |
|
|
|
|
|
|
|
|
|
|
|
use test::{ColorConfig, Options, OutputFormat, RunIgnored, TestDescAndFn, TestFn, TestOpts}; |
|
|
|
use test::{ColorConfig, OutputFormat, TestDescAndFn, TestFn, TestOpts}; |
|
|
|
|
|
|
|
|
|
|
|
use crate::console::Console; |
|
|
|
use crate::console::Console; |
|
|
|
use crate::gfx::Gfx; |
|
|
|
use crate::gfx::Gfx; |
|
|
@ -25,34 +25,18 @@ pub(crate) fn run(tests: &[&TestDescAndFn]) { |
|
|
|
top_screen.set_wide_mode(true); |
|
|
|
top_screen.set_wide_mode(true); |
|
|
|
let _console = Console::init(top_screen); |
|
|
|
let _console = Console::init(top_screen); |
|
|
|
|
|
|
|
|
|
|
|
// TODO: it would be nice to have a way of specifying argv to make these
|
|
|
|
|
|
|
|
// configurable at runtime, but I can't figure out how to do it easily,
|
|
|
|
|
|
|
|
// so for now, just hardcode everything.
|
|
|
|
|
|
|
|
let opts = TestOpts { |
|
|
|
let opts = TestOpts { |
|
|
|
list: false, |
|
|
|
|
|
|
|
filters: Vec::new(), |
|
|
|
|
|
|
|
filter_exact: false, |
|
|
|
|
|
|
|
// Forking is not supported
|
|
|
|
|
|
|
|
force_run_in_process: true, |
|
|
|
force_run_in_process: true, |
|
|
|
exclude_should_panic: false, |
|
|
|
|
|
|
|
run_ignored: RunIgnored::No, |
|
|
|
|
|
|
|
run_tests: true, |
|
|
|
run_tests: true, |
|
|
|
// Don't run benchmarks. We may want to create a separate runner for them in the future
|
|
|
|
|
|
|
|
bench_benchmarks: false, |
|
|
|
|
|
|
|
logfile: None, |
|
|
|
|
|
|
|
nocapture: false, |
|
|
|
|
|
|
|
// TODO: color doesn't work because of TERM/TERMINFO.
|
|
|
|
// TODO: color doesn't work because of TERM/TERMINFO.
|
|
|
|
// With RomFS we might be able to fake this out nicely...
|
|
|
|
// With RomFS we might be able to fake this out nicely...
|
|
|
|
color: ColorConfig::AutoColor, |
|
|
|
color: ColorConfig::AutoColor, |
|
|
|
format: OutputFormat::Pretty, |
|
|
|
format: OutputFormat::Pretty, |
|
|
|
shuffle: false, |
|
|
|
// Hopefully this interface is more stable vs specifying individual options,
|
|
|
|
shuffle_seed: None, |
|
|
|
// and parsing the empty list of args should always work, I think.
|
|
|
|
test_threads: None, |
|
|
|
// TODO Ideally we could pass actual std::env::args() here too
|
|
|
|
skip: Vec::new(), |
|
|
|
..test::test::parse_opts(&[]).unwrap().unwrap() |
|
|
|
time_options: None, |
|
|
|
|
|
|
|
options: Options::new(), |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Use the default test implementation with our hardcoded options
|
|
|
|
// Use the default test implementation with our hardcoded options
|
|
|
|
let _success = run_static_tests(&opts, tests).unwrap(); |
|
|
|
let _success = run_static_tests(&opts, tests).unwrap(); |
|
|
|
|
|
|
|
|
|
|
|