fix tests

This commit is contained in:
Pat Hickey
2020-08-28 15:58:16 -07:00
parent 22b427baa0
commit edefbf7c73
11 changed files with 13 additions and 12 deletions

View File

@@ -3,7 +3,7 @@ use wiggle::{GuestMemory, GuestPtr};
use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx}; use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx};
wiggle::from_witx!({ wiggle::from_witx!({
witx: ["tests/arrays.witx"], witx: ["$CARGO_MANIFEST_DIR/tests/arrays.witx"],
ctx: WasiCtx, ctx: WasiCtx,
}); });

View File

@@ -3,7 +3,7 @@ use wiggle::GuestMemory;
use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx}; use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx};
wiggle::from_witx!({ wiggle::from_witx!({
witx: ["tests/atoms.witx"], witx: ["$CARGO_MANIFEST_DIR/tests/atoms.witx"],
ctx: WasiCtx, ctx: WasiCtx,
}); });

View File

@@ -4,7 +4,7 @@ use wiggle::{GuestMemory, GuestPtr};
use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx}; use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx};
wiggle::from_witx!({ wiggle::from_witx!({
witx: ["tests/flags.witx"], witx: ["$CARGO_MANIFEST_DIR/tests/flags.witx"],
ctx: WasiCtx, ctx: WasiCtx,
}); });

View File

@@ -5,7 +5,7 @@ use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx};
const FD_VAL: u32 = 123; const FD_VAL: u32 = 123;
wiggle::from_witx!({ wiggle::from_witx!({
witx: ["tests/handles.witx"], witx: ["$CARGO_MANIFEST_DIR/tests/handles.witx"],
ctx: WasiCtx, ctx: WasiCtx,
}); });

View File

@@ -4,7 +4,7 @@ use wiggle::GuestMemory;
use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx}; use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx};
wiggle::from_witx!({ wiggle::from_witx!({
witx: ["tests/ints.witx"], witx: ["$CARGO_MANIFEST_DIR/tests/ints.witx"],
ctx: WasiCtx, ctx: WasiCtx,
}); });

View File

@@ -58,7 +58,7 @@ mod struct_test {
/// Test that a union variant that conflicts with a Rust keyword can be compiled properly. /// Test that a union variant that conflicts with a Rust keyword can be compiled properly.
mod union_test { mod union_test {
wiggle::from_witx!({ wiggle::from_witx!({
witx: ["tests/keywords_union.witx"], witx: ["$CARGO_MANIFEST_DIR/tests/keywords_union.witx"],
ctx: DummyCtx, ctx: DummyCtx,
}); });
} }

View File

@@ -3,7 +3,7 @@ use wiggle::{GuestMemory, GuestPtr};
use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx}; use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx};
wiggle::from_witx!({ wiggle::from_witx!({
witx: ["tests/pointers.witx"], witx: ["$CARGO_MANIFEST_DIR/tests/pointers.witx"],
ctx: WasiCtx, ctx: WasiCtx,
}); });

View File

@@ -3,7 +3,7 @@ use wiggle::{GuestMemory, GuestPtr};
use wiggle_test::{impl_errno, HostMemory, MemArea, MemAreas, WasiCtx}; use wiggle_test::{impl_errno, HostMemory, MemArea, MemAreas, WasiCtx};
wiggle::from_witx!({ wiggle::from_witx!({
witx: ["tests/strings.witx"], witx: ["$CARGO_MANIFEST_DIR/tests/strings.witx"],
ctx: WasiCtx, ctx: WasiCtx,
}); });

View File

@@ -3,7 +3,7 @@ use wiggle::{GuestMemory, GuestPtr};
use wiggle_test::{impl_errno, HostMemory, MemArea, MemAreas, WasiCtx}; use wiggle_test::{impl_errno, HostMemory, MemArea, MemAreas, WasiCtx};
wiggle::from_witx!({ wiggle::from_witx!({
witx: ["tests/structs.witx"], witx: ["$CARGO_MANIFEST_DIR/tests/structs.witx"],
ctx: WasiCtx, ctx: WasiCtx,
}); });

View File

@@ -3,7 +3,7 @@ use wiggle::{GuestMemory, GuestType};
use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx}; use wiggle_test::{impl_errno, HostMemory, MemArea, WasiCtx};
wiggle::from_witx!({ wiggle::from_witx!({
witx: ["tests/union.witx"], witx: ["$CARGO_MANIFEST_DIR/tests/union.witx"],
ctx: WasiCtx, ctx: WasiCtx,
}); });

View File

@@ -7,7 +7,7 @@ use wiggle_test::WasiCtx;
// witx is exposed with the type signatures that we expect. // witx is exposed with the type signatures that we expect.
wiggle::from_witx!({ wiggle::from_witx!({
witx: ["tests/wasi.witx"], witx: ["$CARGO_MANIFEST_DIR/tests/wasi.witx"],
ctx: WasiCtx, ctx: WasiCtx,
}); });
@@ -16,7 +16,8 @@ wiggle::from_witx!({
#[test] #[test]
fn document_equivalent() { fn document_equivalent() {
let macro_doc = metadata::document(); let macro_doc = metadata::document();
let disk_doc = witx::load(&["tests/wasi.witx"]).expect("load wasi.witx from disk"); let disk_doc =
witx::load(&["$CARGO_MANIFEST_DIR/tests/wasi.witx"]).expect("load wasi.witx from disk");
assert_eq!(macro_doc, disk_doc); assert_eq!(macro_doc, disk_doc);
} }