summaryrefslogtreecommitdiffstats
path: root/tests/common
Commit message (Collapse)AuthorAgeFilesLines
* Implement POSIX 2024's -mountTavian Barnes2024-07-084-33/+0
| | | | | | This reverts commit 4f80c17192f2b28c96a489969d4435151d68d0ce. Link: https://www.austingroupbugs.net/view.php?id=1133
* tests: -iname is in POSIX 2024Tavian Barnes2024-07-082-6/+0
| | | | Link: https://www.austingroupbugs.net/view.php?id=1031
* tests: New inaccessible/ directory tree for permission errorsTavian Barnes2024-06-042-10/+2
|
* tests/common: Add tests for -[am]{min,time}Tavian Barnes2024-06-048-0/+84
|
* parse: Handle multiple flags at once like -LEXO2Tavian Barnes2024-06-032-0/+2
| | | | | | | | | | | | | | | | | | | | | The POSIX Utility Syntax Guidelines specify that flag groups like -HL should be handled like -H -L. GNU find doesn't support grouping flags in this way, but BSD find does. To avoid conflicts with non-flag primaries, for now we require at least one flag in a group to be a capital letter. That is, we support things like -Lds but not -ds. We also do not support -fPATH (without a space) as it would conflict with -follow, -fprint, etc. It is impossible to be compatible with both GNU and BSD find here: user@gnu$ find -follow link link/file ... user@bsd$ find -follow find: ollow: No such file or directory Link: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html
* eval: Plug memory leak if bfs_opendir() failsTavian Barnes2024-04-246-0/+40
|
* tests/common: Add a -delete error handling testTavian Barnes2024-03-282-0/+17
|
* tests: Add more datetime parsing integration testsTavian Barnes2024-02-291-1/+3
|
* tests: Don't clobber inherited FDsTavian Barnes2024-02-011-1/+1
| | | | | Rather than attempting to close any unexpected FDs, just count them and adjust our ulimit -n calls to account for them.
* tests: Fix Bash 3 compatibilityTavian Barnes2023-10-231-4/+2
|
* tests: Use test-specific scratch directoriesTavian Barnes2023-10-2216-59/+54
|
* tests: Refactor implementation into separate filesTavian Barnes2023-10-191-1/+0
|
* tests: New defer functionTavian Barnes2023-10-194-4/+4
|
* bfstd: Fix an OOB string index in xmbrtowc()Tavian Barnes2023-09-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | This bug could be reproduced with something like $ bfs -samefile $'\xFA\xFA' bfs: error: bfs: dstrnescat@src/dstring.c:252: wordesc() result truncated or worse, with -DNDEBUG, $ bfs -samefile $'.....................\xFA\xFA' bfs: error: bfs -samefile $'.....................\xFA\xFA\x00\x55\x53\x45\x52\x3D\x74\x61\x76\x69\x61\x6E\x61\x74\x6F\x72 bfs: error: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bfs: error: No such file or directory. which prints the memory after the end of the string (in this case, the environment variable USER=tavianator). The bug was caused by the line `*i += len`, which was intended to be `*i = len`. But actually, the right behaviour seems to be `*i += 1`. Fixes: 19c96abe0a1ee56cf206fd5e87defb1fd3e0daa5
* tests: Use bfs_sudo wrapper instead of testing $SUDOTavian Barnes2022-12-294-12/+8
|
* tests: Fail early in bfs_diff if the diff failsTavian Barnes2022-12-161-1/+1
| | | | Otherwise, propagate the exit code from bfs
* tests: Turn on set -eTavian Barnes2022-12-165-20/+13
|
* tests: Move crash detection into invoke_bfs, use ! instead of failTavian Barnes2022-12-162-2/+2
|
* tests: Replace skip_unless test with test || skipTavian Barnes2022-12-168-12/+12
|
* tests/xtouch: New utilityTavian Barnes2022-11-075-5/+5
| | | | | | POSIX touch(1) doesn't include the -h option, and indeed OpenBSD doesn't implement it. Making our own utility also lets us add some handy extensions like -p (create parents) and -M (set permissions).
* tests: Always clean scratch before using itTavian Barnes2022-10-202-0/+2
|
* tests: Add a helper for cleaning scratchTavian Barnes2022-10-207-7/+7
| | | | And try to unmount things if the a test left them mounted.
* tests: Coverage number go upTavian Barnes2022-10-192-0/+2
|
* tests: Split test cases into separate filesTavian Barnes2022-10-19122-0/+433