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