Allow platform specific excludes

This commit is contained in:
Brandon Fish 2019-08-05 20:57:07 -06:00
parent c15da949bb
commit 8c13eae2b8
2 changed files with 38 additions and 6 deletions

View File

@ -10,6 +10,11 @@
#
# Star line allows skipping an entire wast file
# clif:skip:simd.wast:*
#
# Excludes can also contain platform
# clif:skip:data.wast:172:windows
# clif:skip:data.wast:172:unix
#
# Cranelift
clif:skip:elem.wast:229 # Spec running forever
@ -185,6 +190,9 @@ clif:fail:start.wast:92 # Module - caught panic Any
# clif:skip:skip-stack-guard-page.wast:2 # Slow test
# Cranelift Windows
clif:skip:address.wast:194:windows
# LLVM bug with min/max over NaNs
llvm:skip:f32.wast:1651
llvm:skip:f32.wast:1652

View File

@ -51,6 +51,11 @@ mod tests {
self.allowed_failure += 1;
return;
}
let platform_key = format!("{}:{}", testkey, get_platform());
if excludes.contains_key(&platform_key) {
self.allowed_failure += 1;
return;
}
self.failed += 1;
self.failures.push(failure);
}
@ -96,6 +101,16 @@ mod tests {
"singlepass"
}
#[cfg(unix)]
fn get_platform() -> &'static str {
"unix"
}
#[cfg(windows)]
fn get_platform() -> &'static str {
"windows"
}
#[cfg(not(any(feature = "llvm", feature = "clif", feature = "singlepass")))]
fn get_compiler_name() -> &'static str {
panic!("compiler not specified, activate a compiler via features");
@ -157,19 +172,21 @@ mod tests {
let mut named_modules: HashMap<String, Rc<Instance>> = HashMap::new();
let mut registered_modules: HashMap<String, Module> = HashMap::new();
let platform = get_platform();
//
while let Some(Command { kind, line }) =
parser.next().map_err(|e| format!("Parse err: {:?}", e))?
{
let test_key = format!("{}:{}:{}", backend, filename, line);
let test_platform_key = format!("{}:{}:{}:{}", backend, filename, line, platform);
// Use this line to debug which test is running
//println!("Running test: {}", test_key);
if excludes.contains_key(&test_key)
&& *excludes.get(&test_key).unwrap() == Exclude::Skip
if (excludes.contains_key(&test_key)
&& *excludes.get(&test_key).unwrap() == Exclude::Skip)
|| (excludes.contains_key(&test_platform_key)
&& *excludes.get(&test_platform_key).unwrap() == Exclude::Skip)
{
// println!("Skipping test: {}", test_key);
continue;
@ -1058,16 +1075,23 @@ mod tests {
//println!("exclude line {}", line);
// <backend>:<exclude-kind>:<test-file-name>:<test-file-line>
let split: Vec<&str> = line.trim().split(':').collect();
assert_eq!(split.len(), 4);
let kind = match *split.get(1).unwrap() {
"skip" => Exclude::Skip,
"fail" => Exclude::Fail,
_ => panic!("unknown exclude kind"),
};
let has_platform = split.len() > 4;
let backend = split.get(0).unwrap();
let testfile = split.get(2).unwrap();
let line = split.get(3).unwrap();
let key = format!("{}:{}:{}", backend, testfile, line);
let key = if has_platform {
let platform = split.get(4).unwrap();
format!("{}:{}:{}:{}", backend, testfile, line, platform)
} else {
format!("{}:{}:{}", backend, testfile, line)
};
result.insert(key, kind);
}
}