fix(tagged-union): rebase and squash
fix(tagged-union): changed test programs to use new tagged union generated code fix(tagged-union): changed test programs to use new tagged union generated code fix(tagged-union): removed local dependency and changed to point to 0.9.1 version of wasi fix(tagged-union): added newline to gitignore, changed wasi version to 0.10.0 fix(tagged-union): removed gitignore as Cargo.lock is intentional
This commit is contained in:
@@ -8,7 +8,7 @@ publish = false
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2.65"
|
||||
wasi = "0.9.0"
|
||||
wasi = "0.10.0"
|
||||
more-asserts = "0.2.1"
|
||||
|
||||
# This crate is built with the wasm32-wasi target, so it's separate
|
||||
|
||||
@@ -40,8 +40,12 @@ unsafe fn test_timeout() {
|
||||
};
|
||||
let r#in = [wasi::Subscription {
|
||||
userdata: CLOCK_ID,
|
||||
r#type: wasi::EVENTTYPE_CLOCK,
|
||||
u: wasi::SubscriptionU { clock },
|
||||
u: wasi::SubscriptionU {
|
||||
tag: wasi::EVENTTYPE_CLOCK,
|
||||
u: wasi::SubscriptionUU {
|
||||
clock
|
||||
}
|
||||
},
|
||||
}];
|
||||
let out = poll_oneoff_impl(&r#in, 1);
|
||||
let event = &out[0];
|
||||
@@ -74,14 +78,22 @@ unsafe fn test_stdin_read() {
|
||||
let r#in = [
|
||||
wasi::Subscription {
|
||||
userdata: CLOCK_ID,
|
||||
r#type: wasi::EVENTTYPE_CLOCK,
|
||||
u: wasi::SubscriptionU { clock },
|
||||
u: wasi::SubscriptionU {
|
||||
tag: wasi::EVENTTYPE_CLOCK,
|
||||
u: wasi::SubscriptionUU {
|
||||
clock
|
||||
}
|
||||
},
|
||||
},
|
||||
// Make sure that timeout is returned only once even if there are multiple read events
|
||||
wasi::Subscription {
|
||||
userdata: 1,
|
||||
r#type: wasi::EVENTTYPE_FD_READ,
|
||||
u: wasi::SubscriptionU { fd_readwrite },
|
||||
u: wasi::SubscriptionU {
|
||||
tag: wasi::EVENTTYPE_FD_READ,
|
||||
u: wasi::SubscriptionUU {
|
||||
fd_read: fd_readwrite
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
let out = poll_oneoff_impl(&r#in, 1);
|
||||
@@ -112,16 +124,20 @@ unsafe fn test_stdout_stderr_write() {
|
||||
let r#in = [
|
||||
wasi::Subscription {
|
||||
userdata: 1,
|
||||
r#type: wasi::EVENTTYPE_FD_WRITE,
|
||||
u: wasi::SubscriptionU {
|
||||
fd_readwrite: stdout_readwrite,
|
||||
tag: wasi::EVENTTYPE_FD_WRITE,
|
||||
u: wasi::SubscriptionUU {
|
||||
fd_write: stdout_readwrite
|
||||
},
|
||||
},
|
||||
},
|
||||
wasi::Subscription {
|
||||
userdata: 2,
|
||||
r#type: wasi::EVENTTYPE_FD_WRITE,
|
||||
u: wasi::SubscriptionU {
|
||||
fd_readwrite: stderr_readwrite,
|
||||
tag: wasi::EVENTTYPE_FD_WRITE,
|
||||
u: wasi::SubscriptionUU {
|
||||
fd_write: stderr_readwrite
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -163,13 +179,21 @@ unsafe fn test_fd_readwrite(fd: wasi::Fd, error_code: wasi::Errno) {
|
||||
let r#in = [
|
||||
wasi::Subscription {
|
||||
userdata: 1,
|
||||
r#type: wasi::EVENTTYPE_FD_READ,
|
||||
u: wasi::SubscriptionU { fd_readwrite },
|
||||
u: wasi::SubscriptionU {
|
||||
tag: wasi::EVENTTYPE_FD_READ,
|
||||
u: wasi::SubscriptionUU {
|
||||
fd_read: fd_readwrite
|
||||
}
|
||||
},
|
||||
},
|
||||
wasi::Subscription {
|
||||
userdata: 2,
|
||||
r#type: wasi::EVENTTYPE_FD_WRITE,
|
||||
u: wasi::SubscriptionU { fd_readwrite },
|
||||
u: wasi::SubscriptionU {
|
||||
tag: wasi::EVENTTYPE_FD_WRITE,
|
||||
u: wasi::SubscriptionUU {
|
||||
fd_write: fd_readwrite
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
let out = poll_oneoff_impl(&r#in, 2);
|
||||
|
||||
@@ -15,7 +15,7 @@ pub fn open_scratch_directory(path: &str) -> Result<wasi::Fd, String> {
|
||||
Ok(s) => s,
|
||||
Err(_) => break,
|
||||
};
|
||||
if stat.pr_type != wasi::PREOPENTYPE_DIR {
|
||||
if stat.tag != wasi::PREOPENTYPE_DIR {
|
||||
continue;
|
||||
}
|
||||
let mut dst = Vec::with_capacity(stat.u.dir.pr_name_len);
|
||||
|
||||
Reference in New Issue
Block a user