Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 48 lines (31 sloc) 1.043 kb
5baadc9 @chakrit Initial implementation
authored
1
2 BIN = ./node_modules/.bin
3
4 TEST_OPTS = --timeout 100 --reporter list --globals __coverage__ --compilers coffee:coffee-script
5 COFFEE_OPTS = --bare --compile
6 ISTANBUL_OPTS = instrument --variable global.__coverage__ --no-compact
7
8 SRC_FILES := $(wildcard src/*.coffee)
9 LIB_FILES := $(SRC_FILES:src/%.coffee=lib/%.js)
10 TEST_FILES = test/*.coffee
11 COV_FILES := $(LIB_FILES:lib/%.js=lib-cov/%.js)
12
13
14 default: test
15
16 lib/%.js: src/%.coffee
17 $(BIN)/coffee $(COFFEE_OPTS) --output $(@D) $<
18
19 lib-cov/%.js: lib/%.js
20 mkdir -p ./lib-cov
21 $(BIN)/istanbul $(ISTANBUL_OPTS) --output $@ $<
22
23
24 all: $(LIB_FILES)
25
26 publish: clean all
27 npm publish
28
29 test:
30 $(BIN)/mocha $(TEST_OPTS) $(TEST_FILES)
31 tdd:
32 $(BIN)/mocha $(TEST_OPTS) --watch $(TEST_FILES)
33
34 instrument: $(COV_FILES)
35 cover: instrument
36 COVER=1 $(BIN)/mocha $(TEST_OPTS) --reporter mocha-istanbul $(TEST_FILES)
37 @echo open html-report/index.html to view coverage report.
38
39
40 clean:
41 rm -Rf html-report
42 rm -Rf coverage
43 rm -Rf lib-cov
44 rm -Rf lib
45
46 .PHONY: instrument all default test watch cover clean lib-cov
47
Something went wrong with that request. Please try again.