Skip to content

Commit 72982d6

Browse files
author
Fredrik Jansson
committed
Added ignored test parsing.
1 parent 76ddc94 commit 72982d6

File tree

1 file changed

+17
-19
lines changed
  • src/analysis/nextest_json

1 file changed

+17
-19
lines changed

src/analysis/nextest_json/mod.rs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
use crate::{
2-
CommandOutput,
3-
CommandOutputLine,
4-
CommandStream,
5-
Report,
6-
TLine,
7-
};
8-
9-
use super::{
10-
Analyzer,
11-
LineType,
12-
Stats,
13-
standard::StandardAnalyzer,
14-
};
1+
use crate::{CommandOutput, CommandOutputLine, CommandStream, Report, TLine};
2+
3+
use super::{Analyzer, LineType, Stats, standard::StandardAnalyzer};
154

165
#[derive(Debug, Default)]
176
pub struct NextestJSONAnalyzer {
@@ -72,6 +61,7 @@ impl Analyzer for NextestJSONAnalyzer {
7261
OutputLine::Test { event } => match event {
7362
TestEvent::Started => (),
7463
TestEvent::Ok { name: _ } => (),
64+
TestEvent::Ignored { name: _ } => (),
7565
TestEvent::Failed { name, stdout } => {
7666
let name = cleanup_name(&name);
7767
report.lines.push(crate::Line {
@@ -111,6 +101,7 @@ enum TestEvent {
111101
Started,
112102
Ok { name: String },
113103
Failed { name: String, stdout: String },
104+
Ignored { name: String },
114105
}
115106

116107
#[derive(Debug, serde::Deserialize, serde::Serialize, PartialEq)]
@@ -154,11 +145,7 @@ enum OutputLine {
154145

155146
#[cfg(test)]
156147
mod test {
157-
use super::{
158-
OutputLine,
159-
SuiteEvent,
160-
TestEvent,
161-
};
148+
use super::{OutputLine, SuiteEvent, TestEvent};
162149

163150
#[test]
164151
fn parse() {
@@ -231,6 +218,17 @@ mod test {
231218
}
232219
}
233220
);
221+
222+
let test_ignored =
223+
r#"{"type":"test","event":"ignored","name":"llvm::llvm$parser::test::var"}"#;
224+
assert_eq!(
225+
serde_json::from_str::<OutputLine>(test_ignored).unwrap(),
226+
OutputLine::Test {
227+
event: TestEvent::Ignored {
228+
name: "llm::llm$parser::test::var".to_owned(),
229+
}
230+
}
231+
);
234232
}
235233

236234
#[test]

0 commit comments

Comments
 (0)