summaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)Author
2024-04-09tests: Move newer_link out of posix/Tavian Barnes
POSIX has clarified that it's unspecified whether -newer uses times from stat() or lstat(), because implementations vary. It does specify that it must fall back to lstat() for broken links, so test that. Link: https://austingroupbugs.net/view.php?id=1776
2024-04-09build: Add a separate configuration stepTavian Barnes
2024-03-28tests/bsd: Add a -sparse testTavian Barnes
2024-03-28tests/gnu: Add a -used testTavian Barnes
2024-03-28tests/common: Add a -delete error handling testTavian Barnes
2024-03-27xspawn: Fix bfs_resolve_late() error reportingTavian Barnes
2024-03-27tests/xspawn: Test path resolution failureTavian Barnes
2024-03-27tests/xspawn: Also test dup2()Tavian Barnes
2024-03-27tests/xspawn: New unit testTavian Barnes
2024-03-27tests: New bfs_pcheck() macro to report xstrerror(errno)Tavian Barnes
2024-03-26bfstd: Escape ASCII tildesTavian Barnes
The POSIX spec [1] lists some characters that may need to be escaped. Unfortunately, the document uses ˜ (U+02DC SMALL TILDE) instead of ~ (U+007E TILDE), and I copy-pasted from it. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02
2024-03-26xtime: Don't update tm if xtimegm() overflowsTavian Barnes
2024-03-21bfstd: New asciilen() functionTavian Barnes
2024-03-21bit: Check __BYTE_ORDER__ for the native endianTavian Barnes
__ORDER_NATIVE_ENDIAN__ is not a thing.
2024-03-20bfstd: Check that wcwidth() is positiveTavian Barnes
wcwidth() returns -1 for non-printable characters, but terminals typically don't print anything for them, so treat them as 0.
2024-03-20Implement -limit NTavian Barnes
Closes: https://github.com/tavianator/bfs/issues/133
2024-03-11Re-run include-what-you-useTavian Barnes
2024-03-10tests/xtime: Add tests for integer overflowTavian Barnes
2024-03-07xtime: Call tzset() from main() instead of lazilyTavian Barnes
POSIX specifies[1] that If a thread accesses tzname, daylight, or timezone directly while another thread is in a call to tzset(), or to any function that is required or allowed to set timezone information as if by calling tzset(), the behavior is undefined. So calling it lazily from arbitrary threads is risky. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tzset.html
2024-03-07tests: Change the timezone for -daystart testsTavian Barnes
Otherwise, if the test files are created just before midnight, and the test runs just after midnight, -daystart will consider them one day old. Fixes #132
2024-03-02tests/ioq: Check that we push and pop the same number of timesTavian Barnes
2024-02-29tests: New bfs_check() macroTavian Barnes
We now report failures and continue, rather than aborting after the first failure.
2024-02-29tests: Add more datetime parsing integration testsTavian Barnes
2024-02-28xtime: Fix some xgetdate() bugsTavian Barnes
And add some more test cases.
2024-02-28tests/ioq: New unit testTavian Barnes
2024-02-28tests/bfs/D_opt: Don't rely on directory link countsTavian Barnes
Fixes: https://github.com/tavianator/bfs/issues/131
2024-02-17tests: Redirect stdin in bfs_pty()Tavian Barnes
Otherwise bfs will think it's interactive.
2024-02-06bftw: stat() files asynchronouslyTavian Barnes
2024-02-05tests: Fix --stopTavian Barnes
2024-02-03tests: Implement jobserver inheritanceTavian Barnes
2024-02-01tests: Don't clobber inherited FDsTavian Barnes
Rather than attempting to close any unexpected FDs, just count them and adjust our ulimit -n calls to account for them.
2024-02-01tests: Use variable redirections to dup std{out,err}Tavian Barnes
Previously, we hardcoded file descriptors 3 and 4 for duplicating stdandard output/error respectively. In preparation for keeping inherited FDs open, switch to using bash's variable redirection feature to dynamically assign FDs. This feature is only available from bash 4.1 onwards, so this marks the end of our support for bash 3. macOS users will need to install a modern bash version to run our tests.
2024-01-31bftw: Actually stop if the callback returns BFTW_STOPTavian Barnes
Otherwise, bftw_ids() or bftw_eds() might keep going! Fixes: 5f16169 ("bftw: Share the bftw_state between iterations of ids/eds")
2024-01-17tests/posix: Avoid catastrophic backtrackingTavian Barnes
Using -path 'deep/*/*/.../*' to simulate -mindepth 18 falls off a performance cliff on systems that use backtracking for fnmatch(). This was observed on macOS 12.4. Instead, just use -type f.
2024-01-13tests: Properly filter escape sequences with --verbose=testsTavian Barnes
2024-01-13bfstd: New {error,errno}_is_like() functionsTavian Barnes
We used to have is_nonexistence_error() to consistently treat ENOENT and ENOTDIR the same. Recently, we started considering EFAULT the same as ENAMETOOLONG on DragonFly BSD to work around a kernel bug. Unify both of these behind a more generic interface.
2024-01-13tests.h: Add a header guardTavian Barnes
2024-01-12tests: Merge unit test executables into oneTavian Barnes
2024-01-11tests: New output formatTavian Barnes
2024-01-09tests: Don't do chmod +sTavian Barnes
POSIX says > When using the symbolic mode form on a regular file, it is > implementation-defined whether or not: > > - Requests to set the set-user-ID-on-execution or set-group-ID-on- > execution bit when all execute bits are currently clear and none > are being set are ignored. And indeed, illumos ignores them with a warning: chmod: WARNING: /tmp/bfs.XXXX7KaGWb/rainbow/suid: Execute permission required for set-ID on execution Link: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/chmod.html
2024-01-07tests/bfs/D_opt: New test for more -D opt coverageTavian Barnes
2024-01-04Work around DragonFly BSD kernel bugTavian Barnes
DragonFly's x86_64 assembly implementation of copyinstr() checks the wrong pointer when deciding whether to return EFAULT or ENAMETOOLONG, causing it to always return EFAULT for overlong paths. Work around it by treating EFAULT the same as ENAMETOOLONG on DragonFly. Link: https://twitter.com/tavianator/status/1742991411203485713
2024-01-03tests/posix/name_bracket: Skip on NetBSD tooTavian Barnes
2024-01-03tests/bsd/type_w: Check for truncate(1) before using itTavian Barnes
2024-01-01tests: Remove unneeded command -v unbuffer || skipTavian Barnes
2023-12-09parse: Reject integers that start with whitespaceTavian Barnes
2023-11-23tests: Set abort_on_error for the sanitizersTavian Barnes
2023-11-23tests: Fix --stopTavian Barnes
2023-11-15tests: Fix a possible infinite loopTavian Barnes
The POSIX spec for readdir() [1] says: > If a file is removed from or added to the directory after the most > recent call to opendir() or rewinddir(), whether a subsequent call > to readdir() returns an entry for that file is unspecified. which implies that a loop of readdir()/unlink()/creat() may continue to return new files unendingly. This was even observed on a Linux 6.6 tmpfs mount [2]. It's not clear whether find(1) is also permitted to loop endlessly in this case, but in case it is, let's avoid the whole problem by limiting the -exec to happen at most once. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html [2]: https://lore.kernel.org/linux-fsdevel/20231113180616.2831430-1-tavianator@tavianator.com/
2023-11-13tests: Fix --verbose=commands with --bfs="wrapper bfs"Tavian Barnes