mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
uucore: process: fix exit status processing (#1743)
* uucore: process: fix exit status processing * tests: timeout: check whether subcommand exit codes are returned
This commit is contained in:
parent
7e5d9ee32d
commit
5431e947bc
3 changed files with 53 additions and 44 deletions
|
@ -1 +1,18 @@
|
|||
// ToDO: add tests
|
||||
use crate::common::util::*;
|
||||
|
||||
// FIXME: this depends on the system having true and false in PATH
|
||||
// the best solution is probably to generate some test binaries that we can call for any
|
||||
// utility that requires executing another program (kill, for instance)
|
||||
#[test]
|
||||
fn test_subcommand_retcode() {
|
||||
new_ucmd!()
|
||||
.arg("1")
|
||||
.arg("true")
|
||||
.succeeds();
|
||||
|
||||
new_ucmd!()
|
||||
.arg("1")
|
||||
.arg("false")
|
||||
.run()
|
||||
.status_code(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue