summaryrefslogtreecommitdiffstats
path: root/tests.sh
Commit message (Collapse)AuthorAgeFilesLines
* Makefile: Split build into bin and obj directoriesTavian Barnes2022-05-161-3435/+0
| | | | | This also moves the main binary from ./bfs to ./bin/bfs, and ./tests.sh to ./tests/tests.sh, with the goal of keeping the repository root clean.
* tests: New --stop flag to stop after the first failureTavian Barnes2022-05-131-1/+9
|
* tests: Buffer standard error, and print it when tests failTavian Barnes2022-05-131-91/+87
|
* tests: Add --verbose={commands,errors,skipped,tests} optionsTavian Barnes2022-05-131-10/+37
|
* tests: Exit immediately if fail() detects a crashTavian Barnes2022-05-121-2/+2
|
* tests: New skip_unless helperTavian Barnes2022-05-121-56/+68
|
* tests: Use skip_if for sudo testsTavian Barnes2022-05-121-44/+62
| | | | | | This lets us categorize the sudo tests properly, which fixes e.g. $ ./tests.sh --posix --sudo
* stat: Pass AT_NO_AUTOMOUNT if possibleTavian Barnes2022-05-121-0/+21
| | | | | Previously bfs would trigger automounts even when it didn't descend into the mount directory, while GNU find does not.
* tests: Also put build outputs under build/Tavian Barnes2022-04-161-1/+2
|
* color: Support a separate $BFS_COLORS environment variableTavian Barnes2022-04-151-3/+6
|
* tests: Quiet errors from chflagsTavian Barnes2022-04-151-1/+1
|
* tests: Use bfs_diff in more casesTavian Barnes2022-03-151-22/+5
|
* tests: Shell style fixesTavian Barnes2022-03-141-57/+56
| | | | We now support `./tests.sh --bfs="path/with\ spaces/bfs"`
* tests: Use -print0 instead of -printf '%p ' for exec flush testsTavian Barnes2022-03-131-4/+4
|
* tests: Use plain sort, not bfs_sortTavian Barnes2022-03-131-17/+2
| | | | | bfs_sort existed to keep the test outputs nicely in breadth-first order. Unfortunately the implementation using awk didn't support NUL bytes.
* tests: Use skip_if for more testsTavian Barnes2022-03-131-15/+11
|
* parse: Check for globs with unescaped trailing backslashesTavian Barnes2022-02-281-3/+0
| | | | | | | | | | Both macOS and musl fail to fail on an unescaped backslash, so check for it ourselves. Link: https://pubs.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html Link: https://github.com/void-linux/void-packages/pull/35836 Link: https://www.openwall.com/lists/musl/2022/02/25/2 Link: https://www.austingroupbugs.net/view.php?id=806
* regex: Use the encoding from the current localeTavian Barnes2022-02-241-0/+12
|
* tests: Mark -fprint/-exec flushing test bfs-specificTavian Barnes2022-02-181-2/+3
| | | | GNU find doesn't do it, so no reason to require it for compatibility.
* exec: Flush I/O streams before executing anythingTavian Barnes2022-02-111-1/+37
| | | | | | Otherwise output from commands may appear unexpectedly earlier than output from bfs. We use fflush(NULL) to flush all streams, which is more than GNU find does, but seems to be a useful extension.
* tests: Use skip_if for tests that need /dev/fullTavian Barnes2022-02-111-22/+14
|
* tests: Add a test that -exit suppresses the implicit -printTavian Barnes2022-02-101-0/+5
|
* tests: Skip case insensitive tests if FNM_CASEFOLD is missingTavian Barnes2022-02-081-0/+5
|
* tests: Separate skipped tests from passing testsTavian Barnes2022-02-081-34/+39
|
* tests: Disable some glob tests on macOSTavian Barnes2022-02-041-0/+10
| | | | | macOS seems to have a non-compliant fnmatch() that doesn't treat invalid character class expressions literally.
* regex: Add support for emacs and grep typesTavian Barnes2022-02-041-0/+18
|
* tests: Add tests for syntactically invalid globsTavian Barnes2022-02-021-0/+24
|
* tests: New tests for -i?wholenameTavian Barnes2022-02-011-0/+12
|
* tests: New test for ** in a globTavian Barnes2022-02-011-0/+5
|
* tests: New test for -prune on a non-directoryTavian Barnes2022-02-011-0/+5
|
* tests: Try to color diff outputTavian Barnes2022-02-011-11/+18
|
* tests: set -P for the whole scriptTavian Barnes2022-02-011-2/+1
| | | | We rely on physical path resolution in test_execdir_pwd.
* tests: Allow tests.sh to be invoked from any directoryTavian Barnes2022-02-011-13/+21
| | | | | This also resolves the path passed to --bfs early, so --bfs=./bfs now works.
* parse: Add support for ed and sed regexesTavian Barnes2022-01-301-0/+12
| | | | They're apparently the same as POSIX basic regexes.
* Revert "tests: Add a test for posix-basic alternation"Tavian Barnes2022-01-291-5/+0
| | | | | | | Turns out alternation is not actually part of the POSIX basic regular expression language, it's just a glibc extension. This reverts commit c898af13a671ee92a056467d324f16823594eb1c.
* tests: Add a test for posix-basic alternationTavian Barnes2022-01-291-0/+5
|
* ci/macos: Switch back to macos-latestTavian Barnes2021-12-191-22/+29
|
* tests: Set TZ to a real timezoneTavian Barnes2021-12-101-1/+1
| | | | | | | POSIX states that the offset is not optional in the TZ environment variable. Link: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
* parse: Switch back to O_TRUNC from explicit ftruncate()Tavian Barnes2021-10-191-15/+9
| | | | | | | | O_TRUNC is not equivalent to an unconditional ftruncate(), e.g. for device files. This reverts the behaviour change from 78944c81, which was never released and is not supported in other find implementations.
* tests: Distinguish between failures and crashesTavian Barnes2021-10-191-47/+61
|
* tests: Set abort_on_error=1 for the sanitizersTavian Barnes2021-10-191-0/+6
| | | | This makes it easier to distinguish crashes from expected failures
* printf: Colorize file names/paths in simple casesTavian Barnes2021-10-091-0/+5
|
* tests: Add a test for an operator in an unexpected positionTavian Barnes2021-10-011-0/+5
|
* tests: Add tests for parsing invalid integersTavian Barnes2021-10-011-0/+21
| | | | And give some better error messages.
* tests: Add a tests for missing and nonexistent pathsTavian Barnes2021-10-011-0/+20
|
* Don't truncate files until we know they're not duplicatesTavian Barnes2021-09-261-0/+29
|
* ctx: Also deduplicate the standard streamsTavian Barnes2021-09-211-5/+50
| | | | | | This fixes some potential missing output when the same file is used in a redirection and something like -fprint. The main benefit is smarter handling of /dev/stdout, which will now share the CFILE* with cout.
* tests: Make the -files0-from tests weirderTavian Barnes2021-09-151-3/+5
|
* Implement -files0-from FILETavian Barnes2021-09-151-0/+37
| | | | | See https://savannah.gnu.org/bugs/?60383 for the development of the corresponding GNU find feature.
* Use /usr/bin/env bash as the shebang in scriptsTavian Barnes2021-08-051-1/+1
| | | | This should reduce the need for patches on the BSDs.