mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-26 00:22:10 +03:00
Move summary module in cli.
This commit is contained in:
parent
48847abeaa
commit
d0ce2a8573
@ -19,7 +19,9 @@ mod error;
|
||||
mod interactive;
|
||||
mod logger;
|
||||
pub(crate) mod options;
|
||||
mod summary;
|
||||
|
||||
pub(crate) use self::error::CliError;
|
||||
pub(crate) use self::logger::BaseLogger;
|
||||
pub(crate) use self::options::OutputType;
|
||||
pub(crate) use self::summary::summary;
|
||||
|
@ -20,7 +20,7 @@ use crate::HurlRun;
|
||||
/// Returns the text summary of this Hurl `runs`.
|
||||
///
|
||||
/// This is used in `--test`mode.
|
||||
pub fn get_summary(runs: &[HurlRun], duration: u128) -> String {
|
||||
pub fn summary(runs: &[HurlRun], duration: u128) -> String {
|
||||
let total_files = runs.len();
|
||||
let total_requests = requests_count(runs);
|
||||
let success_files = runs.iter().filter(|r| r.hurl_result.success).count();
|
||||
@ -82,9 +82,9 @@ pub mod tests {
|
||||
|
||||
let runs = vec![new_run(true, 10), new_run(true, 20), new_run(true, 4)];
|
||||
let duration = 128;
|
||||
let summary = get_summary(&runs, duration);
|
||||
let s = summary(&runs, duration);
|
||||
assert_eq!(
|
||||
summary,
|
||||
s,
|
||||
"--------------------------------------------------------------------------------\n\
|
||||
Executed files: 3\n\
|
||||
Executed requests: 0\n\
|
||||
@ -95,9 +95,9 @@ pub mod tests {
|
||||
|
||||
let runs = vec![new_run(true, 10), new_run(false, 10), new_run(true, 40)];
|
||||
let duration = 200;
|
||||
let summary = get_summary(&runs, duration);
|
||||
let s = summary(&runs, duration);
|
||||
assert_eq!(
|
||||
summary,
|
||||
s,
|
||||
"--------------------------------------------------------------------------------\n\
|
||||
Executed files: 3\n\
|
||||
Executed requests: 0\n\
|
@ -17,7 +17,6 @@
|
||||
*/
|
||||
mod cli;
|
||||
mod run;
|
||||
mod test;
|
||||
|
||||
use std::io::prelude::*;
|
||||
use std::path::Path;
|
||||
@ -106,7 +105,7 @@ fn main() {
|
||||
unwrap_or_exit(ret, EXIT_ERROR_UNDEFINED, &base_logger);
|
||||
|
||||
if opts.test {
|
||||
let summary = test::get_summary(&runs, duration);
|
||||
let summary = cli::summary(&runs, duration);
|
||||
base_logger.info(summary.as_str());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user