forked from kissjs/node-mongoskin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (37 loc) · 1.16 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
TESTS = test/
TESTTIMEOUT = 60000
REPORTER = spec
MOCHA_OPTS =
PROJECT_DIR = $(shell pwd)
MONGOSKIN_REPLICASET = false
SUPPORT_VERSIONS := \
1.0.0 1.0.1 1.0.2 \
1.1.0-beta 1.1.1 1.1.2 1.1.3 1.1.4
test:
@npm install
@if ! test -d deps/mongodb; then \
git clone git://github.com/mongodb/node-mongodb-native.git deps/mongodb; \
fi
@cd deps/mongodb && npm install && git pull && cd ../..
@NODE_ENV=test MONGOSKIN_REPLICASET=$(MONGOSKIN_REPLICASET) \
./node_modules/mocha/bin/mocha --recursive \
--reporter $(REPORTER) --timeout $(TESTTIMEOUT) \
$(MOCHA_OPTS) $(TESTS)
test-debug:
@$(MAKE) test MOCHA_OPTS="--debug-brk"
test-replicaset:
@$(MAKE) test MONGOSKIN_REPLICASET=true
lib-cov:
@rm -rf ./$@
@jscoverage --encoding=utf-8 ./lib ./$@
test-cov: lib-cov
@MONGOSKIN_COV=1 $(MAKE) test REPORTER=progress
@MONGOSKIN_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
@$(MAKE) test REPORTER=markdown > test_results.md
test-version:
@for version in $(SUPPORT_VERSIONS); do \
echo "test with mongodb@$$version"; \
npm install mongodb@$$version --loglevel=warn; \
$(MAKE) test REPORTER=progress; \
done
.PHONY: test-replicaset test-version test-cov test lib-cov