mirror of
https://github.com/fradelg/docker-mysql-cron-backup.git
synced 2024-11-01 08:31:45 +01:00
Adding Makefile for running tests via 'make test'
This can be used for local development and even for running at travis-ci.
This commit is contained in:
parent
ef1f26cec8
commit
658751a5e4
1 changed files with 25 additions and 0 deletions
25
Makefile
Normal file
25
Makefile
Normal 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
|
Loading…
Reference in a new issue