2010-12-15 08:50:18 +08:00
|
|
|
SHELL := /bin/bash
|
|
|
|
|
2012-07-31 10:57:28 +08:00
|
|
|
connectionString=pg://
|
2010-12-15 08:50:18 +08:00
|
|
|
|
2012-05-31 11:12:14 +08:00
|
|
|
params := $(connectionString)
|
2010-12-25 10:09:55 +08:00
|
|
|
|
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-03-07 12:27:35 +08:00
|
|
|
.PHONY : test test-connection test-integration bench test-native build/default/binding.node
|
2012-07-31 10:57:28 +08:00
|
|
|
|
|
|
|
help:
|
|
|
|
echo "make test-all connectionString=pg://<your connection string>"
|
|
|
|
|
2010-12-25 10:22:15 +08:00
|
|
|
test: test-unit
|
2010-12-15 08:50:18 +08:00
|
|
|
|
2011-11-22 11:59:54 +08:00
|
|
|
test-all: test-unit test-integration test-native test-binary
|
2010-12-15 08:50:18 +08:00
|
|
|
|
2010-12-31 11:26:23 +08:00
|
|
|
bench:
|
|
|
|
@find benchmark -name "*-bench.js" | $(node-command)
|
|
|
|
|
2011-03-07 12:27:35 +08:00
|
|
|
build/default/binding.node:
|
2012-06-19 11:41:48 +08:00
|
|
|
@node-gyp rebuild
|
2011-02-23 12:51:30 +08:00
|
|
|
|
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-11-22 11:59:54 +08:00
|
|
|
test-connection-binary:
|
2012-05-31 11:12:14 +08:00
|
|
|
@node script/test-connection.js $(params) binary
|
2011-11-22 11:59:54 +08:00
|
|
|
|
2011-03-05 23:51:47 +08:00
|
|
|
test-native: build/default/binding.node
|
2011-03-06 01:31:59 +08:00
|
|
|
@echo "***Testing native bindings***"
|
2011-02-24 10:19:27 +08:00
|
|
|
@find test/native -name "*-tests.js" | $(node-command)
|
2012-05-31 11:12:14 +08:00
|
|
|
@find test/integration -name "*-tests.js" | $(node-command) native
|
2011-02-23 12:48:51 +08:00
|
|
|
|
2010-12-25 10:22:15 +08:00
|
|
|
test-integration: test-connection
|
2011-03-06 01:31:59 +08:00
|
|
|
@echo "***Testing Pure Javascript***"
|
2010-12-25 10:22:15 +08:00
|
|
|
@find test/integration -name "*-tests.js" | $(node-command)
|
2011-11-22 11:59:54 +08:00
|
|
|
|
|
|
|
test-binary: test-connection-binary
|
|
|
|
@echo "***Testing Pure Javascript (binary)***"
|
2012-05-31 11:12:14 +08:00
|
|
|
@find test/integration -name "*-tests.js" | $(node-command) binary
|