Skip to content

Commit

Permalink
Merge pull request uutils#3630 from sylvestre/gnu-sleep
Browse files Browse the repository at this point in the history
sleep: customize one of the tests (tests/misc/sleep.sh)
  • Loading branch information
tertsdiepraam authored Jun 15, 2022
2 parents 029e0dc + 0be1b7c commit bc4f193
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/uu/sleep/src/sleep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mod options {

#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let matches = uu_app().get_matches_from(args);
let matches = uu_app().try_get_matches_from(args)?;

if let Some(values) = matches.values_of(options::NUMBER) {
let numbers = values.collect::<Vec<_>>();
Expand Down
7 changes: 5 additions & 2 deletions util/build-gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ if test -f gnu-built; then
echo "GNU build already found. Skip"
echo "'rm -f $(pwd)/gnu-built' to force the build"
echo "Note: the customization of the tests will still happen"
exit 0
else
./bootstrap
./configure --quiet --disable-gcc-warnings
Expand Down Expand Up @@ -199,4 +198,8 @@ sed -i -e "s/provoked error./provoked error\ncat pat |sort -u > pat/" tests/misc

# Update the GNU error message to match ours
sed -i -e "s/ln: 'f' and 'f' are the same file/ln: failed to link 'f' to 'f': Same file/g" tests/ln/hard-backup.sh
sed -i -e "s/failed to access 'no-such-dir'\":/failed to link 'no-such-dir'\"/" -e "s/link-to-dir: hard link not allowed for directory/failed to link 'link-to-dir' to/" -e "s|link-to-dir/: hard link not allowed for directory|failed to link 'link-to-dir/' to|" tests/ln/hard-to-sym.sh
sed -i -e "s/failed to access 'no-such-dir'\":/failed to link 'no-such-dir'\"/" -e "s/link-to-dir: hard link not allowed for directory/failed to link 'link-to-dir' to/" -e "s|link-to-dir/: hard link not allowed for directory|failed to link 'link-to-dir/' to|" tests/ln/hard-to-sym.sh

# sleep without arg returns 2 on our side, 1 on GNU's
# GNU sleep accepts some crazy string, not sure we should match this behavior
sed -i -e "s/timeout 10 sleep 0x.002p1/#timeout 10 sleep 0x.002p1/" tests/misc/sleep.sh

0 comments on commit bc4f193

Please sign in to comment.