run_test_suite_lib/output/
noop.rs1use crate::output::{
6 ArtifactType, DirectoryArtifactType, DirectoryWrite, DynArtifact, DynDirectoryArtifact,
7 EntityId, EntityInfo, ReportedOutcome, Reporter, Timestamp,
8};
9use std::io::Error;
10use std::path::Path;
11
12pub struct NoopReporter;
14pub(super) struct NoopDirectoryWriter;
15
16impl Reporter for NoopReporter {
17 fn new_entity(&self, _: &EntityId, _: &str) -> Result<(), Error> {
18 Ok(())
19 }
20
21 fn set_entity_info(&self, _: &EntityId, _: &EntityInfo) {}
22
23 fn entity_started(&self, _: &EntityId, _: Timestamp) -> Result<(), Error> {
24 Ok(())
25 }
26
27 fn entity_stopped(&self, _: &EntityId, _: &ReportedOutcome, _: Timestamp) -> Result<(), Error> {
28 Ok(())
29 }
30
31 fn entity_finished(&self, _: &EntityId) -> Result<(), Error> {
32 Ok(())
33 }
34
35 fn new_artifact(
36 &self,
37 _entity: &EntityId,
38 _type: &ArtifactType,
39 ) -> Result<Box<DynArtifact>, Error> {
40 Ok(Box::new(std::io::sink()))
41 }
42
43 fn new_directory_artifact(
44 &self,
45 _entity: &EntityId,
46 _artifact_type: &DirectoryArtifactType,
47 _component_moniker: Option<String>,
48 ) -> Result<Box<DynDirectoryArtifact>, Error> {
49 Ok(Box::new(NoopDirectoryWriter))
50 }
51}
52
53impl DirectoryWrite for NoopDirectoryWriter {
54 fn new_file(&self, _path: &Path) -> Result<Box<DynArtifact>, Error> {
55 Ok(Box::new(std::io::sink()))
56 }
57}