Testsuite: do not run rejected tests

pull/370/head
Tpt 2 years ago committed by Thomas Tanon
parent 6cabf6da15
commit 323ad73831
  1. 12
      testsuite/src/manifest.rs
  2. 9
      testsuite/src/vocab.rs

@ -85,6 +85,7 @@ impl Iterator for TestManifest {
impl TestManifest { impl TestManifest {
fn next_test(&mut self) -> Result<Option<Test>> { fn next_test(&mut self) -> Result<Option<Test>> {
loop {
let test_node = if let Some(test_node) = self.tests_to_do.pop_front() { let test_node = if let Some(test_node) = self.tests_to_do.pop_front() {
test_node test_node
} else { } else {
@ -96,6 +97,12 @@ impl TestManifest {
bail!("Invalid test identifier. Got {test_node}"); bail!("Invalid test identifier. Got {test_node}");
}; };
if self
.graph
.contains(TripleRef::new(&test_node, rdft::APPROVAL, rdft::REJECTED))
{
continue; // We do not run rejected tests
}
let name = if let Some(TermRef::Literal(c)) = self let name = if let Some(TermRef::Literal(c)) = self
.graph .graph
.object_for_subject_predicate(&test_node, mf::NAME) .object_for_subject_predicate(&test_node, mf::NAME)
@ -250,7 +257,7 @@ impl TestManifest {
Some(_) => bail!("invalid result"), Some(_) => bail!("invalid result"),
None => (None, Vec::new()), None => (None, Vec::new()),
}; };
Ok(Some(Test { return Ok(Some(Test {
id: test_node, id: test_node,
kind, kind,
name, name,
@ -263,7 +270,8 @@ impl TestManifest {
service_data, service_data,
result, result,
result_graph_data, result_graph_data,
})) }));
}
} }
fn load_next_manifest(&mut self) -> Result<Option<()>> { fn load_next_manifest(&mut self) -> Result<Option<()>> {

@ -48,6 +48,15 @@ pub mod mf {
); );
} }
pub mod rdft {
use oxigraph::model::NamedNodeRef;
pub const APPROVAL: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/rdftest#approval");
pub const REJECTED: NamedNodeRef<'_> =
NamedNodeRef::new_unchecked("http://www.w3.org/ns/rdftest#Rejected");
}
pub mod qt { pub mod qt {
use oxigraph::model::NamedNodeRef; use oxigraph::model::NamedNodeRef;

Loading…
Cancel
Save