mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
Merge pull request #1490 from sylvestre/uname
Add `uname` test + doc update regarding testing
This commit is contained in:
commit
78dc71630c
4 changed files with 25 additions and 0 deletions
|
@ -205,6 +205,7 @@ TEST_PROGS := \
|
||||||
true \
|
true \
|
||||||
truncate \
|
truncate \
|
||||||
tsort \
|
tsort \
|
||||||
|
uname \
|
||||||
unexpand \
|
unexpand \
|
||||||
uniq \
|
uniq \
|
||||||
unlink \
|
unlink \
|
||||||
|
|
|
@ -215,6 +215,12 @@ Cargo:
|
||||||
$ cargo test
|
$ cargo test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
By default, `cargo test` only runs the common programs. To run also platform
|
||||||
|
specific tests, run:
|
||||||
|
```bash
|
||||||
|
$ cargo test --features unix
|
||||||
|
```
|
||||||
|
|
||||||
If you would prefer to test a select few utilities:
|
If you would prefer to test a select few utilities:
|
||||||
```bash
|
```bash
|
||||||
$ cargo test --features "chmod mv tail" --no-default-features
|
$ cargo test --features "chmod mv tail" --no-default-features
|
||||||
|
|
17
tests/test_uname.rs
Normal file
17
tests/test_uname.rs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
use common::util::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_uname_compatible() {
|
||||||
|
let (_, mut ucmd) = at_and_ucmd!();
|
||||||
|
|
||||||
|
let result = ucmd.arg("-a").run();
|
||||||
|
assert!(result.success);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_uname_name() {
|
||||||
|
let (_, mut ucmd) = at_and_ucmd!();
|
||||||
|
|
||||||
|
let result = ucmd.arg("-n").run();
|
||||||
|
assert!(result.success);
|
||||||
|
}
|
|
@ -29,6 +29,7 @@ unix_only! {
|
||||||
"pathchk", test_pathchk;
|
"pathchk", test_pathchk;
|
||||||
"pinky", test_pinky;
|
"pinky", test_pinky;
|
||||||
"stdbuf", test_stdbuf;
|
"stdbuf", test_stdbuf;
|
||||||
|
"uname", test_uname;
|
||||||
"unlink", test_unlink;
|
"unlink", test_unlink;
|
||||||
"who", test_who;
|
"who", test_who;
|
||||||
// Be aware of the trailing semicolon after the last item
|
// Be aware of the trailing semicolon after the last item
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue