Skip to content

Commit

Permalink
add "unstable" feature
Browse files Browse the repository at this point in the history
  • Loading branch information
bend-n committed Oct 12, 2023
1 parent db32e7e commit d7d326f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -21,6 +21,7 @@ thiserror = "1.0.31"
[features]
default = []
builder = ["derive_builder"]
unstable = []

[package.metadata.cargo_metadata_test]
some_field = true
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Expand Up @@ -99,6 +99,7 @@ pub use dependency::DependencyBuilder;
pub use dependency::{Dependency, DependencyKind};
use diagnostic::Diagnostic;
pub use errors::{Error, Result};
#[cfg(feature = "unstable")]
pub use libtest::TestMessage;
#[allow(deprecated)]
pub use messages::parse_messages;
Expand All @@ -116,6 +117,7 @@ use serde::{Deserialize, Deserializer, Serialize};
mod dependency;
pub mod diagnostic;
mod errors;
#[cfg(feature = "unstable")]
pub mod libtest;
mod messages;

Expand Down
14 changes: 3 additions & 11 deletions src/libtest.rs
@@ -1,4 +1,6 @@
//! parses output of <https://github.com/rust-lang/rust/blob/master/library/test/src/formatters/json.rs>.
//! Parses output of [libtest](https://github.com/rust-lang/rust/blob/master/library/test/src/formatters/json.rs).
//!
//! As this module parses output of a unstable format, all structs in this module are volatile.
use serde::{Deserialize, Serialize};

/// Suite related event
Expand Down Expand Up @@ -106,16 +108,6 @@ impl TestEvent {
_ => None,
}
}

/// If this test is in progress.
pub fn in_progress(&self) -> bool {
matches!(self, Self::Started { .. })
}

/// If this test has finished
pub fn is_finished(&self) -> bool {
!self.in_progress()
}
}

#[derive(Debug, PartialEq, Deserialize, Serialize)]
Expand Down

0 comments on commit d7d326f

Please sign in to comment.