Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
442 changes: 258 additions & 184 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ tempfile = "3.10.1"
textwrap = { version = "0.16.1", features = ["terminal_size"] }
thiserror = "2.0.4"
uucore = "0.0.30"
uutests = "0.0.30"
ctor = "0.4.1"
walkdir = "2.5.0"
windows = { version = "0.61.1" }
windows-sys = { version = "0.59.0", default-features = false }
Expand Down Expand Up @@ -105,6 +107,8 @@ pretty_assertions = "1.4.0"
rand = { workspace = true }
regex = { workspace = true }
tempfile = { workspace = true }
ctor = { workspace = true }
uutests = { workspace = true }
uucore = { workspace = true, features = ["entries", "process", "signals"] }

[target.'cfg(unix)'.dev-dependencies]
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_free.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
use pretty_assertions::assert_eq;
use regex::Regex;

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

// TODO: make tests combineable (e.g. test --total --human)

Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_pgrep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ use std::{
process::{Child, Command},
};

use crate::common::util::TestScenario;
#[cfg(target_os = "linux")]
use regex::Regex;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[cfg(target_os = "linux")]
const SINGLE_PID: &str = "^[1-9][0-9]*";
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_pidof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_no_args() {
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_pidwait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_invalid_arg() {
Expand Down
6 changes: 5 additions & 1 deletion tests/by-util/test_pkill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
// file that was distributed with this source code.

#[cfg(unix)]
use crate::common::util::TestScenario;
use uutests::new_ucmd;
#[cfg(unix)]
use uutests::util::TestScenario;
#[cfg(unix)]
use uutests::util_name;

#[cfg(unix)]
#[test]
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_pmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use crate::common::util::TestScenario;
#[cfg(target_os = "linux")]
use regex::Regex;
#[cfg(target_os = "linux")]
use std::process;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

const NON_EXISTING_PID: &str = "999999";
#[cfg(target_os = "linux")]
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_ps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
#[cfg(target_os = "linux")]
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_pwdx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use std::process;

use regex::Regex;

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_no_args() {
Expand Down
7 changes: 5 additions & 2 deletions tests/by-util/test_slabtop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
// file that was distributed with this source code.

#[cfg(target_os = "linux")]
use crate::common::util::run_ucmd_as_root;
use crate::common::util::TestScenario;
use uutests::util::run_ucmd_as_root;

use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_invalid_arg() {
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_snice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_no_args() {
Expand Down
14 changes: 11 additions & 3 deletions tests/by-util/test_sysctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_invalid_arg() {
Expand All @@ -12,7 +14,10 @@ fn test_invalid_arg() {

#[cfg(target_os = "linux")]
mod linux {
use crate::common::util::TestScenario;

use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_get_simple() {
Expand Down Expand Up @@ -68,7 +73,10 @@ mod linux {

#[cfg(not(target_os = "linux"))]
mod non_linux {
use crate::common::util::TestScenario;

use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_fails_on_unsupported_platforms() {
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_tload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_invalid_arg() {
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_top.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_invalid_arg() {
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_vmstat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_simple() {
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_w.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

#[test]
fn test_invalid_arg() {
Expand Down
4 changes: 3 additions & 1 deletion tests/by-util/test_watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use crate::common::util::TestScenario;
use uutests::new_ucmd;
use uutests::util::TestScenario;
use uutests::util_name;

// runddl32.exe has no console window, no side effects,
// and no arguments are required.
Expand Down
93 changes: 0 additions & 93 deletions tests/common/macros.rs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/common/mod.rs

This file was deleted.

Loading
Loading