Merge pull request #3 from waja/feature/tests

Adding Makefile for running tests via 'make test'
This commit is contained in:
Fco. Javier Delgado del Hoyo 2017-04-08 17:13:06 +02:00 committed by GitHub
commit 1b801d6f00

25
Makefile Normal file
View file

@ -0,0 +1,25 @@
# Makefile
all: test
test:
# Checking for syntax errors
set -e; for SCRIPT in *.sh; \
do \
sh -n $$SCRIPT; \
done
# Checking for bashisms (currently not failing, but only listing)
SCRIPT="$$(which checkbashisms)"; if [ -n "$$SCRIPT" ] && [ -x "$$SCRIPT" ]; \
then \
$$SCRIPT *.sh || true; \
else \
echo "WARNING: skipping bashism test - you need to install checkbashism."; \
fi
SCRIPT="$$(which shellcheck)"; if [ -n "$$SCRIPT" ] && [ -x "$$SCRIPT" ]; \
then \
$$SCRIPT *.sh || true; \
else \
echo "WARNING: skipping shellcheck test - you need to install shellcheck."; \
fi