Skip to content

Commit ad28f8a

Browse files
committed
fix!: Remove unstable --format=junit
1 parent f195b3a commit ad28f8a

9 files changed

Lines changed: 4 additions & 241 deletions

File tree

crates/libtest-lexarg/src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ pub enum OutputFormat {
7878
Terse,
7979
/// JSON output
8080
Json,
81-
/// JUnit output
82-
Junit,
8381
}
8482

8583
impl Default for OutputFormat {
@@ -123,12 +121,11 @@ Options:
123121
on serially (default);
124122
always = always colorize output;
125123
never = never colorize output;
126-
--format pretty|terse|json|junit
124+
--format pretty|terse|json
127125
Configure formatting of output:
128126
pretty = Print verbose output;
129127
terse = Display one character per test;
130128
json = Output a json document;
131-
junit = Output a JUnit document
132129
--show-output Show captured stdout of successful tests
133130
-Z unstable-options Enable nightly-only flags:
134131
unstable-options = Allow use of experimental features
@@ -268,13 +265,12 @@ impl TestOptsBuilder {
268265
let format = parser
269266
.next_flag_value()
270267
.ok_or_missing(Value(std::ffi::OsStr::new("FORMAT")))
271-
.one_of(&["pretty", "terse", "json", "junit"])
268+
.one_of(&["pretty", "terse", "json"])
272269
.within(arg)?;
273270
self.format = Some(match format {
274271
"pretty" => OutputFormat::Pretty,
275272
"terse" => OutputFormat::Terse,
276273
"json" => OutputFormat::Json,
277-
"junit" => OutputFormat::Junit,
278274
_ => unreachable!("`one_of` should prevent this"),
279275
});
280276
}

crates/libtest2-harness/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pre-release-replacements = [
2727
default = []
2828
color = ["dep:anstream", "dep:anstyle"]
2929
json = ["libtest-json/serde", "dep:serde", "dep:serde_json"]
30-
junit = []
3130
threads = []
3231

3332
[dependencies]

crates/libtest2-harness/src/harness.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,6 @@ fn notifier(opts: &libtest_lexarg::TestOpts) -> std::io::Result<Box<dyn notify::
149149
_ if opts.list => Box::new(notify::TerseListNotifier::new(stdout)),
150150
OutputFormat::Pretty => Box::new(notify::PrettyRunNotifier::new(stdout)),
151151
OutputFormat::Terse => Box::new(notify::TerseRunNotifier::new(stdout)),
152-
#[cfg(feature = "junit")]
153-
OutputFormat::Junit => Box::new(notify::JunitRunNotifier::new(stdout)),
154-
#[cfg(not(feature = "junit"))]
155-
OutputFormat::Junit => {
156-
return Err(std::io::Error::new(
157-
std::io::ErrorKind::Other,
158-
"`--format=junit` is not supported",
159-
));
160-
}
161152
};
162153
Ok(notifier)
163154
}

crates/libtest2-harness/src/notify/junit.rs

Lines changed: 0 additions & 121 deletions
This file was deleted.

crates/libtest2-harness/src/notify/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#[cfg(feature = "json")]
22
mod json;
3-
#[cfg(feature = "junit")]
4-
mod junit;
53
#[cfg(not(feature = "color"))]
64
mod no_style;
75
mod pretty;
@@ -12,8 +10,6 @@ mod terse;
1210

1311
#[cfg(feature = "json")]
1412
pub(crate) use json::*;
15-
#[cfg(feature = "junit")]
16-
pub(crate) use junit::*;
1713
#[cfg(not(feature = "color"))]
1814
pub(crate) use no_style::*;
1915
pub(crate) use pretty::*;

crates/libtest2-mimic/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ pre-release-replacements = [
2424
]
2525

2626
[features]
27-
default = ["color", "json", "junit", "threads"]
27+
default = ["color", "json", "threads"]
2828
color = ["libtest2-harness/color"]
2929
json = ["libtest2-harness/json"]
30-
junit = ["libtest2-harness/junit"]
3130
threads = ["libtest2-harness/threads"]
3231

3332
[dependencies]

crates/libtest2-mimic/tests/testsuite/mixed_bag.rs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -688,54 +688,6 @@ fn test_json() {
688688
);
689689
}
690690

691-
#[test]
692-
#[cfg(feature = "junit")]
693-
fn list_junit() {
694-
check(
695-
&["-Zunstable-options", "--format=junit", "--list", "a"],
696-
0,
697-
r#"bear: test
698-
cat: test
699-
700-
2 tests
701-
702-
"#,
703-
r#"bear: test
704-
cat: test
705-
706-
2 tests
707-
708-
"#,
709-
);
710-
}
711-
712-
#[test]
713-
#[cfg(feature = "junit")]
714-
fn test_junit() {
715-
check(
716-
&["-Zunstable-options", "--format=junit", "a"],
717-
0,
718-
r#"<?xml version="1.0" encoding="UTF-8"?>
719-
<testsuites>
720-
<testsuite name="test" package="test" id="0" tests="2" errors="0" failures="0" skipped="1" >
721-
<testcase classname="crate" name="cat" time="0.000s"/>
722-
<system-out/>
723-
<system-err/>
724-
</testsuite>
725-
</testsuites>
726-
"#,
727-
r#"<?xml version="1.0" encoding="UTF-8"?>
728-
<testsuites>
729-
<testsuite name="test" package="test" id="0" tests="2" errors="0" failures="0" skipped="1" >
730-
<testcase classname="crate" name="cat" time="0.000s"/>
731-
<system-out/>
732-
<system-err/>
733-
</testsuite>
734-
</testsuites>
735-
"#,
736-
);
737-
}
738-
739691
#[test]
740692
fn terse_output() {
741693
check(

crates/libtest2/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ pre-release-replacements = [
2424
]
2525

2626
[features]
27-
default = ["color", "json", "junit", "threads"]
27+
default = ["color", "json", "threads"]
2828
color = ["libtest2-harness/color"]
2929
json = ["libtest2-harness/json"]
30-
junit = ["libtest2-harness/junit"]
3130
threads = ["libtest2-harness/threads"]
3231

3332
[dependencies]

crates/libtest2/tests/testsuite/mixed_bag.rs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -695,54 +695,6 @@ fn test_json() {
695695
);
696696
}
697697

698-
#[test]
699-
#[cfg(feature = "junit")]
700-
fn list_junit() {
701-
check(
702-
&["-Zunstable-options", "--format=junit", "--list", "a"],
703-
0,
704-
r#"bear: test
705-
cat: test
706-
707-
2 tests
708-
709-
"#,
710-
r#"bear: test
711-
cat: test
712-
713-
2 tests
714-
715-
"#,
716-
);
717-
}
718-
719-
#[test]
720-
#[cfg(feature = "junit")]
721-
fn test_junit() {
722-
check(
723-
&["-Zunstable-options", "--format=junit", "a"],
724-
0,
725-
r#"<?xml version="1.0" encoding="UTF-8"?>
726-
<testsuites>
727-
<testsuite name="test" package="test" id="0" tests="2" errors="0" failures="0" skipped="1" >
728-
<testcase classname="crate" name="cat" time="0.000s"/>
729-
<system-out/>
730-
<system-err/>
731-
</testsuite>
732-
</testsuites>
733-
"#,
734-
r#"<?xml version="1.0" encoding="UTF-8"?>
735-
<testsuites>
736-
<testsuite name="test" package="test" id="0" tests="2" errors="0" failures="0" skipped="1" >
737-
<testcase classname="crate" name="cat" time="0.000s"/>
738-
<system-out/>
739-
<system-err/>
740-
</testsuite>
741-
</testsuites>
742-
"#,
743-
);
744-
}
745-
746698
#[test]
747699
fn terse_output() {
748700
check(

0 commit comments

Comments
 (0)