indent phandom files
[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 PHANTOMJS_URL=  https://mkws-dev.indexdata.com/jasmine-popup.html       
8 PHANTOMJS_TIMEOUT=      8
9
10 all: check
11
12 clean:
13         rm -f mkws-error.png
14
15 distclean: clean
16         rm -rf node_modules
17
18 mkws-complete-syntax-check:
19         ${MAKE} -C../tools/htdocs $@
20
21 check: mkws-complete-syntax-check
22         @if [ ! -e node_modules ]; then echo "please run first: make node-modules"; exit 1; fi 
23         jasmine-node --noColor --captureExceptions --forceexit ./spec
24         jasmine-node --noColor --captureExceptions --forceexit ./spec-sp
25
26 test: check
27
28 terse:
29         $(MIKE) jasmine-node --noColor --captureExceptions --forceexit spec
30
31 phantomjs:
32         ${PHANTOMJS} phantom/evaluate.js ${PHANTOMJS_URL} ${PHANTOMJS_TIMEOUT}
33
34 jsbeautifier jsb indent:
35         for i in ./spec*/*.js ./js/*.js ./phantom/*.js; do \
36           jsbeautifier -j $$i > $@.tmp && mv -f $@.tmp $$i; \
37         done
38
39 node-modules: node_modules
40 node_modules:
41         npm install ${NPM_INSTALL_FLAGS} jQuery xmlhttprequest jsdom request jasmine-node phantomjs
42
43 help:
44         @echo "make [ all | check | phantomjs | clean | distclean ]"
45         @echo "     [ jsbeautifier | node-modules ]"