2010-12-15 08:50:18 +08:00
|
|
|
SHELL := /bin/bash
|
|
|
|
|
|
|
|
user=postgres
|
|
|
|
password=1234
|
|
|
|
host=localhost
|
|
|
|
port=5432
|
|
|
|
database=postgres
|
2010-12-20 04:46:43 +08:00
|
|
|
verbose=false
|
2010-12-15 08:50:18 +08:00
|
|
|
|
2010-12-25 10:09:55 +08:00
|
|
|
params := -u $(user) --password $(password) -p $(port) -d $(database) -h $(host) --verbose $(verbose)
|
|
|
|
|
2010-12-25 10:22:15 +08:00
|
|
|
node-command := xargs -n 1 -I file node file $(params)
|
2010-12-15 08:50:18 +08:00
|
|
|
|
2011-02-23 12:51:30 +08:00
|
|
|
.PHONY : test test-connection test-integration bench test-libpg build
|
2010-12-25 10:22:15 +08:00
|
|
|
test: test-unit
|
2010-12-15 08:50:18 +08:00
|
|
|
|
|
|
|
test-all: test-unit test-integration
|
|
|
|
|
2010-12-31 11:26:23 +08:00
|
|
|
bench:
|
|
|
|
@find benchmark -name "*-bench.js" | $(node-command)
|
|
|
|
|
2011-02-23 12:51:30 +08:00
|
|
|
build:
|
|
|
|
@node-waf configure build
|
|
|
|
|
2010-12-25 10:22:15 +08:00
|
|
|
test-unit:
|
|
|
|
@find test/unit -name "*-tests.js" | $(node-command)
|
|
|
|
|
|
|
|
test-connection:
|
|
|
|
@node script/test-connection.js $(params)
|
|
|
|
|
2011-02-23 12:51:30 +08:00
|
|
|
test-libpg: build test-unit
|
2011-02-23 12:48:51 +08:00
|
|
|
@find test/integration/client -name "*-tests.js" | $(node-command) --libpg true
|
|
|
|
|
2010-12-25 10:22:15 +08:00
|
|
|
test-integration: test-connection
|
|
|
|
@find test/integration -name "*-tests.js" | $(node-command)
|