test: Add shellcheck

Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
Jacques de Laval
2021-02-18 14:39:55 +01:00
parent 4224c2e8fe
commit 39edf52792
2 changed files with 10 additions and 6 deletions
+5 -1
View File
@@ -66,7 +66,11 @@ $(testroot)/usr/local/lib/libuev.so.2:
.PHONY: test
test: $(binaries) $(testroot_bin)/chrootsetup.sh $(dirs) $(testroot)/sbin/finit
./runtest.sh ./test_start_stop_service/test.sh
./runtest.sh test_start_stop_service/test.sh
.PHONY: lint
lint:
shellcheck $(shell find . -name '*.sh')
.PHONY: clean
clean:
+5 -5
View File
@@ -3,14 +3,14 @@
set -eu
texec() {
./testenv_exec.sh $(pgrep -P $finit_ppid) "$@"
./testenv_exec.sh "$(pgrep -P "$finit_ppid")" "$@"
}
fg_red='31'
fg_green='32'
fg_yellow='33'
log() {
printf "< TEST > \e[1;%dm%s\e[0m %s\n" "$1" "$2" "$3"
printf "< $TEST_DIR > \e[1;%dm%s\e[0m %s\n" "$1" "$2" "$3"
}
assert() {
@@ -40,13 +40,13 @@ trap teardown EXIT
finit_ppid=$!
for i in $(seq 1 50); do
sleep 0.1
finit_pid=$(pgrep -P "$finit_ppid") || continue
pgrep -P "$finit_ppid" > /dev/null || continue
break
done
texec cat /dev/tty0 &
sleep 1
TEST_DIR=$(dirname $1)
TEST_DIR=$(dirname "$1")
source "$1"
. "$1"