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]
|
[dependencies]
|
||||||
libc = "0.2.65"
|
libc = "0.2.65"
|
||||||
wasi = "0.9.0"
|
wasi = "0.10.0"
|
||||||
more-asserts = "0.2.1"
|
more-asserts = "0.2.1"
|
||||||
|
|
||||||
# This crate is built with the wasm32-wasi target, so it's separate
|
# 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 {
|
let r#in = [wasi::Subscription {
|
||||||
userdata: CLOCK_ID,
|
userdata: CLOCK_ID,
|
||||||
r#type: wasi::EVENTTYPE_CLOCK,
|
u: wasi::SubscriptionU {
|
||||||
u: wasi::SubscriptionU { clock },
|
tag: wasi::EVENTTYPE_CLOCK,
|
||||||
|
u: wasi::SubscriptionUU {
|
||||||
|
clock
|
||||||
|
}
|
||||||
|
},
|
||||||
}];
|
}];
|
||||||
let out = poll_oneoff_impl(&r#in, 1);
|
let out = poll_oneoff_impl(&r#in, 1);
|
||||||
let event = &out[0];
|
let event = &out[0];
|
||||||
@@ -74,14 +78,22 @@ unsafe fn test_stdin_read() {
|
|||||||
let r#in = [
|
let r#in = [
|
||||||
wasi::Subscription {
|
wasi::Subscription {
|
||||||
userdata: CLOCK_ID,
|
userdata: CLOCK_ID,
|
||||||
r#type: wasi::EVENTTYPE_CLOCK,
|
u: wasi::SubscriptionU {
|
||||||
u: wasi::SubscriptionU { clock },
|
tag: wasi::EVENTTYPE_CLOCK,
|
||||||
|
u: wasi::SubscriptionUU {
|
||||||
|
clock
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// Make sure that timeout is returned only once even if there are multiple read events
|
// Make sure that timeout is returned only once even if there are multiple read events
|
||||||
wasi::Subscription {
|
wasi::Subscription {
|
||||||
userdata: 1,
|
userdata: 1,
|
||||||
r#type: wasi::EVENTTYPE_FD_READ,
|
u: wasi::SubscriptionU {
|
||||||
u: wasi::SubscriptionU { fd_readwrite },
|
tag: wasi::EVENTTYPE_FD_READ,
|
||||||
|
u: wasi::SubscriptionUU {
|
||||||
|
fd_read: fd_readwrite
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
let out = poll_oneoff_impl(&r#in, 1);
|
let out = poll_oneoff_impl(&r#in, 1);
|
||||||
@@ -112,16 +124,20 @@ unsafe fn test_stdout_stderr_write() {
|
|||||||
let r#in = [
|
let r#in = [
|
||||||
wasi::Subscription {
|
wasi::Subscription {
|
||||||
userdata: 1,
|
userdata: 1,
|
||||||
r#type: wasi::EVENTTYPE_FD_WRITE,
|
|
||||||
u: wasi::SubscriptionU {
|
u: wasi::SubscriptionU {
|
||||||
fd_readwrite: stdout_readwrite,
|
tag: wasi::EVENTTYPE_FD_WRITE,
|
||||||
|
u: wasi::SubscriptionUU {
|
||||||
|
fd_write: stdout_readwrite
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
wasi::Subscription {
|
wasi::Subscription {
|
||||||
userdata: 2,
|
userdata: 2,
|
||||||
r#type: wasi::EVENTTYPE_FD_WRITE,
|
|
||||||
u: wasi::SubscriptionU {
|
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 = [
|
let r#in = [
|
||||||
wasi::Subscription {
|
wasi::Subscription {
|
||||||
userdata: 1,
|
userdata: 1,
|
||||||
r#type: wasi::EVENTTYPE_FD_READ,
|
u: wasi::SubscriptionU {
|
||||||
u: wasi::SubscriptionU { fd_readwrite },
|
tag: wasi::EVENTTYPE_FD_READ,
|
||||||
|
u: wasi::SubscriptionUU {
|
||||||
|
fd_read: fd_readwrite
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
wasi::Subscription {
|
wasi::Subscription {
|
||||||
userdata: 2,
|
userdata: 2,
|
||||||
r#type: wasi::EVENTTYPE_FD_WRITE,
|
u: wasi::SubscriptionU {
|
||||||
u: wasi::SubscriptionU { fd_readwrite },
|
tag: wasi::EVENTTYPE_FD_WRITE,
|
||||||
|
u: wasi::SubscriptionUU {
|
||||||
|
fd_write: fd_readwrite
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
let out = poll_oneoff_impl(&r#in, 2);
|
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,
|
Ok(s) => s,
|
||||||
Err(_) => break,
|
Err(_) => break,
|
||||||
};
|
};
|
||||||
if stat.pr_type != wasi::PREOPENTYPE_DIR {
|
if stat.tag != wasi::PREOPENTYPE_DIR {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let mut dst = Vec::with_capacity(stat.u.dir.pr_name_len);
|
let mut dst = Vec::with_capacity(stat.u.dir.pr_name_len);
|
||||||
|
|||||||
Reference in New Issue
Block a user