forked from editorconfig/editorconfig-emacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (36 loc) · 1.34 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -*- Makefile -*-
EMACS = emacs
PROJECT_ROOT_DIR = $(PWD)
ERT_TESTS = $(wildcard $(PROJECT_ROOT_DIR)/ert-tests/*.el)
TRAVIS_FILE = .travis.yml
# Compile with noninteractive and relatively clean environment.
BATCHFLAGS = -batch -q --no-site-file -L $(PROJECT_ROOT_DIR)
SRCS = editorconfig.el editorconfig-core.el editorconfig-core-handle.el \
editorconfig-fnmatch.el
OBJS = $(SRCS:.el=.elc)
$(OBJS): %.elc: %.el
$(EMACS) $(BATCHFLAGS) -f batch-byte-compile $^
.PHONY: all clean test test-travis test-ert test-core test-metadata
all: $(OBJS)
clean:
-rm -f $(OBJS)
test: test-ert test-core test-metadata $(OBJS)
$(EMACS) $(BATCHFLAGS) -l editorconfig.el
test-travis:
@if test -z "$$TRAVIS" && test -e $(TRAVIS_FILE); then travis-lint $(TRAVIS_FILE); fi
# ert test
test-ert: $(ERT_TESTS) $(OBJS)
$(EMACS) $(BATCHFLAGS) \
--eval "(require 'ert) (setq debug-on-error t)" \
--eval "(setq metadata-el-files '($(SRCS:%=\"%\")))" \
$(ERT_TESTS:%=-l "%") \
-f ert-run-tests-batch-and-exit
# Core test
core-test/CMakeLists.txt:
git submodule update --init
test-core: core-test/CMakeLists.txt $(OBJS)
cd $(PROJECT_ROOT_DIR)/core-test && \
cmake -DEDITORCONFIG_CMD="$(PROJECT_ROOT_DIR)/bin/editorconfig-el" .
cd $(PROJECT_ROOT_DIR)/core-test && \
EMACS_BIN=$(EMACS) EDITORCONFIG_CORE_LIBRARY_PATH="$(PROJECT_ROOT_DIR)" \
ctest --output-on-failure .