diff --git a/Cargo.lock b/Cargo.lock index b261a00f4f3..b69b8d40ca2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5090,14 +5090,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "term" -version = "0.0.0" -dependencies = [ - "core", - "std", -] - [[package]] name = "term" version = "0.6.1" @@ -5150,7 +5142,6 @@ dependencies = [ "panic_unwind", "proc_macro", "std", - "term 0.0.0", ] [[package]] diff --git a/library/test/src/console.rs b/library/test/src/console.rs index 9cfc7eaf4bc..54e30a1fcd0 100644 --- a/library/test/src/console.rs +++ b/library/test/src/console.rs @@ -13,7 +13,7 @@ use super::{ formatters::{JsonFormatter, JunitFormatter, OutputFormatter, PrettyFormatter, TerseFormatter}, helpers::{concurrency::get_concurrency, metrics::MetricMap}, options::{Options, OutputFormat}, - run_tests, + run_tests, term, test_result::TestResult, time::{TestExecTime, TestSuiteExecTime}, types::{NamePadding, TestDesc, TestDescAndFn}, diff --git a/library/test/src/formatters/pretty.rs b/library/test/src/formatters/pretty.rs index e17fc08a9ae..9cad71e30bd 100644 --- a/library/test/src/formatters/pretty.rs +++ b/library/test/src/formatters/pretty.rs @@ -4,6 +4,7 @@ use super::OutputFormatter; use crate::{ bench::fmt_bench_samples, console::{ConsoleTestState, OutputLocation}, + term, test_result::TestResult, time, types::TestDesc, diff --git a/library/test/src/formatters/terse.rs b/library/test/src/formatters/terse.rs index a2c223c494c..0c8215c5dac 100644 --- a/library/test/src/formatters/terse.rs +++ b/library/test/src/formatters/terse.rs @@ -4,6 +4,7 @@ use super::OutputFormatter; use crate::{ bench::fmt_bench_samples, console::{ConsoleTestState, OutputLocation}, + term, test_result::TestResult, time, types::NamePadding, diff --git a/library/test/src/lib.rs b/library/test/src/lib.rs index 3da4d434f48..251f099f28a 100644 --- a/library/test/src/lib.rs +++ b/library/test/src/lib.rs @@ -20,7 +20,7 @@ #![crate_name = "test"] #![unstable(feature = "test", issue = "50297")] #![doc(test(attr(deny(warnings))))] -#![cfg_attr(unix, feature(libc))] +#![feature(libc)] #![feature(rustc_private)] #![feature(nll)] #![feature(available_concurrency)] @@ -80,6 +80,7 @@ mod formatters; mod helpers; mod options; pub mod stats; +mod term; mod test_result; mod time; mod types; diff --git a/library/test/src/term/mod.rs b/library/test/src/term.rs similarity index 90% rename from library/test/src/term/mod.rs rename to library/test/src/term.rs index 943b276a220..ae566305fc7 100644 --- a/library/test/src/term/mod.rs +++ b/library/test/src/term.rs @@ -1,38 +1,18 @@ -//! Terminal formatting library. +//! Terminal formatting module. //! -//! This crate provides the `Terminal` trait, which abstracts over an [ANSI +//! This module provides the `Terminal` trait, which abstracts over an [ANSI //! Terminal][ansi] to provide color printing, among other things. There are two //! implementations, the `TerminfoTerminal`, which uses control characters from //! a [terminfo][ti] database, and `WinConsole`, which uses the [Win32 Console //! API][win]. //! -//! # Examples -//! -//! ```no_run -//! # #![feature(rustc_private)] -//! extern crate term; -//! use std::io::prelude::*; -//! -//! fn main() { -//! let mut t = term::stdout().unwrap(); -//! -//! t.fg(term::color::GREEN).unwrap(); -//! write!(t, "hello, ").unwrap(); -//! -//! t.fg(term::color::RED).unwrap(); -//! writeln!(t, "world!").unwrap(); -//! -//! assert!(t.reset().unwrap()); -//! } //! ``` //! //! [ansi]: https://en.wikipedia.org/wiki/ANSI_escape_code //! [win]: https://docs.microsoft.com/en-us/windows/console/character-mode-applications //! [ti]: https://en.wikipedia.org/wiki/Terminfo -#![doc(html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))))] #![deny(missing_docs)] -#![cfg_attr(windows, feature(libc))] use std::io::prelude::*; use std::io::{self, Stderr, Stdout}; diff --git a/library/test/src/term/terminfo/mod.rs b/library/test/src/term/terminfo/mod.rs index fec59aaa0c2..f3cd1f99916 100644 --- a/library/test/src/term/terminfo/mod.rs +++ b/library/test/src/term/terminfo/mod.rs @@ -8,9 +8,9 @@ use std::fs::File; use std::io::{self, prelude::*, BufReader}; use std::path::Path; -use crate::color; -use crate::Attr; -use crate::Terminal; +use super::color; +use super::Attr; +use super::Terminal; use parm::{expand, Param, Variables}; use parser::compiled::{msys_terminfo, parse}; diff --git a/library/test/src/term/win.rs b/library/test/src/term/win.rs index c24cf9518aa..2b758e739c8 100644 --- a/library/test/src/term/win.rs +++ b/library/test/src/term/win.rs @@ -5,9 +5,9 @@ use std::io; use std::io::prelude::*; -use crate::color; -use crate::Attr; -use crate::Terminal; +use super::color; +use super::Attr; +use super::Terminal; /// A Terminal implementation that uses the Win32 Console API. pub struct WinConsole {