-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
33 lines (26 loc) · 1000 Bytes
/
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
TESTS = $(shell ls -S `find test -type f -name "*.test.js" -print`)
TIMEOUT = 5000
MOCHA_OPTS =
REPORTER = tap
PROJECT_DIR = $(shell pwd)
JSCOVERAGE = ./node_modules/jscover/bin/jscover
#NPM_REGISTRY = --registry=http://registry.npm.taobao.net
NPM_INSTALL_PRODUCTION = PYTHON=`which python2.6` NODE_ENV=production npm install $(NPM_REGISTRY)
NPM_INSTALL_TEST = PYTHON=`which python2.6` NODE_ENV=test npm install $(NPM_REGISTRY)
install:
@$(NPM_INSTALL_PRODUCTION)
install-test: check
@$(NPM_INSTALL_TEST)
test: install-test
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) --timeout $(TIMEOUT) $(MOCHA_OPTS) $(TESTS)
lib-cov:
@rm -rf $@
@$(JSCOVERAGE) --exclude=lib/translate.js lib $@
@cp -rf ./lib/translate.js ./lib-cov/translate.js
test-cov: lib-cov
@PUSHWECHAT_COV=1 $(MAKE) test REPORTER=dot
@PUSHWECHAT_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
clean:
@rm -f coverage.html
.PHONY: install install-test test test-cov lib-cov clean toast check