check for node modules, and warn before failing
[mkws-moved-to-github.git] / test / Makefile
1 # Copyright (c) 2013 IndexData ApS. http://indexdata.com
2
3 # For running on Mike's local install of node.js
4 MIKE = PATH=$$PATH:/usr/local/lib/node-v0.10.24-linux-x64/bin
5 NPM_INSTALL_FLAGS=-q
6 PHANTOMJS=      ./node_modules/phantomjs/bin/phantomjs
7
8 all: check
9
10 clean:
11         rm -f mkws-error.png
12
13 distclean: clean
14         rm -rf node_modules
15
16 mkws-complete-syntax-check:
17         ${MAKE} -C../tools/htdocs $@
18
19 check: mkws-complete-syntax-check
20         @if [ ! -e node_modules ]; then echo "please run first: make node-modules"; exit 1; fi 
21         jasmine-node --noColor --captureExceptions --forceexit ./spec
22         jasmine-node --noColor --captureExceptions --forceexit ./spec-sp
23
24 test: check
25
26 terse:
27         $(MIKE) jasmine-node --noColor --captureExceptions --forceexit spec
28
29 phantomjs:
30         @# ${PHANTOMJS} phantom/evaluate.js https://mkws-dev.indexdata.com/jasmine-local-popup.html     
31         ${PHANTOMJS} phantom/evaluate.js https://mkws-dev.indexdata.com/jasmine-popup.html      
32
33 jsbeautifier jsb indent:
34         for i in ./spec*/*.js ./js/*.js; do \
35           jsbeautifier -j $$i > $@.tmp && mv -f $@.tmp $$i; \
36         done
37
38 node-modules: node_modules
39 node_modules:
40         npm install ${NPM_INSTALL_FLAGS} jQuery xmlhttprequest jsdom request jasmine-node phantomjs
41
42 help:
43         @echo "make [ all | check | phantomjs | clean | distclean ]"
44         @echo "     [ jsbeautifier | node-modules ]"