2019-09-10 20:46:50 +02:00
|
|
|
use std::collections::BTreeMap;
|
|
|
|
use serde::Deserialize;
|
|
|
|
|
|
|
|
/// Test to skip (only if issue ongoing)
|
|
|
|
#[derive(Debug, PartialEq, Deserialize)]
|
2019-09-25 10:02:04 +02:00
|
|
|
pub struct SkipTests {
|
2019-09-10 20:46:50 +02:00
|
|
|
/// Block tests
|
2019-09-25 10:02:04 +02:00
|
|
|
pub block: Vec<SkipBlockchainTest>,
|
2019-09-10 20:46:50 +02:00
|
|
|
/// State tests
|
2019-09-25 10:02:04 +02:00
|
|
|
pub state: Vec<SkipStateTest>,
|
2019-09-10 20:46:50 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Block test to skip.
|
|
|
|
#[derive(Debug, PartialEq, Deserialize)]
|
2019-09-25 10:02:04 +02:00
|
|
|
pub struct SkipBlockchainTest {
|
2019-09-10 20:46:50 +02:00
|
|
|
/// Issue reference.
|
|
|
|
pub reference: String,
|
|
|
|
/// Test failing name.
|
|
|
|
pub failing: String,
|
|
|
|
/// Items failing for the test.
|
|
|
|
pub subtests: Vec<String>,
|
|
|
|
}
|
|
|
|
|
|
|
|
/// State test to skip.
|
|
|
|
#[derive(Debug, PartialEq, Deserialize)]
|
2019-09-25 10:02:04 +02:00
|
|
|
pub struct SkipStateTest {
|
2019-09-10 20:46:50 +02:00
|
|
|
/// Issue reference.
|
|
|
|
pub reference: String,
|
|
|
|
/// Test failing name.
|
|
|
|
pub failing: String,
|
|
|
|
/// Items failing for the test.
|
|
|
|
pub subtests: BTreeMap<String, StateSkipSubStates>
|
|
|
|
}
|
|
|
|
|
|
|
|
/// State subtest to skip.
|
|
|
|
#[derive(Debug, PartialEq, Deserialize)]
|
|
|
|
pub struct StateSkipSubStates {
|
|
|
|
/// State test number of this item. Or '*' for all state.
|
|
|
|
pub subnumbers: Vec<String>,
|
|
|
|
/// Chain for this items.
|
|
|
|
pub chain: String,
|
|
|
|
}
|
|
|
|
|
2019-09-25 10:02:04 +02:00
|
|
|
impl SkipTests {
|
2019-09-10 20:46:50 +02:00
|
|
|
/// Empty skip states.
|
|
|
|
pub fn empty() -> Self {
|
2019-09-25 10:02:04 +02:00
|
|
|
SkipTests {
|
2019-09-10 20:46:50 +02:00
|
|
|
block: Vec::new(),
|
|
|
|
state: Vec::new(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Loads test from json.
|
|
|
|
pub fn load<R>(reader: R) -> Result<Self, serde_json::Error> where R: std::io::Read {
|
|
|
|
serde_json::from_reader(reader)
|
|
|
|
}
|
|
|
|
}
|