forked from Clouda-team/Cloudajs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (30 loc) · 996 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
34
35
36
37
38
39
TESTS = test/*.js
REPORTER = spec
TIMEOUT = 10000
MOCHA_OPTS =
G =
uname := $(shell uname)
#JSCOVERAGE = ./node_modules/jscover/bin/jscover
JSCOVERAGE = ./test/tools/jscoverage.exe
ifneq (,$(findstring Linux, $(uname)))
JSCOVERAGE = ./jscoverage-0.5.1/jscoverage
endif
test:
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) $(MOCHA_OPTS) \
$(TESTS)
test-g:
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) -g "$(G)" \
$(TESTS)
test-cov: sumeru-cov
@SUMERU_COV=1 $(MAKE) test REPORTER=dot
@SUMERU_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
@SUMERU_COV=1 $(MAKE) test REPORTER=mocha-lcov-reporter | sed "s/SF:/&sumeru-cov\//g" | COVERALLS_REPO_TOKEN="6ONbo8TZBkarcJTA3TPgdCaWXFHy7fUfY" ./node_modules/coveralls/bin/coveralls.js
@rm -rf sumeru-cov
sumeru-cov:
@rm -rf $@
@$(JSCOVERAGE) sumeru $@ --no-highlight --encoding=UTF-8
.PHONY: test test-g test-cov sumeru-cov