From 841905c1e0a8951c1a38d552b06387061f51d6a7 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Thu, 10 Jan 2019 17:58:32 -0800 Subject: [PATCH] Adding `make test` target. Uses [py.test](https://pytest.org) to collect all Python doctests and unittests. Signed-off-by: Tim 'mithro' Ansell --- Makefile | 10 ++++++++-- requirements.txt | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 696eb1e5..5f50c33a 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/requirements.txt b/requirements.txt index 0e29387c..679e7de9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,3 +8,4 @@ scipy sympy yapf==0.24.0 textx +pytest