Add options for parsing test files (#942)

* Add options for parsing test files

This change allows adding parsing parameters more easily; e.g. a parameter is needed for setting the default calling convention for functions parsed as a part of the `run` test feature.

* Set default calling convention that of the host for `test run` file tests

Previously `test run` used the parser's hard-coded CallConv::Fast as the default calling convention but with this change any test being `run` will use the default calling convention of the machine running the test. `test run` will now throw an error if the calling convention of the function does not match the host's.
This commit is contained in:
Andrew Brown
2019-08-27 11:31:08 -07:00
committed by Till Schneidereit
parent e4702d695e
commit 6fdc69ff2e
8 changed files with 116 additions and 36 deletions

View File

@@ -211,7 +211,7 @@ impl SourceMap {
#[cfg(test)]
mod tests {
use crate::parse_test;
use crate::{parse_test, ParseOptions};
#[test]
fn details() {
@@ -222,8 +222,7 @@ mod tests {
ebb0(v4: i32, v7: i32):
v10 = iadd v4, v7
}",
None,
None,
ParseOptions::default(),
)
.unwrap();
let map = &tf.functions[0].1.map;