From b32b8ca1da609c33d627962c8611acb2781c24f7 Mon Sep 17 00:00:00 2001 From: Krzysztof Jurewicz Date: Fri, 25 May 2018 15:10:45 +0200 Subject: [PATCH] Add compilation of files from the test directory --- README.asciidoc | 3 ++- plugins.mk | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index b21ed58..3c2001f 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -12,6 +12,7 @@ include erlang.mk ---- The command `make` will compile all LFE files in the 'src/' -directory. +directory. LFE files in the 'test/' directory will be compiled when +running tests. The command `make lfe-shell` will open an LFE shell. diff --git a/plugins.mk b/plugins.mk index 1642862..4c5d7c3 100644 --- a/plugins.mk +++ b/plugins.mk @@ -12,7 +12,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.PHONY: lfe-shell +.PHONY: lfe-shell lfe-test-dir # Verbosity. @@ -36,6 +36,17 @@ ebin/$(PROJECT).app:: $(LFE_FILES) | ebin/ endif +LFE_TEST_FILES = $(sort $(call core_find,$(TEST_DIR),*.lfe)) + +ifneq ($(LFE_TEST_FILES),) +lfe-test-dir: $(LFE_TEST_FILES) + $(lfe_verbose) PATH=$(PATH):$(DEPS_DIR)/lfe/bin lfec -o test/ $(LFE_TEST_FILES) + +test-build:: lfe-test-dir +else +lfe-test-dir: +endif + # Shell. lfe-shell: deps