Add shellcheck tests
This commit is contained in:
parent
d2cd3b1b26
commit
b3209de4dc
1 changed files with 18 additions and 1 deletions
19
Makefile
19
Makefile
|
@ -14,9 +14,26 @@ pdf:
|
||||||
@rm yadm.ps
|
@rm yadm.ps
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test: bats shellcheck
|
||||||
|
|
||||||
|
.PHONY: bats
|
||||||
|
bats:
|
||||||
|
@echo Running all bats tests
|
||||||
@bats test
|
@bats test
|
||||||
|
|
||||||
|
.PHONY: shellcheck
|
||||||
|
shellcheck:
|
||||||
|
@echo Running shellcheck
|
||||||
|
@shellcheck --version || true
|
||||||
|
@shellcheck -s bash yadm test/*.bash
|
||||||
|
@for bats_file in test/*bats; do \
|
||||||
|
sed 's/^@test.*{/function test() {/' "$$bats_file" > "$$bats_file .bash"; \
|
||||||
|
shellcheck -s bash "$$bats_file .bash"; \
|
||||||
|
test_result="$$?"; \
|
||||||
|
rm -f "$$bats_file .bash"; \
|
||||||
|
[ "$$test_result" -ne 0 ] && exit 1; \
|
||||||
|
done; true
|
||||||
|
|
||||||
man:
|
man:
|
||||||
groff -man -Tascii ./yadm.1 | less
|
groff -man -Tascii ./yadm.1 | less
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue