Commit graph

9092 commits

Author SHA1 Message Date
Terts Diepraam
ea8085e2ca rm: add test for #4246 2022-12-29 16:15:41 +01:00
Sylvestre Ledru
f3285d9662
Merge pull request #4245 from rivy/chg.uname-to-tier1
build: `uname` is WinOS-compatible; move to 'Tier1' feature
2022-12-28 09:34:16 +01:00
Roy Ivy III
9b27cd8cb3 build: uname is WinOS-compatible; move to 'Tier1' feature 2022-12-27 10:55:34 -06:00
Sylvestre Ledru
666fe68675
Merge pull request #4224 from trasua/parse-size-option
uucore: add options to parse_size::Parser
2022-12-26 14:17:44 +01:00
trasua
ef8f92f720 uucore: add options to parse_size::Parser to support parse_byte_count() in sort.rs 2022-12-26 10:23:20 +01:00
jaggededgedjustice
b8a755a396
date: Catch panic from invalid format string (#4240)
* Catch panic from invalid date string
2022-12-25 21:11:34 +01:00
Sylvestre Ledru
083e4ac4df
Merge pull request #4242 from cakebaker/unnested_or_patterns
clippy: fix some "unnested or-patterns" warnings
2022-12-25 21:10:56 +01:00
Terts Diepraam
bdd6f56ae4
Merge pull request #4231 from Joining7943/add-timeout-in-tests
`tests/common/util`: Add possibility to set timeout for UCommand and UChild. Add `rstest` with timeout macro to dev dependencies
2022-12-23 01:12:57 +01:00
Daniel Hofstetter
a0522f5cbd clippy: fix some "unnested or-patterns" warnings 2022-12-20 16:07:37 +01:00
Terts Diepraam
03710a180e
Merge pull request #4241 from sylvestre/android-test
Ignore some cp tests on android
2022-12-18 00:50:17 +01:00
Joining7943
09c04d9f3f tests: Set timeout for tests which would fail with the default timeout in test_factor, test_sort 2022-12-17 21:55:01 +01:00
Joining7943
1d7447d42e tests/util: Add setting timeout for UChild::kill and run and wait methods in UCommand and UChild.
Additional notes:
* Set default timeout to 30s
* Fix UChild::kill to always fail on timeout if zero
2022-12-17 21:53:39 +01:00
Joining7943
83725d1876 tests: Add rstest crate with timeout macro, parameterized tests etc. to development dependencies 2022-12-17 21:41:35 +01:00
Sylvestre Ledru
8489e9b69c Ignore some cp tests on android
Closes: #4233
2022-12-17 16:54:23 +01:00
Sylvestre Ledru
4f90c680c8
Merge pull request #4238 from Joining7943/fix-cargo-clippy-doc-warnings
cargo: Fix cargo clippy doc warnings
2022-12-17 16:51:30 +01:00
Joining7943
ca0414d867 clippy: Allow some unnecessary casts 2022-12-16 18:37:50 +01:00
Joining7943
c94a039358 clippy and doc: Fix warnings, mostly needless conversions. Fix documentation warning. 2022-12-16 18:36:27 +01:00
Sylvestre Ledru
d7e690496b
Merge pull request #4234 from ctsk/mv-progress-extension-doc
docs: document progress flag for mv extension
2022-12-14 18:12:13 +01:00
ctsk
a1fc7432b8 docs: document progress flag for mv extension 2022-12-14 17:57:41 +01:00
Sylvestre Ledru
c5728a61b4
fix some clippy warnings (#4229)
* fix some clippy warnings

* Fix the last two
2022-12-14 15:42:07 +01:00
Terts Diepraam
e4bed1c087
Merge pull request #4135 from Joining7943/refactor-tail-check-warnings
`tail`: Refactor handling of warnings and early exits
2022-12-14 13:21:54 +01:00
Joining7943
b339f6d80c tests/tail: Add all additional tests written during refactoring tail from tip of refactoring branch
Other changes summmary:
* Use module level imports instead of fully qualified imports where appropriate
* Fix intermittent failing test_positive_zero_bytes because of broken pipe
* Cleanup old disabled test for warning of following indefinitely
2022-12-13 16:16:14 +01:00
Joining7943
93654d4504 tail: Add documentation for Settings::check_warnings and Settings::verify 2022-12-13 16:16:14 +01:00
Joining7943
2dc8a1b55e tail: Add gnu's warning when following stdin is ineffective. If no pid support set to 0 in Observer. 2022-12-13 16:16:14 +01:00
Joining7943
d57545d09c tail: Refactor: Handle warnings and early exits in one place. Remove InputService ...
Other changes summary:
* Cleanup imports
* Remove stdin_is_pipe_of_fifo function
* Rename WatcherService to Observer
2022-12-13 16:16:08 +01:00
Sylvestre Ledru
ce8c53dbad
Merge pull request #4235 from cakebaker/build_rs_remove_println
build.rs: remove two comments
2022-12-13 15:32:08 +01:00
Daniel Hofstetter
3d498432fa build.rs: remove two comments 2022-12-13 15:05:05 +01:00
Terts Diepraam
69caa45b01
Merge pull request #4219 from cakebaker/match_wildcard_for_single_variant
chore: fix wildcards that match single variant
2022-12-13 11:57:52 +01:00
Christian
00bbe24639
mv: add progress bar (#4220)
* mv: add progress bar

Similarly to `cp`, adds `-g` and `--progress` flags to enable a progress
bar via indicatif.
2022-12-13 11:46:54 +01:00
Terts Diepraam
7555527d07
Merge pull request #4225 from Joining7943/4223-fix-intermittent-test-failures
tests/util: Fix #4223: intermittent failing uchild tests
2022-12-13 11:40:11 +01:00
Sylvestre Ledru
f9c0ca4383
Merge pull request #4184 from jfinkels/cp-verbose
cp: correct --verbose --parents output for both files and directories
2022-12-12 21:31:15 +01:00
Sylvestre Ledru
c78e077ff2
Merge pull request #4194 from jfinkels/dd-single-byte-written
dd: correct progress line if 1 byte written
2022-12-12 21:30:10 +01:00
Joining7943
7ef9504952 tests/util: Fix intermittent failing uchild tests on macos. The ci can be slow, so increase delay.
Closes #4223
2022-12-12 12:52:10 +01:00
Terts Diepraam
01153a701f
Merge pull request #4222 from sylvestre/toybox
Run the toybox testsuite
2022-12-10 11:04:35 +01:00
Terts Diepraam
ae044d4800
Merge pull request #4221 from ctsk/cp-init-progress-bar
Tick after creating progress bar to draw it
2022-12-07 19:56:57 +01:00
Terts Diepraam
39bbcdd180
Merge pull request #4217 from sylvestre/busybox4
busybox: replicate the same output as GNU
2022-12-07 19:53:38 +01:00
Sylvestre Ledru
d453f909e8 Run toybox in the CI 2022-12-07 15:41:21 +01:00
Sylvestre Ledru
9ff6b80381 makefile: add support for toybox 2022-12-07 14:28:04 +01:00
Daniel Hofstetter
81243db948 chore: fix wildcards that match single variant 2022-12-06 10:50:34 +01:00
Sylvestre Ledru
20f6b6d0c5
Fix the # of SKIP 2022-12-06 10:45:28 +01:00
ctsk
8a837dae21 Tick after creating progress bar to draw it 2022-12-06 10:36:52 +01:00
Kai M
42b9b7b62c
install: fix issue #3814 (#3950)
* install: fix installing one file when using -Dt options

* install: fix installing multiple files with -Dt

Code was missing the logic to create the target dir when multiple files
should be copied and target dir is given by -t option.
This simplifies the copy logic also when only one file should be copied
to the target dir.

* install: fix verbose output when using -D

Also adds a unit test to verify the same behaviour as the gnu tools.

* install: add more testcases for create leading dir

Tests various combinations of "-D" with and w/o "-t" when installing
either a single file or multiple files into a non existing directory.

  install -D file1 file2 (-t) not_existing_dir
  install -D file1 (-t) not_existing_dir/

Also fixes file formatting, spelling and adds some more test asserts.

* install: fix error for nonex. dir path ending on /

The install command failed with a different error message than the
original GNU install tool. Checking for a trailing slash fixes this.
Only works on unix though.

* install: add windows support when checking for '/'

* install.rs: fix spelling

* install.rs: add more tests regarding omitting dir

This increases the CI test coverage and also checks for more corner
cases to ensure uu_install is compliant with GNU's original.

    export C=coreutils/target/debug/

    rm -rf dir1 no-dir2 dir3 file
    mkdir -p dir1 dir3
    touch file

    ${C}install dir1/file1 dir1/.. no-dir2
    ${C}install dir1/file1 dir1/.. dir3
    ${C}install dir1/.. dir3

* install: improve test_install_missing_arguments

Also check that install returns the correct error messages, when only a
target directory is given via -t and that is is not created (-D option).

* install: rework the checks for missing file args

This ensures correct (GNU install like) behavior. Tests from the last
commit will pass now.
2022-12-06 09:11:23 +01:00
Sylvestre Ledru
c132535cf5 busybox: replicate the same output as GNU 2022-12-06 08:52:05 +01:00
Sylvestre Ledru
24340665ee
Merge pull request #4216 from jfinkels/cp-preserve-hardlinks-readability
cp: improve readability of preserve_hardlinks()
2022-12-06 08:44:44 +01:00
Sylvestre Ledru
321866aae9
Merge pull request #4215 from sylvestre/busybox3
factor: trim the input to fix some busybox results
2022-12-06 07:53:15 +01:00
Jeffrey Finkelstein
54a36df9ab dd: correct progress line if 1 byte written
Correct the progress report written by `dd` if exactly one byte is
written so that it says "1 byte" instead of "1 bytes".
2022-12-05 21:41:26 -05:00
Jeffrey Finkelstein
1a839fb2c4 cp: correct --verbose --parents output for dirs
This commit corrects the behavior of `cp -r --parents --verbose` when
the source path is a directory, so that it prints the copied ancestor
directories. For example,

    $ mkdir -p a/b/c d
    $ cp -r --verbose --parents a/b/c d
    a -> d/a
    a/b -> d/a/b
    'a/b/c' -> 'd/a/b/c'
2022-12-05 21:37:13 -05:00
Jeffrey Finkelstein
bd665ea44a cp: correct --verbose --parents output for files
This commit corrects the behavior of `cp --parents --verbose` when the
source path is a file so that it prints the copied ancestor
directories. For example,

    $ mkdir -p a/b d
    $ touch a/b/c
    $ cp --verbose --parents a/b/c d
    a -> d/a
    a/b -> d/a/b
    'a/b/c' -> 'd/a/b/c'

Fixes #3332.
2022-12-05 21:36:56 -05:00
Jeffrey Finkelstein
92e1bb98fe cp: improve readability of preserve_hardlinks()
Improve readability of the `preserve_hardlinks()` helper function by
reducing levels of nesting in the body of the function and making it
return a Boolean rather than mutating a Boolean argument.
2022-12-05 21:28:22 -05:00
Sylvestre Ledru
b7925465a8 factor: trim the input to fix some busybox results 2022-12-05 22:49:48 +01:00