summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* bit: Add the load8_[bl]euN() utilitiesTavian Barnes3 days1-1/+10
|
* trie: Make nibble indices big-endianTavian Barnes3 days1-0/+4
| | | | Otherwise the order doesn't match lexicographical order on bytes.
* tests/xtouch: Use xstrtol()Tavian Barnes3 days1-5/+2
|
* tests: Don't shell out to tr just to replace slashes with dashesTavian Barnes9 days1-3/+1
|
* tests: Make --no-clean listen to $NO_COLORTavian Barnes9 days1-1/+1
|
* tests/color: Use /dev/tty over $TTYTavian Barnes9 days1-2/+2
| | | | | | | | | | $TTY is the actual TTY, e.g. /dev/pts/3, which may not be accessible by the current user. This can happen e.g. if the PTY is owned by root, who then does root@host# su user user@host$ ./tests/tests.sh ./tests/color.sh: line 81: /dev/pts/3: Permission denied
* eval: Don't error out in -ls if the time overflowsTavian Barnes9 days1-0/+4
|
* tests: Use $EPOCHSECONDS if it existsTavian Barnes9 days1-2/+7
| | | | | | | Bash 5 adds that special variable, which should be more reliable than the awk trick, which is known to be broken on mawk. Fixes: https://github.com/tavianator/bfs/issues/152
* mtab: Use mount IDs instead of dev_t for bfs_fstype()Tavian Barnes10 days2-0/+29
| | | | | | | | | This fixes -fstype on btrfs subvolumes, which previously reported "unknown" due to their dev_t being potentially different from the mount point. Link: https://savannah.gnu.org/bugs/?50859 Link: https://lwn.net/Articles/866582/
* tests/posix/exec_sigmask: Make portableTavian Barnes12 days1-2/+14
| | | | | | | | The test was Linux-only, and didn't pass on at least mips64el due to a different signal mask size. The new version should be fully portable, but will hang forever on failure. Link: https://buildd.debian.org/status/fetch.php?pkg=bfs&arch=mips64el&ver=4.0.5-1&stamp=1737761227&raw=0
* tests/sighook: Fix Valgrind compatibilityTavian Barnes2025-01-211-39/+43
| | | | | | | | | | | | | | | | | | | | Valgrind does not deliver async signals in a timely manner; by default, it polls for new signals every 1,000 basic blocks. That means we can get SIGALRM delivered after timer_delete(), or kill(SIGSEGV) never delivered after pause(). Fix the timer_delete() issue by reordering the cleanup path. Valgrind always polls pending signals after pthread_sigmask(), so call that between timer_delete() and sigunhook(). Fix the pause() issue by sleeping in a loop instead. Note that --fair-sched=yes is required to avoid starvation of the background thread. Link: https://bugs.kde.org/show_bug.cgi?id=492678 Link: https://bugs.kde.org/show_bug.cgi?id=343357 Link: https://bugs.kde.org/show_bug.cgi?id=498936
* tests: Add a test for sigmask restorationTavian Barnes2025-01-182-0/+5
|
* sighook: Always re-raise faults on macOSTavian Barnes2024-12-221-0/+4
| | | | | | | | | | macOS always fills in si_code for SIG{BUS,ILL,SEGV} as if it were a real hardware fault, so returning from the handler is not guaranteed to re- trigger the signal. Fixes: aecdabb ("sighook: Return instead of re-raising for faults") Link: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2386463/4/util/posix/signals_test.cc Link: https://github.com/chromium/crashpad/commit/e0d8a0aa01ac176804077f1f128ccc894c098f79
* tests/sighook: Add missing #include <sys/wait.h>Tavian Barnes2024-12-191-2/+3
|
* tests/gnu: Add an -ignore_readdir_race test for removed directoriesTavian Barnes2024-12-172-0/+7
| | | | Link: https://savannah.gnu.org/bugs/index.php?45930
* tests/sighook: Add atsigexit() testsTavian Barnes2024-12-171-1/+77
|
* tests/sighook: Test the SH_ONESHOT flagTavian Barnes2024-12-041-2/+28
|
* ioq: Submit and pop requests in batchesTavian Barnes2024-12-031-0/+1
| | | | | The new ioq_submit() function is now necessary to call to ensure the pending request batch is flushed.
* tests/getopts: Remove unused variableTavian Barnes2024-11-211-1/+0
|
* sanity: Don't mark memory uninit in sanitize_{alloc,free}()Tavian Barnes2024-11-021-10/+34
| | | | | We might want to change the size of an allocated region without changing which bytes are initialized.
* alloc: Stop supporting pathological flexible array ABIsTavian Barnes2024-11-021-4/+0
|
* alloc: Don't require size % align == 0Tavian Barnes2024-11-021-0/+8
| | | | | | | | | Allowing unaligned sizes will allow us to allocate aligned slabs with additional metadata in the tail without ballooning the allocation size for large alignments. Link: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2244.htm#dr_460 Link: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2072.htm
* color: Handle bfs_check_capabilities error code (-1) in cpath_has_capabilitiesJody Frankowski2024-10-314-0/+42
| | | | | | | | | | | On non-Linux systems, bfs_check_capabilities always returned -1, so cpath_has_capabilities would always return true. If bfs was called with an LS_COLORS containing the `ca` statement, e.g. `ca=30;41`, bfs would color ALL the files. While including the `ca` statement in LS_COLORS on non-Linux systems is unusual, this is not an error and is a valid use-case (e.g. Using GNU ls or lsd). Fixes: 1520d4d3 ("color: Don't color files like directories on ENOTDIR")
* bit: Add bswap() overloads for every primitive typeTavian Barnes2024-10-271-0/+7
| | | | Fixes: https://github.com/tavianator/bfs/issues/145
* tests/posix: Add a test for overly aggressive -exec {} + matchingTavian Barnes2024-10-272-0/+33
| | | | Link: https://savannah.gnu.org/bugs/?66365
* color: Don't color files like directories on ENOTDIRTavian Barnes2024-10-161-2/+2
|
* color: Fix an infinite loop colorizing some invalid pathsTavian Barnes2024-10-132-0/+2
| | | | | | | | | | | | | | Previously, given $ touch file $ ln -s file/file notdir $ bfs notdir/file bfs would loop forever when printing the error message, since it expected stripping the trailing slash from "notdir/" to fix the ENOTDIR error, but the broken symlink still gave the same error. Fixes: b4c3201 ("color: Only highlight the trailing slash on ENOTDIR")
* tests/gnu: Test -L -printf %YTavian Barnes2024-10-102-0/+18
|
* tests/trie: Improve code coverageTavian Barnes2024-10-101-1/+4
|
* sighook: Don't forget to reset list->tail on the last sigpop()Tavian Barnes2024-10-101-0/+7
| | | | | | | This was causing a UAF if we ever unregistered the last hook for a signal and then re-registered one. Fixes: 75b7f70 ("sighook: Make sigunhook() O(1)")
* tests/sighook: Use the new xtimer_start() APITavian Barnes2024-10-101-8/+6
|
* color: Fix an assertion failure with embedded NUL bytesTavian Barnes2024-10-022-0/+32
| | | | | | | | | | | | | Leading NUL bytes (e.g. `*\0.gz=...`) could cause us to insert a non-prefix-free set of strings into the case-insensitive extension trie, which would lead to crashes like bfs: trie_split@src/trie.c:538: Assertion failed: `key_nibble != rep_nibble` and OOB accesses to trie leaf keys. Fix it by ignoring those extensions, since filenames cannot contain NUL bytes. Fixes: 08030aea ("color: Delay the case_sensitive decision")
* Fix spellingTavian Barnes2024-09-232-2/+2
|
* opt: Fix an invalid assertion in sink_not_comma()Tavian Barnes2024-09-172-0/+36
| | | | | | | When optimizing -not \( -a , -b \), the child is a comma expression, not the parent. Fixes: 4a36bb9 ("expr: Make expressions variadic")
* Fix includesTavian Barnes2024-08-297-6/+4
|
* build: Move feature test macros to prelude.hTavian Barnes2024-08-2812-18/+4
| | | | | | This replaces the explicit CPPFLAGS list in flags.mk with just `-include src/prelude.h`, shortening our compiler command lines and allowing them to be easily documented.
* prelude: Split bfs-specific utilities into new bfs.h headerTavian Barnes2024-08-2813-7/+34
|
* diag: Get rid of bfs_static_assert()Tavian Barnes2024-08-281-31/+37
| | | | | In most cases, it's not too annoying to specify a message. For tests/bit.c, we can manually polyfill the 1-argument version.
* prelude: Define thread_localTavian Barnes2024-08-281-1/+0
|
* eval: Don't warn about suppressed errors without -noerrorTavian Barnes2024-08-191-0/+2
|
* tests/bfs: Add -noerror testsTavian Barnes2024-08-197-0/+21
|
* xtime: Remove xgettime()Tavian Barnes2024-08-091-2/+2
| | | | clock_gettime() is available everywhere by now.
* parse: Take umask into account in parse_mode()Tavian Barnes2024-08-024-2/+21
| | | | | | | POSIX 2024 clarified that find(1) is meant to work exactly like chmod(1) here, so for modes like +rw,-x with no "who" specified, apply the umask. Link: https://www.austingroupbugs.net/view.php?id=1392
* tests: Add more files to perms/Tavian Barnes2024-08-0222-103/+333
|
* tests: Make some more variables localTavian Barnes2024-08-011-2/+4
|
* tests: Fix line number reported when wait -n failsTavian Barnes2024-08-011-2/+3
|
* tests: Add tests for invalid users/groupsTavian Barnes2024-07-2728-0/+8
|
* tests: Make more tests POSIX-compliantTavian Barnes2024-07-2310-10/+10
|
* tests/common: Add some missing pathsTavian Barnes2024-07-234-4/+4
|
* Implement POSIX 2024's -mountTavian Barnes2024-07-085-6/+2
| | | | | | This reverts commit 4f80c17192f2b28c96a489969d4435151d68d0ce. Link: https://www.austingroupbugs.net/view.php?id=1133