Ensure wasi-common tests always have an unreadable stdin

Some wasi-common tests assume that stdin is never ready to be read, but
on CI stdin is closed so it's always ready to be read. Work around this
by guaranteeing that wasi-common tests always have an unreadable stdin
pipe by creating our own pipe.
This commit is contained in:
Alex Crichton
2019-11-07 14:57:43 -08:00
parent cd1e54487c
commit 2411831964
10 changed files with 185 additions and 157 deletions

View File

@@ -1,13 +1,13 @@
// Due to https://github.com/rust-lang/rust/issues/64247
#![allow(clippy::use_self)]
use crate::wasi;
use failure::Fail;
use std::convert::Infallible;
use std::fmt;
use std::num::TryFromIntError;
use std::str;
use thiserror::Error;
#[derive(Clone, Copy, Debug, Fail, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, Error, Eq, PartialEq)]
#[repr(u16)]
pub enum WasiError {
ESUCCESS = wasi::__WASI_ESUCCESS,
@@ -103,7 +103,7 @@ impl fmt::Display for WasiError {
}
}
#[derive(Debug, Fail)]
#[derive(Debug, Error)]
pub enum Error {
Wasi(WasiError),
Io(std::io::Error),