aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-10-14 17:25:30 +0500
committerEgor Tensin <egor@tensin.name>2026-10-14 17:28:08 +0500
commit0bcda04d3afe76ebd36eaa5c2fdd8f9b4cf3f54f (patch)
tree1dc84f41a04c8bd021deafdb0848c3467955490f
parentimport main files from tag-release (diff)
downloadtest-harness-0bcda04d3afe76ebd36eaa5c2fdd8f9b4cf3f54f.tar.gz
test-harness-0bcda04d3afe76ebd36eaa5c2fdd8f9b4cf3f54f.zip
main.sh: source project-specific files in lib/
-rwxr-xr-xmain.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/main.sh b/main.sh
index 8b7e482..8190873 100755
--- a/main.sh
+++ b/main.sh
@@ -15,6 +15,7 @@ script_name="$( basename -- "${BASH_SOURCE[0]}" )"
readonly script_name
readonly tests_dir="$script_dir/.."
+readonly lib_dir="$tests_dir/lib"
source "$script_dir/lib/log.sh"
@@ -22,6 +23,20 @@ run_test_file() {
local test_file
for test_file; do
source "$script_dir/lib/test.sh"
+
+ local lib_file
+ find "$lib_dir" \
+ -mindepth 1 \
+ -maxdepth 1 \
+ -type f \
+ -name '*.sh' \
+ -print0 \
+ | sort -z \
+ | \
+ while IFS= read -d '' -r lib_file; do
+ source "$lib_file"
+ done
+
source "$tests_dir/$test_file"
log_test_start "$test_file"