Add simper spec runners (with make)

Allow usage of `make spec` to run project's specs against default
Crystal compiler or one that can be supplied with `CRYSTAL`
environment variable.

Also provide ways to run in automated mode thanks to watchexec.

[skip ci]
This commit is contained in:
Luis Lavena 2017-09-22 17:55:42 -03:00
parent 211418416a
commit 905bd9e14b
1 changed files with 18 additions and 0 deletions

18
Makefile Normal file
View File

@ -0,0 +1,18 @@
CRYSTAL ?= crystal
profile ?= ## Display profiling information after specs execution
verbose ?= ## Run specs in verbose mode
SPEC_FLAGS := $(if $(profile),--profile )$(if $(verbose),--verbose )
.PHONY: default autospec spec
default: spec
# `autospec` task uses `watchexec` external dependency:
# https://github.com/mattgreen/watchexec
autospec:
watchexec --exts cr --watch spec --watch src --clear $(CRYSTAL) spec $(SPEC_FLAGS)
spec:
$(CRYSTAL) spec $(SPEC_FLAGS)