2010-03-19 06:13:27 +08:00
|
|
|
#
|
|
|
|
# Run all tests
|
|
|
|
#
|
2011-01-26 06:37:55 +08:00
|
|
|
|
2012-05-03 00:56:38 +08:00
|
|
|
expresso = ./node_modules/.bin/mocha
|
2014-12-17 21:35:42 +08:00
|
|
|
UGLIFYJS=./node_modules/.bin/uglifyjs
|
2014-12-04 23:29:20 +08:00
|
|
|
BROWSERIFY = ./node_modules/.bin/browserify
|
2011-05-03 23:12:36 +08:00
|
|
|
|
2015-01-19 21:29:11 +08:00
|
|
|
dist/carto.js: dist/carto.uncompressed.js $(shell $(BROWSERIFY) --list lib/carto/index.js)
|
|
|
|
$(UGLIFYJS) dist/carto.uncompressed.js > $@
|
|
|
|
|
|
|
|
dist/carto.uncompressed.js: dist $(shell $(BROWSERIFY) --list lib/carto/index.js)
|
|
|
|
$(BROWSERIFY) lib/carto/index.js --exclude node_modules/underscore/underscore.js --standalone carto > $@
|
|
|
|
|
|
|
|
|
2011-05-11 05:20:41 +08:00
|
|
|
lint:
|
|
|
|
./node_modules/.bin/jshint lib/carto/*.js lib/carto/tree/*.js
|
|
|
|
|
2011-01-26 06:37:55 +08:00
|
|
|
ifndef only
|
|
|
|
test:
|
2012-05-03 00:56:38 +08:00
|
|
|
@NODE_PATH=./lib:$NODE_PATH $(expresso) -R spec -I lib test/*.test.js
|
2011-01-26 06:37:55 +08:00
|
|
|
else
|
2011-01-20 01:16:50 +08:00
|
|
|
test:
|
2012-05-03 00:56:38 +08:00
|
|
|
@NODE_PATH=./lib:$NODE_PATH $(expresso) -R spec -I lib test/${only}.test.js
|
2011-01-26 06:37:55 +08:00
|
|
|
endif
|
2011-01-26 06:10:47 +08:00
|
|
|
|
2012-06-22 17:55:59 +08:00
|
|
|
check: test
|
|
|
|
|
2014-12-04 23:29:20 +08:00
|
|
|
dist:
|
|
|
|
mkdir -p dist
|
|
|
|
|
2014-12-17 21:35:42 +08:00
|
|
|
|
|
|
|
|
2014-12-04 23:29:20 +08:00
|
|
|
|
2011-01-26 06:10:47 +08:00
|
|
|
.PHONY: test
|