#!/usr/bin/env bash # accepts 3 parameters: # 1. the path to the lua binary # 2. the path to where _test.lua files reside # 3. the path to the lua unit test library # # bazel test //pkg/edge/logging/fluentbit:lua_test # BUILD.bazel contains the argument list passed to this script. set -o errexit set -o nounset set -o pipefail lua="$1" # we need the absolute paths for the target direcotry and testing library # so we can pass it to lua's package path variable. target_dir="$2" test_library="$3" test_scripts="$target_dir/*_test.lua" for lua_script in $test_scripts do $lua "$lua_script" "$test_library" "$target_dir" done