mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
commit
c610262f0b
6 changed files with 25 additions and 7 deletions
|
@ -98,7 +98,9 @@ fn test_fifo_symlink() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
// TODO(#7542): Re-enable on Android once we figure out why setting limit is broken.
|
||||||
|
// #[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
fn test_closes_file_descriptors() {
|
fn test_closes_file_descriptors() {
|
||||||
// Each file creates a pipe, which has two file descriptors.
|
// Each file creates a pipe, which has two file descriptors.
|
||||||
// If they are not closed then five is certainly too many.
|
// If they are not closed then five is certainly too many.
|
||||||
|
|
|
@ -81,11 +81,13 @@ fn test_env_version() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(unix)]
|
||||||
fn test_env_permissions() {
|
fn test_env_permissions() {
|
||||||
|
// Try to execute `empty` in test fixture, that does not have exec permission.
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.arg(".")
|
.arg("./empty")
|
||||||
.fails_with_code(126)
|
.fails_with_code(126)
|
||||||
.stderr_is("env: '.': Permission denied\n");
|
.stderr_is("env: './empty': Permission denied\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1090,7 +1090,9 @@ fn test_merge_batch_size() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
// TODO(#7542): Re-enable on Android once we figure out why setting limit is broken.
|
||||||
|
// #[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
fn test_merge_batch_size_with_limit() {
|
fn test_merge_batch_size_with_limit() {
|
||||||
use rlimit::Resource;
|
use rlimit::Resource;
|
||||||
// Currently need...
|
// Currently need...
|
||||||
|
|
|
@ -1627,7 +1627,9 @@ fn test_round_robin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
// TODO(#7542): Re-enable on Android once we figure out why rlimit is broken.
|
||||||
|
// #[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
fn test_round_robin_limited_file_descriptors() {
|
fn test_round_robin_limited_file_descriptors() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.args(&["-n", "r/40", "onehundredlines.txt"])
|
.args(&["-n", "r/40", "onehundredlines.txt"])
|
||||||
|
|
|
@ -1215,6 +1215,17 @@ impl TestScenario {
|
||||||
command
|
command
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns builder for invoking a command in shell (e.g. sh -c 'cmd').
|
||||||
|
/// Paths given are treated relative to the environment's unique temporary
|
||||||
|
/// test directory.
|
||||||
|
pub fn cmd_shell<S: AsRef<OsStr>>(&self, cmd: S) -> UCommand {
|
||||||
|
let mut command = UCommand::new();
|
||||||
|
// Intentionally leave bin_path unset.
|
||||||
|
command.arg(cmd);
|
||||||
|
command.temp_dir(self.tmpd.clone());
|
||||||
|
command
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns builder for invoking any uutils command. Paths given are treated
|
/// Returns builder for invoking any uutils command. Paths given are treated
|
||||||
/// relative to the environment's unique temporary test directory.
|
/// relative to the environment's unique temporary test directory.
|
||||||
pub fn ccmd<S: AsRef<str>>(&self, util_name: S) -> UCommand {
|
pub fn ccmd<S: AsRef<str>>(&self, util_name: S) -> UCommand {
|
||||||
|
@ -4052,8 +4063,7 @@ mod tests {
|
||||||
};
|
};
|
||||||
|
|
||||||
let ts = TestScenario::new("util");
|
let ts = TestScenario::new("util");
|
||||||
ts.cmd("sh")
|
ts.cmd_shell("umask")
|
||||||
.args(&["-c", "umask"])
|
|
||||||
.umask(c_umask)
|
.umask(c_umask)
|
||||||
.succeeds()
|
.succeeds()
|
||||||
.stdout_is(expected);
|
.stdout_is(expected);
|
||||||
|
|
0
tests/fixtures/env/empty
vendored
Normal file
0
tests/fixtures/env/empty
vendored
Normal file
Loading…
Add table
Add a link
Reference in a new issue