machinst x64: add testing to the CI;

This commit is contained in:
Benjamin Bouvier
2020-07-29 18:08:35 +02:00
parent 39ea64140f
commit 79abcdb035
11 changed files with 87 additions and 2 deletions

View File

@@ -151,7 +151,12 @@ fn write_testsuite_tests(
let testname = extract_name(path);
writeln!(out, "#[test]")?;
if ignore(testsuite, &testname, strategy) {
if experimental_x64_should_panic(testsuite, &testname, strategy) {
writeln!(
out,
r#"#[cfg_attr(feature = "experimental_x64", should_panic)]"#
)?;
} else if ignore(testsuite, &testname, strategy) {
writeln!(out, "#[ignore]")?;
}
writeln!(out, "fn r#{}() {{", &testname)?;
@@ -167,6 +172,21 @@ fn write_testsuite_tests(
Ok(())
}
/// For experimental_x64 backend features that are not supported yet, mark tests as panicking, so
/// they stop "passing" once the features are properly implemented.
fn experimental_x64_should_panic(testsuite: &str, testname: &str, strategy: &str) -> bool {
if !cfg!(feature = "experimental_x64") || strategy != "Cranelift" {
return false;
}
match (testsuite, testname) {
("simd", _) => return true,
_ => {}
}
false
}
/// Ignore tests that aren't supported yet.
fn ignore(testsuite: &str, testname: &str, strategy: &str) -> bool {
let target = env::var("TARGET").unwrap();