Skip to content

Commit

Permalink
Write conformance test for DWARF line info
Browse files Browse the repository at this point in the history
  • Loading branch information
dzfrias committed Aug 12, 2023
1 parent 378d8cd commit 665524f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions components/conformance-tests/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@ fn get_test_infile_wasm() -> Result<PathBuf> {
Ok(infile)
}

fn get_test_infile_wasm_alt() -> Result<PathBuf> {
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR")?;
let manifest_dir = PathBuf::from(manifest_dir);
let workspace = manifest_dir.join("../..");
let infile = workspace.join("components/wasm-opt/tests/hello_world.wasm");

Ok(infile)
}

fn get_test_infile_wat() -> Result<PathBuf> {
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR")?;
let manifest_dir = PathBuf::from(manifest_dir);
Expand Down Expand Up @@ -878,3 +887,22 @@ fn check_versions() -> Result<()> {

Ok(())
}

#[test]
fn dwarf_line_info() -> Result<()> {
let infile = get_test_infile_wasm_alt()?;
let outfile = PathBuf::from("outfile.wasm");

let infile_sourcemap = None::<PathBuf>;
let outfile_sourcemap = None::<PathBuf>;

let args = vec![];

run_test(TestArgs {
infile,
infile_sourcemap,
outfile,
outfile_sourcemap,
args,
})
}

0 comments on commit 665524f

Please sign in to comment.