From 9fd57469a476e267c4fa54f3036fc71ebfbecfe2 Mon Sep 17 00:00:00 2001 From: Denis Lisov Date: Tue, 18 Jan 2022 13:47:16 +0300 Subject: [PATCH] yaml-test-suite: print the names of missing XFAILs --- saphyr/tests/yaml-test-suite.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/saphyr/tests/yaml-test-suite.rs b/saphyr/tests/yaml-test-suite.rs index 0972e26..49f74d7 100644 --- a/saphyr/tests/yaml-test-suite.rs +++ b/saphyr/tests/yaml-test-suite.rs @@ -35,8 +35,11 @@ fn main() -> Result<()> { let mut tests: Vec<_> = tests.into_iter().flatten().collect(); tests.sort_by_key(|t| t.name.clone()); - for &test in EXPECTED_FAILURES { - assert!(tests.iter().find(|t| t.name == test).is_some()); + let missing_xfails: Vec<_> = EXPECTED_FAILURES.iter() + .filter(|&&test| !tests.iter().any(|t| t.name == test)) + .collect(); + if !missing_xfails.is_empty() { + panic!("The following EXPECTED_FAILURES not found during discovery: {:?}", missing_xfails); } run_tests(