Files
makeself/test/run-testlinter.sh
Alexandr Reshetnikov a4f40a21ae move from bashunit to shunit2. refactoring tests. (#272)
* move from bashunit to shunit2

move run-tests.sh to test

simplify build.yml

* back shunit2 to submodule
2022-06-11 01:52:34 -07:00

33 lines
681 B
Bash

#!/bin/bash
set -eu
THIS="$(realpath "$0")"
THISDIR="$(dirname "${THIS}")"
cd "$THISDIR"
is_windows_os=false
[[ $(uname) == Windows_NT* ]] && is_windows_os=true
[[ $(uname) == MINGW64_NT* ]] && is_windows_os=true
testShStartsWith() {
if [[ $is_windows_os == true ]]; then
return
fi
for test_sh in ./*test; do
file_name="$(basename -- "$test_sh")"
if [[ -f "${test_sh}" ]]; then
echo ">> Test $file_name"
local etalon_head="$(printf '#!/bin/bash
set -eu
THIS="$(realpath "$0")"
THISDIR="$(dirname "${THIS}")"
')"
assertEquals "$etalon_head" "$(cat "${test_sh}" | head -4)"
fi
done
}
# Load and run shUnit2.
source "./shunit2/shunit2"