Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 106 lines (80 sloc) 2.407 kB
00690e7 @lancejpollard better test setup
lancejpollard authored
1 SRC = $(shell find test/cases -name client -prune -o -name '*Test.coffee' -print)
8896d38 @lancejpollard Makefile for running tests on a per-database level
lancejpollard authored
2 STORES = memory mongodb
b0e670b @lancejpollard set default store
lancejpollard authored
3 CMD = ./node_modules/mocha/bin/mocha
4d9bcdc @lancejpollard ROADMAP and some makefile ideas
lancejpollard authored
4 DIR = $(shell pwd)
b30a495 @lancejpollard client tests on travis
lancejpollard authored
5 GRUNT = grunt
6 FOREVER = forever
e0eca36 @lancejpollard test browsers, and close if successful
lancejpollard authored
7 TEST_URL = http://localhost:3210/?test=support,application,store,model
8896d38 @lancejpollard Makefile for running tests on a per-database level
lancejpollard authored
8
b30a495 @lancejpollard client tests on travis
lancejpollard authored
9 # @todo make this into a method
10 #define checkmodule
11 #endef
12 #
13 #check-grunt:
14 # $(call checkmodule,grunt,./node_modules/grunt/bin/grunt)
15
16 check-grunt:
17 ifeq ($(shell which $(GRUNT)),)
7fad24c @lancejpollard absolute path to grunt in makefile
lancejpollard authored
18 $(eval GRUNT = $(shell pwd)/node_modules/grunt/bin/grunt)
b30a495 @lancejpollard client tests on travis
lancejpollard authored
19 ifeq ($(shell which ./node_modules/grunt/bin/grunt),)
20 npm install grunt
21 endif
22 endif
23
24 check-forever:
25 ifeq ($(shell which $(FOREVER)),)
7fad24c @lancejpollard absolute path to grunt in makefile
lancejpollard authored
26 $(eval FOREVER = $(shell pwd)/node_modules/forever/bin/forever)
b30a495 @lancejpollard client tests on travis
lancejpollard authored
27 ifeq ($(shell which ./node_modules/forever/bin/forever),)
28 npm install forever
29 endif
30 endif
31
32 # ps -ef | awk '/node server -p 3210/{print $2}' | wc -l | awk '{print $1}'
33 # check-server: check-forever
8896d38 @lancejpollard Makefile for running tests on a per-database level
lancejpollard authored
34
b30a495 @lancejpollard client tests on travis
lancejpollard authored
35 check-phantomjs:
4d9bcdc @lancejpollard ROADMAP and some makefile ideas
lancejpollard authored
36 ifeq ($(shell which phantomjs),) # if it's blank
37 $(error PhantomJS is not installed. Download from http://phantomjs.org or run `brew install phantomjs` if you have Homebrew)
38 endif
39
b30a495 @lancejpollard client tests on travis
lancejpollard authored
40 test: test-memory test-mongodb
8896d38 @lancejpollard Makefile for running tests on a per-database level
lancejpollard authored
41
b0e670b @lancejpollard set default store
lancejpollard authored
42 test-memory:
43 $(CMD) $(SRC) --store memory
44
45 test-mongodb:
46 $(CMD) $(SRC) --store mongodb
47
53cb29e @lancejpollard primitive phantomjs integration
lancejpollard authored
48 test-client:
e0eca36 @lancejpollard test browsers, and close if successful
lancejpollard authored
49 phantomjs test/client.coffee $(TEST_URL)
4d9bcdc @lancejpollard ROADMAP and some makefile ideas
lancejpollard authored
50
b30a495 @lancejpollard client tests on travis
lancejpollard authored
51 setup-test-client: check-phantomjs check-grunt
ba11a85 @lancejpollard makefile
lancejpollard authored
52 # tmp way of downloading vendor files
53 rm -rf test/example/vendor
1fe9beb @lancejpollard ignore vendor files
lancejpollard authored
54 ./bin/tower new example
55 mv example/vendor test/example
56 rm -rf ./example
b30a495 @lancejpollard client tests on travis
lancejpollard authored
57 $(GRUNT) --config ./grunt.coffee
7bf9dd2 @lancejpollard test client app node_modules for travis
lancejpollard authored
58 cd test/example && pwd && npm install .
f52b90d @lancejpollard relative grunt
lancejpollard authored
59 $(GRUNT) --config ./test/example/grunt.coffee
b30a495 @lancejpollard client tests on travis
lancejpollard authored
60
61 start-test-client:
62 cd test/example && node server -p 3210
63
e0eca36 @lancejpollard test browsers, and close if successful
lancejpollard authored
64 define open-browser
65 open -a "$(1)" $(TEST_URL)\&complete=close
66 endef
67
68 test-firefox:
69 $(call open-browser,Firefox)
70
71 test-safari:
72 $(call open-browser,Safari)
73
74 test-chrome:
75 $(call open-browser,"Google\ Chrome")
76
77 test-opera:
78 $(call open-browser,Opera)
79
b30a495 @lancejpollard client tests on travis
lancejpollard authored
80 test-all:
81 for i in $(STORES); do ./node_modules/mocha/bin/mocha $(SRC) --store $$i; done
82
0c9a855 @lancejpollard compiles to lib
lancejpollard authored
83 clean:
84 rm -rf lib/*
85
86 whitespace:
87 cake clean
88
89 install:
7a3b21e @lancejpollard fine-tuned installation
lancejpollard authored
90 npm install
91 npm install-dev
0c9a855 @lancejpollard compiles to lib
lancejpollard authored
92
93 watch:
b30a495 @lancejpollard client tests on travis
lancejpollard authored
94 $(GRUNT) start --config ./grunt.coffee
0c9a855 @lancejpollard compiles to lib
lancejpollard authored
95
96 build:
b30a495 @lancejpollard client tests on travis
lancejpollard authored
97 $(GRUNT) build:client --config ./grunt.coffee
cc8f4cc @lancejpollard grunt task to publish client tower.js to github
lancejpollard authored
98
99 dist:
b30a495 @lancejpollard client tests on travis
lancejpollard authored
100 $(GRUNT) dist --config ./grunt.coffee
0c9a855 @lancejpollard compiles to lib
lancejpollard authored
101
102 publish:
103 npm publish
104
b30a495 @lancejpollard client tests on travis
lancejpollard authored
105 .PHONY: test-memory test-mongodb test test-all test-client build dist check-phantomjs check-grunt check-forever setup-test-client start-test-client
Something went wrong with that request. Please try again.