diff options
| author | Egor Tensin <egor@tensin.name> | 2026-10-15 12:22:58 +0500 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-10-15 12:22:58 +0500 |
| commit | 924076ccf375a8b7809b8b37b05074d3342d5c6c (patch) | |
| tree | 6c3eae74631e36e94daf09d3b335db0da092b32a /src | |
| parent | README: update (diff) | |
| download | test-harness-924076ccf375a8b7809b8b37b05074d3342d5c6c.tar.gz test-harness-924076ccf375a8b7809b8b37b05074d3342d5c6c.zip | |
don't fail if lib/ doesn't exist
Diffstat (limited to 'src')
| -rwxr-xr-x | src/main.sh | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/main.sh b/src/main.sh index cb0e334..efd154b 100755 --- a/src/main.sh +++ b/src/main.sh @@ -24,18 +24,20 @@ _test_run_file() { for test_file; do source "$_script_dir/test.sh" - local lib_file - find "$tests_dir/lib" \ - -mindepth 1 \ - -maxdepth 1 \ - -type f \ - -name '*.sh' \ - -print0 \ - | sort -z \ - | \ - while IFS= read -d '' -r lib_file; do - source "$lib_file" - done + if [ -d "$tests_dir/lib" ]; then + local lib_file + find "$tests_dir/lib" \ + -mindepth 1 \ + -maxdepth 1 \ + -type f \ + -name '*.sh' \ + -print0 \ + | sort -z \ + | \ + while IFS= read -d '' -r lib_file; do + source "$lib_file" + done + fi source "$tests_dir/$test_file" |
