mirror of
https://github.com/openharmony/third_party_rust_is-terminal.git
synced 2026-06-30 21:47:56 -04:00
Fix compilation on wasm32-wasi.
This commit is contained in:
@@ -69,7 +69,7 @@ jobs:
|
||||
- run: >
|
||||
rustup target add
|
||||
wasm32-wasi
|
||||
- run: cargo check --workspace --release -vv --target=wasm32-wasi
|
||||
- run: cargo check --workspace --release -vv --target=wasm32-wasi --all-targets
|
||||
|
||||
test:
|
||||
name: Test
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ include = ["src", "build.rs", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md"]
|
||||
io-lifetimes = "1.0.0"
|
||||
|
||||
[target.'cfg(not(any(windows, target_os = "hermit", target_os = "unknown")))'.dependencies]
|
||||
rustix = { version = "0.36.0", features = ["termios"] }
|
||||
rustix = { version = "0.36.4", features = ["termios"] }
|
||||
|
||||
[target.'cfg(target_os = "hermit")'.dependencies]
|
||||
hermit-abi = "0.2.0"
|
||||
@@ -33,5 +33,5 @@ features = [
|
||||
[dev-dependencies]
|
||||
atty = "0.2.14"
|
||||
|
||||
[target.'cfg(unix)'.dev-dependencies]
|
||||
[target.'cfg(any(unix, target_os = "wasi"))'.dev-dependencies]
|
||||
libc = "0.2.110"
|
||||
|
||||
+7
-6
@@ -256,6 +256,7 @@ impl IsTerminal for std::process::ChildStderr {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[cfg(not(target_os = "unknown"))]
|
||||
use super::IsTerminal;
|
||||
|
||||
#[test]
|
||||
@@ -286,7 +287,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
#[cfg(any(unix, target_os = "wasi"))]
|
||||
fn stdin() {
|
||||
unsafe {
|
||||
assert_eq!(
|
||||
@@ -297,7 +298,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
#[cfg(any(unix, target_os = "wasi"))]
|
||||
fn stdout() {
|
||||
unsafe {
|
||||
assert_eq!(
|
||||
@@ -308,7 +309,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
#[cfg(any(unix, target_os = "wasi"))]
|
||||
fn stderr() {
|
||||
unsafe {
|
||||
assert_eq!(
|
||||
@@ -319,7 +320,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
#[cfg(any(unix, target_os = "wasi"))]
|
||||
fn stdin_vs_libc() {
|
||||
unsafe {
|
||||
assert_eq!(
|
||||
@@ -330,7 +331,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
#[cfg(any(unix, target_os = "wasi"))]
|
||||
fn stdout_vs_libc() {
|
||||
unsafe {
|
||||
assert_eq!(
|
||||
@@ -341,7 +342,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
#[cfg(any(unix, target_os = "wasi"))]
|
||||
fn stderr_vs_libc() {
|
||||
unsafe {
|
||||
assert_eq!(
|
||||
|
||||
Reference in New Issue
Block a user