Adding `make test` target.

Uses [py.test](https://pytest.org) to collect all Python doctests and
unittests.

Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
This commit is contained in:
Tim 'mithro' Ansell 2019-01-10 17:58:32 -08:00
parent 9ebaf01de6
commit 841905c1e0
2 changed files with 9 additions and 2 deletions

View File

@ -20,8 +20,14 @@ build:
database: build
$(MAKE) -C $@
FORMAT_EXCLUDE = third_party .git env build
FIND_EXCLUDE = $(foreach x,$(FORMAT_EXCLUDE),-and -not -path './$(x)/*')
ALL_EXCLUDE = third_party .git env build
TEST_EXCLUDE = $(foreach x,$(ALL_EXCLUDE) fuzzers minitests experiments,--ignore $(x))
test: build
# FIXME: Add C++ unit tests
$(IN_ENV) py.test $(TEST_EXCLUDE) --doctest-modules
FIND_EXCLUDE = $(foreach x,$(ALL_EXCLUDE),-and -not -path './$(x)/*')
format:
find . -name \*.cc $(FIND_EXCLUDE) -print0 | xargs -0 -P $$(nproc) ${CLANG_FORMAT} -style=file -i
find . -name \*.h $(FIND_EXCLUDE) -print0 | xargs -0 -P $$(nproc) ${CLANG_FORMAT} -style=file -i

View File

@ -8,3 +8,4 @@ scipy
sympy
yapf==0.24.0
textx
pytest