Skip to content

Commit 040210c

Browse files
committed
[nextest-runner] a few renames
Rename `TestReporter` to simply `Reporter`, and `TestReporterImpl` to `DisplayReporterImpl` (to go with `DisplayReporter`).
1 parent 9f92435 commit 040210c

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

cargo-nextest/src/dispatch.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ use nextest_runner::{
3232
redact::Redactor,
3333
reporter::{
3434
events::{FinalRunStats, RunStatsFailureKind},
35-
highlight_end, structured, FinalStatusLevel, StatusLevel, TestOutputDisplay,
36-
TestOutputErrorSlice, TestReporterBuilder,
35+
highlight_end, structured, FinalStatusLevel, ReporterBuilder, StatusLevel,
36+
TestOutputDisplay, TestOutputErrorSlice,
3737
},
3838
reuse_build::{archive_to_file, ArchiveReporter, PathMapper, ReuseBuildInfo},
3939
runner::{configure_handle_inheritance, TestRunnerBuilder},
@@ -480,7 +480,7 @@ struct RunOpts {
480480
no_capture: bool,
481481

482482
#[clap(flatten)]
483-
reporter_opts: TestReporterOpts,
483+
reporter_opts: ReporterOpts,
484484

485485
#[clap(flatten)]
486486
reuse_build: ReuseBuildOpts,
@@ -942,7 +942,7 @@ enum MessageFormat {
942942

943943
#[derive(Debug, Default, Args)]
944944
#[command(next_help_heading = "Reporter options")]
945-
struct TestReporterOpts {
945+
struct ReporterOpts {
946946
/// Output stdout and stderr on failure
947947
#[arg(
948948
long,
@@ -1021,9 +1021,9 @@ struct TestReporterOpts {
10211021
message_format_version: Option<String>,
10221022
}
10231023

1024-
impl TestReporterOpts {
1025-
fn to_builder(&self, no_capture: bool, should_colorize: bool) -> TestReporterBuilder {
1026-
let mut builder = TestReporterBuilder::default();
1024+
impl ReporterOpts {
1025+
fn to_builder(&self, no_capture: bool, should_colorize: bool) -> ReporterBuilder {
1026+
let mut builder = ReporterBuilder::default();
10271027
builder.set_no_capture(no_capture);
10281028
builder.set_colorize(should_colorize);
10291029

@@ -1720,7 +1720,7 @@ impl App {
17201720
&self,
17211721
no_capture: bool,
17221722
runner_opts: &TestRunnerOpts,
1723-
reporter_opts: &TestReporterOpts,
1723+
reporter_opts: &ReporterOpts,
17241724
cli_args: Vec<String>,
17251725
output_writer: &mut OutputWriter,
17261726
) -> Result<i32> {

nextest-runner/src/reporter/displayer/imp.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl DisplayReporterBuilder {
111111
};
112112

113113
DisplayReporter {
114-
inner: TestReporterImpl {
114+
inner: DisplayReporterImpl {
115115
default_filter: self.default_filter,
116116
status_levels: StatusLevels {
117117
status_level,
@@ -132,7 +132,7 @@ impl DisplayReporterBuilder {
132132
/// Functionality to report test results to stderr, JUnit, and/or structured,
133133
/// machine-readable results to stdout
134134
pub(crate) struct DisplayReporter<'a> {
135-
inner: TestReporterImpl<'a>,
135+
inner: DisplayReporterImpl<'a>,
136136
stderr: ReporterStderrImpl<'a>,
137137
}
138138

@@ -207,7 +207,7 @@ impl FinalOutput {
207207
}
208208
}
209209

210-
struct TestReporterImpl<'a> {
210+
struct DisplayReporterImpl<'a> {
211211
default_filter: CompiledDefaultFilter,
212212
status_levels: StatusLevels,
213213
no_capture: bool,
@@ -218,7 +218,7 @@ struct TestReporterImpl<'a> {
218218
final_outputs: DebugIgnore<Vec<(TestInstance<'a>, FinalOutput)>>,
219219
}
220220

221-
impl<'a> TestReporterImpl<'a> {
221+
impl<'a> DisplayReporterImpl<'a> {
222222
fn write_event_impl(
223223
&mut self,
224224
event: &TestEvent<'a>,

nextest-runner/src/reporter/events.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use std::{collections::BTreeMap, fmt, process::ExitStatus, time::Duration};
1919

2020
/// A test event.
2121
///
22-
/// Events are produced by a [`TestRunner`](crate::runner::TestRunner) and consumed by a
23-
/// [`TestReporter`](crate::reporter::TestReporter).
22+
/// Events are produced by a [`TestRunner`](crate::runner::TestRunner) and
23+
/// consumed by a [`Reporter`](crate::reporter::Reporter).
2424
#[derive(Clone, Debug)]
2525
pub struct TestEvent<'a> {
2626
/// The time at which the event was generated, including the offset from UTC.

nextest-runner/src/reporter/imp.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub enum ReporterStderr<'a> {
3131

3232
/// Test reporter builder.
3333
#[derive(Debug, Default)]
34-
pub struct TestReporterBuilder {
34+
pub struct ReporterBuilder {
3535
no_capture: bool,
3636
should_colorize: bool,
3737
failure_output: Option<TestOutputDisplay>,
@@ -43,7 +43,7 @@ pub struct TestReporterBuilder {
4343
hide_progress_bar: bool,
4444
}
4545

46-
impl TestReporterBuilder {
46+
impl ReporterBuilder {
4747
/// Sets no-capture mode.
4848
///
4949
/// In this mode, `failure_output` and `success_output` will be ignored, and `status_level`
@@ -97,15 +97,15 @@ impl TestReporterBuilder {
9797
}
9898
}
9999

100-
impl TestReporterBuilder {
100+
impl ReporterBuilder {
101101
/// Creates a new test reporter.
102102
pub fn build<'a>(
103103
&self,
104104
test_list: &TestList,
105105
profile: &EvaluatableProfile<'a>,
106106
output: ReporterStderr<'a>,
107107
structured_reporter: StructuredReporter<'a>,
108-
) -> TestReporter<'a> {
108+
) -> Reporter<'a> {
109109
let aggregator = EventAggregator::new(profile);
110110

111111
let status_level = self.status_level.unwrap_or_else(|| profile.status_level());
@@ -128,7 +128,7 @@ impl TestReporterBuilder {
128128
}
129129
.build(output);
130130

131-
TestReporter {
131+
Reporter {
132132
display_reporter,
133133
structured_reporter,
134134
metadata_reporter: aggregator,
@@ -137,8 +137,8 @@ impl TestReporterBuilder {
137137
}
138138

139139
/// Functionality to report test results to stderr, JUnit, and/or structured,
140-
/// machine-readable results to stdout
141-
pub struct TestReporter<'a> {
140+
/// machine-readable results to stdout.
141+
pub struct Reporter<'a> {
142142
/// Used to display results to standard error.
143143
display_reporter: DisplayReporter<'a>,
144144
/// Used to aggregate events for JUnit reports written to disk
@@ -147,7 +147,7 @@ pub struct TestReporter<'a> {
147147
structured_reporter: StructuredReporter<'a>,
148148
}
149149

150-
impl<'a> TestReporter<'a> {
150+
impl<'a> Reporter<'a> {
151151
/// Report a test event.
152152
pub fn report_event(&mut self, event: TestEvent<'a>) -> Result<(), WriteEventError> {
153153
self.write_event(event)

nextest-runner/src/reporter/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
//! Report the results of a test run in human and machine-readable formats.
55
//!
6-
//! The main type here is [`TestReporter`], which is constructed via a [`TestReporterBuilder`].
6+
//! The main type here is [`Reporter`], which is constructed via a [`ReporterBuilder`].
77
88
mod aggregator;
99
mod displayer;

0 commit comments

Comments
 (0)