Skip to content

Commit 116c9e8

Browse files
authored
Merge pull request #394 from sylvestre/uutests
use uutests
2 parents 7eff9fa + e9ea7a5 commit 116c9e8

23 files changed

+330
-4058
lines changed

Cargo.lock

Lines changed: 254 additions & 180 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ tempfile = "3.10.1"
6565
textwrap = { version = "0.16.1", features = ["terminal_size"] }
6666
thiserror = "2.0.4"
6767
uucore = "0.0.30"
68+
uutests = "0.0.30"
69+
ctor = "0.4.1"
6870
walkdir = "2.5.0"
6971
windows = { version = "0.61.1" }
7072
windows-sys = { version = "0.59.0", default-features = false }
@@ -105,6 +107,8 @@ pretty_assertions = "1.4.0"
105107
rand = { workspace = true }
106108
regex = { workspace = true }
107109
tempfile = { workspace = true }
110+
ctor = { workspace = true }
111+
uutests = { workspace = true }
108112
uucore = { workspace = true, features = ["entries", "process", "signals"] }
109113

110114
[target.'cfg(unix)'.dev-dependencies]

tests/by-util/test_free.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
use pretty_assertions::assert_eq;
77
use regex::Regex;
88

9-
use crate::common::util::TestScenario;
9+
use uutests::new_ucmd;
10+
use uutests::util::TestScenario;
11+
use uutests::util_name;
1012

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

tests/by-util/test_pgrep.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ use std::{
99
process::{Child, Command},
1010
};
1111

12-
use crate::common::util::TestScenario;
1312
#[cfg(target_os = "linux")]
1413
use regex::Regex;
14+
use uutests::new_ucmd;
15+
use uutests::util::TestScenario;
16+
use uutests::util_name;
1517

1618
#[cfg(target_os = "linux")]
1719
const SINGLE_PID: &str = "^[1-9][0-9]*";

tests/by-util/test_pidof.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
55

6-
use crate::common::util::TestScenario;
6+
use uutests::new_ucmd;
7+
use uutests::util::TestScenario;
8+
use uutests::util_name;
79

810
#[test]
911
fn test_no_args() {

tests/by-util/test_pidwait.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
55

6-
use crate::common::util::TestScenario;
6+
use uutests::new_ucmd;
7+
use uutests::util::TestScenario;
8+
use uutests::util_name;
79

810
#[test]
911
fn test_invalid_arg() {

tests/by-util/test_pkill.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
// file that was distributed with this source code.
55

66
#[cfg(unix)]
7-
use crate::common::util::TestScenario;
7+
use uutests::new_ucmd;
8+
#[cfg(unix)]
9+
use uutests::util::TestScenario;
10+
#[cfg(unix)]
11+
use uutests::util_name;
812

913
#[cfg(unix)]
1014
#[test]

tests/by-util/test_pmap.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
55

6-
use crate::common::util::TestScenario;
76
#[cfg(target_os = "linux")]
87
use regex::Regex;
98
#[cfg(target_os = "linux")]
109
use std::process;
10+
use uutests::new_ucmd;
11+
use uutests::util::TestScenario;
12+
use uutests::util_name;
1113

1214
const NON_EXISTING_PID: &str = "999999";
1315
#[cfg(target_os = "linux")]

tests/by-util/test_ps.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
55

6-
use crate::common::util::TestScenario;
6+
use uutests::new_ucmd;
7+
use uutests::util::TestScenario;
8+
use uutests::util_name;
79

810
#[test]
911
#[cfg(target_os = "linux")]

tests/by-util/test_pwdx.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ use std::process;
77

88
use regex::Regex;
99

10-
use crate::common::util::TestScenario;
10+
use uutests::new_ucmd;
11+
use uutests::util::TestScenario;
12+
use uutests::util_name;
1113

1214
#[test]
1315
fn test_no_args() {

0 commit comments

Comments
 (0)