forked from mlippert/rhythm-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (58 loc) · 2.9 KB
/
Makefile
File metadata and controls
76 lines (58 loc) · 2.9 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#
# Makefile to build and test the riff-server
# duplicates (and should be kept in sync with) some of the scripts in package.json
#
GIT_TAG_VERSION = $(shell git describe)
COMPILER = ./node_modules/.bin/tsc
LINT = ./node_modules/.bin/eslint
MOCHA = ./node_modules/.bin/mocha
LINT_LOG = logs/lint.log
TEST_LOG = logs/test.log
# Add --quiet to only report on errors, not warnings
LINT_OPTIONS =
LINT_FORMAT = stylish
.DELETE_ON_ERROR :
.PHONY : help all build doc lint test load-test wtftest clean clean-build start-dev
help :
@echo "" ; \
echo "Useful targets in this riff-server Makefile:" ; \
echo "- all : run lint, build, test" ; \
echo "- build : currently does nothing" ; \
echo "- clean : remove all files created by build" ; \
echo "- lint : run lint over the sources & tests; display results to stdout" ; \
echo "- lint-log : run lint concise diffable output to $(LINT_LOG)" ; \
echo "- test : run the mocha (unit) tests" ; \
echo "- load-test : run the mocha (load) tests" ; \
echo "- wtftest : run the mocha (unit) tests w/ wtfnode to help debug the test run hanging at the end" ; \
echo "- vim-lint : run lint in format consumable by vim quickfix" ; \
echo "- init : run install, build; intended for initializing a fresh repo clone" ; \
echo "- install : run npm install" ; \
echo ""
all : lint build test
init : install build
install:
npm install
build :
@echo "build converts source files to runnable files (eg compiles, links, minimizes)"
@echo "riff-server source files are run as is at this time, so no processing is needed."
doc :
@echo "doc creates usable documentation files (eg extracts/compiles doc in source code)"
@echo "riff-server does not have any extractable or buildable documentation at this time."
lint-log: LINT_OPTIONS = --output-file $(LINT_LOG)
lint-log: LINT_FORMAT = unix
vim-lint: LINT_FORMAT = unix
lint vim-lint lint-log:
$(LINT) $(LINT_OPTIONS) --format $(LINT_FORMAT) src test
test :
$(MOCHA) --reporter spec -r dotenv/config --recursive --sort --invert --grep 'Load tests' test | tee $(TEST_LOG)
load-test :
$(MOCHA) --reporter spec -r dotenv/config test/load.test.js
wtftest : ./node_modules/.bin/wtfnode
# This is helpful for determining why the tests seem to be hanging after they've "finished"
# it requires the wtfnode package to be installed.
./node_modules/.bin/wtfnode ./node_modules/.bin/_mocha --reporter spec -r dotenv/config --recursive --sort --invert --grep 'Load tests' test
clean : clean-build
clean-build :
-rm -f dist/*
./node_modules/.bin/wtfnode :
npm install wtfnode --no-save