summaryrefslogtreecommitdiffstats
path: root/README.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-10-25 13:55:00 +0100
committerBram Moolenaar <Bram@vim.org>2015-10-25 13:55:00 +0100
commitc92399f4ee6d0289dbe5d708d14a84e32f617bd5 (patch)
tree3e05760fa1c2c00b8046d31f776c95ad149709d6 /README.txt
parent60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d (diff)
patch 7.4.899v7.4.899
Problem: README file is not optimal. Solution: Move buttons, update some text. (closes #460)
Diffstat (limited to 'README.txt')
-rw-r--r--README.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/README.txt b/README.txt
index e706d750b5..d9fc6464db 100644
--- a/README.txt
+++ b/README.txt
@@ -1,7 +1,7 @@
README.txt for version 7.4 of Vim: Vi IMproved.
-WHAT IS VIM
+WHAT IS VIM?
Vim is an almost compatible version of the UNIX editor Vi. Many new features
have been added: multi-level undo, syntax highlighting, command line history,
@@ -21,6 +21,10 @@ UNIX. Porting to other systems should not be very difficult.
DISTRIBUTION
+You can often use your favorite package manager to install Vim. On Mac and
+Linux a small version of Vim is pre-installed, you still need to install Vim
+if you want more features.
+
There are separate distributions for Unix, PC, Amiga and some other systems.
This README.txt file comes with the runtime archive. It includes the
documentation, syntax files and other files that are used at runtime. To run
f' class='diff'>
diff --git a/Cargo.lock b/Cargo.lock
index 2fc432b..d4521ba 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -38,6 +38,15 @@ dependencies = [
]
[[package]]
+name = "ansi_term"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
name = "arc-swap"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -586,10 +595,12 @@ dependencies = [
name = "mqtt-tester"
version = "0.1.0"
dependencies = [
+ "ansi_term",
"bytes",
"clap 3.2.23",
"futures",
"miette",
+ "textwrap 0.15.2",
"tokio",
]
diff --git a/mqtt-tester/Cargo.toml b/mqtt-tester/Cargo.toml
index accbec9..dd6ec06 100644
--- a/mqtt-tester/Cargo.toml
+++ b/mqtt-tester/Cargo.toml
@@ -6,8 +6,10 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
+ansi_term = "0.12.1"
bytes = "1.1.0"
clap = { version = "3.2.8", features = ["derive"] }
futures = "0.3"
miette = { version = "5.1.1", features = ["fancy"] }
+textwrap = "0.15.0"
tokio = { version = "1.20", features = ["macros", "process", "rt", "rt-multi-thread", "io-util", "time"] }
diff --git a/mqtt-tester/src/main.rs b/mqtt-tester/src/main.rs
index 329d1c1..e4010e0 100644
--- a/mqtt-tester/src/main.rs
+++ b/mqtt-tester/src/main.rs
@@ -2,10 +2,12 @@ mod client_report;
mod command;
mod report;
-use std::path::PathBuf;
+use std::{path::PathBuf, process::exit};
use clap::{Parser, Subcommand};
use client_report::create_client_report;
+use miette::IntoDiagnostic;
+use report::{print_report, ReportResult};
#[derive(Parser, Debug)]
#[clap(author, version)]
@@ -31,9 +33,47 @@ async fn main() -> miette::Result<()> {
match args.command {
Commands::TestClient { executable } => {
- let report = create_client_report(executable, args.parallelism).await?;
+ let reports = create_client_report(executable, args.parallelism).await?;
- println!("Report: {:#?}", report);
+ let mut stdout = std::io::stdout().lock();
+ for report in &reports {
+ print_report(report, &mut stdout).into_diagnostic()?;
+ }
+
+ if reports.iter().any(|r| r.result != ReportResult::Success) {
+ struct ReportSummary {
+ successes: usize,
+ failures: usize,
+ inconclusive: usize,
+ }
+
+ let summary = reports.iter().fold(
+ ReportSummary {
+ successes: 0,
+ failures: 0,
+ inconclusive: 0,
+ },
+ |mut sum, rep| {
+ match rep.result {
+ ReportResult::Success => sum.successes += 1,
+ ReportResult::Failure => sum.failures += 1,
+ ReportResult::Inconclusive => sum.inconclusive += 1,
+ }
+
+ sum
+ },
+ );
+
+ println!();
+ println!(
+ "{} tests total, {} success, {} failures, {} inconclusive",
+ reports.len(),
+ summary.successes,
+ summary.failures,
+ summary.inconclusive
+ );
+ exit(1);
+ }
}
}
diff --git a/mqtt-tester/src/report.rs b/mqtt-tester/src/report.rs
index 4561184..8a1f28a 100644
--- a/mqtt-tester/src/report.rs
+++ b/mqtt-tester/src/report.rs
@@ -1,4 +1,6 @@
-#[derive(Debug)]
+use std::io::Write;
+
+#[derive(Debug, PartialEq, Eq)]
pub enum ReportResult {
Success,
Failure,
@@ -30,3 +32,29 @@ impl std::fmt::Debug for Report {
.finish()
}
}
+
+pub fn print_report(report: &Report, mut writer: impl Write) -> Result<(), std::io::Error> {
+ use ansi_term::Colour::{Blue, Green, Red, Yellow};
+ write!(writer, "{} ... ", Blue.paint(&report.name))?;
+
+ match report.result {
+ ReportResult::Success => write!(writer, "{}", Green.paint("ok"))?,
+ ReportResult::Failure => {
+ writeln!(writer, "{}", Red.paint("failed"))?;
+ writeln!(writer, " {}", report.description)?;
+ if let Some(output) = report.output.as_ref() {
+ writeln!(
+ writer,
+ "{}",
+ textwrap::indent(&String::from_utf8_lossy(output), "> ")
+ )?;
+ } else {
+ write!(writer, " {}", Red.paint("No extra output"))?;
+ }
+ }
+ ReportResult::Inconclusive => write!(writer, "{}", Yellow.paint("inconclusive"))?,
+ }
+
+ writeln!(writer)?;
+ Ok(())
+}