forked from brianc/node-postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (51 loc) · 1.87 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
SHELL := /bin/sh
connectionString=postgres://
params := $(connectionString)
node-command := xargs -n 1 -I file node file $(params)
.PHONY : test test-connection test-integration bench test-native \
build/default/binding.node jshint upgrade-pg publish
all:
npm install
build:
node-gyp rebuild
help:
@echo "make prepare-test-db [connectionString=postgres://<your connection string>]"
@echo "make test-all [connectionString=postgres://<your connection string>]"
test: test-unit
test-all: jshint test-unit test-integration test-native test-binary
test-travis: test-all upgrade-pg
@make test-all connectionString=postgres://postgres@localhost:5433/postgres
upgrade-pg:
@chmod 755 script/travis-pg-9.2-install.sh
@./script/travis-pg-9.2-install.sh
bench:
@find benchmark -name "*-bench.js" | $(node-command)
build/default/binding.node:
@node-gyp rebuild
test-unit:
@find test/unit -name "*-tests.js" | $(node-command)
test-connection:
@echo "***Testing connection***"
@node script/test-connection.js $(params)
test-connection-binary:
@echo "***Testing binary connection***"
@node script/test-connection.js $(params) binary
test-native: build/default/binding.node
@echo "***Testing native bindings***"
@find test/native -name "*-tests.js" | $(node-command)
@find test/integration -name "*-tests.js" | $(node-command) native
test-integration: test-connection build/default/binding.node
@echo "***Testing Pure Javascript***"
@find test/integration -name "*-tests.js" | $(node-command)
test-binary: test-connection-binary
@echo "***Testing Pure Javascript (binary)***"
@find test/integration -name "*-tests.js" | $(node-command) binary
prepare-test-db:
@echo "***Preparing the database for tests***"
@find script/create-test-tables.js | $(node-command)
jshint:
@echo "***Starting jshint***"
@./node_modules/.bin/jshint lib
publish:
@rm -r build || (exit 0)
@npm publish