mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-16 08:10:49 +00:00
Allow platform specific excludes
This commit is contained in:
parent
c15da949bb
commit
8c13eae2b8
@ -10,6 +10,11 @@
|
|||||||
#
|
#
|
||||||
# Star line allows skipping an entire wast file
|
# Star line allows skipping an entire wast file
|
||||||
# clif:skip:simd.wast:*
|
# clif:skip:simd.wast:*
|
||||||
|
#
|
||||||
|
# Excludes can also contain platform
|
||||||
|
# clif:skip:data.wast:172:windows
|
||||||
|
# clif:skip:data.wast:172:unix
|
||||||
|
#
|
||||||
|
|
||||||
# Cranelift
|
# Cranelift
|
||||||
clif:skip:elem.wast:229 # Spec running forever
|
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
|
# 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 bug with min/max over NaNs
|
||||||
llvm:skip:f32.wast:1651
|
llvm:skip:f32.wast:1651
|
||||||
llvm:skip:f32.wast:1652
|
llvm:skip:f32.wast:1652
|
||||||
|
@ -51,6 +51,11 @@ mod tests {
|
|||||||
self.allowed_failure += 1;
|
self.allowed_failure += 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let platform_key = format!("{}:{}", testkey, get_platform());
|
||||||
|
if excludes.contains_key(&platform_key) {
|
||||||
|
self.allowed_failure += 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
self.failed += 1;
|
self.failed += 1;
|
||||||
self.failures.push(failure);
|
self.failures.push(failure);
|
||||||
}
|
}
|
||||||
@ -96,6 +101,16 @@ mod tests {
|
|||||||
"singlepass"
|
"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")))]
|
#[cfg(not(any(feature = "llvm", feature = "clif", feature = "singlepass")))]
|
||||||
fn get_compiler_name() -> &'static str {
|
fn get_compiler_name() -> &'static str {
|
||||||
panic!("compiler not specified, activate a compiler via features");
|
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 named_modules: HashMap<String, Rc<Instance>> = HashMap::new();
|
||||||
|
|
||||||
let mut registered_modules: HashMap<String, Module> = HashMap::new();
|
let mut registered_modules: HashMap<String, Module> = HashMap::new();
|
||||||
|
let platform = get_platform();
|
||||||
//
|
//
|
||||||
|
|
||||||
while let Some(Command { kind, line }) =
|
while let Some(Command { kind, line }) =
|
||||||
parser.next().map_err(|e| format!("Parse err: {:?}", e))?
|
parser.next().map_err(|e| format!("Parse err: {:?}", e))?
|
||||||
{
|
{
|
||||||
let test_key = format!("{}:{}:{}", backend, filename, line);
|
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
|
// Use this line to debug which test is running
|
||||||
//println!("Running test: {}", test_key);
|
//println!("Running test: {}", test_key);
|
||||||
|
|
||||||
if excludes.contains_key(&test_key)
|
if (excludes.contains_key(&test_key)
|
||||||
&& *excludes.get(&test_key).unwrap() == Exclude::Skip
|
&& *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);
|
// println!("Skipping test: {}", test_key);
|
||||||
continue;
|
continue;
|
||||||
@ -1058,16 +1075,23 @@ mod tests {
|
|||||||
//println!("exclude line {}", line);
|
//println!("exclude line {}", line);
|
||||||
// <backend>:<exclude-kind>:<test-file-name>:<test-file-line>
|
// <backend>:<exclude-kind>:<test-file-name>:<test-file-line>
|
||||||
let split: Vec<&str> = line.trim().split(':').collect();
|
let split: Vec<&str> = line.trim().split(':').collect();
|
||||||
assert_eq!(split.len(), 4);
|
|
||||||
let kind = match *split.get(1).unwrap() {
|
let kind = match *split.get(1).unwrap() {
|
||||||
"skip" => Exclude::Skip,
|
"skip" => Exclude::Skip,
|
||||||
"fail" => Exclude::Fail,
|
"fail" => Exclude::Fail,
|
||||||
_ => panic!("unknown exclude kind"),
|
_ => panic!("unknown exclude kind"),
|
||||||
};
|
};
|
||||||
|
let has_platform = split.len() > 4;
|
||||||
|
|
||||||
let backend = split.get(0).unwrap();
|
let backend = split.get(0).unwrap();
|
||||||
let testfile = split.get(2).unwrap();
|
let testfile = split.get(2).unwrap();
|
||||||
let line = split.get(3).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);
|
result.insert(key, kind);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user