node-postgres/Makefile

64 lines
1.6 KiB
Makefile
Raw Normal View History

SHELL := /bin/sh
connectionString=postgres://
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)
.PHONY : test test-connection test-integration bench test-native \
2014-11-19 00:51:40 +08:00
jshint publish test-missing-native update-npm
all:
npm install
help:
@echo "make test-all [connectionString=postgres://<your connection string>]"
test: test-unit
test-all: jshint test-missing-native test-unit test-integration test-native test-binary
2013-04-22 18:18:13 +08:00
2015-08-03 02:43:50 +08:00
update-npm:
2014-11-19 00:51:40 +08:00
@npm i npm --global
2013-04-22 18:18:13 +08:00
2010-12-31 11:26:23 +08:00
bench:
@find benchmark -name "*-bench.js" | $(node-command)
2010-12-25 10:22:15 +08:00
test-unit:
@find test/unit -name "*-tests.js" | $(node-command)
test-connection:
@echo "***Testing connection***"
@node script/create-test-tables.js $(params)
test-missing-native:
@echo "***Testing optional native install***"
@rm -rf node_modules/pg-native
@node test/native/missing-native.js
@rm -rf node_modules/pg-native
node_modules/pg-native/index.js:
@npm i pg-native
test-native: node_modules/pg-native/index.js test-connection
2011-03-06 01:31:59 +08:00
@echo "***Testing native bindings***"
@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
2014-09-14 13:23:02 +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)
test-binary: test-connection
@echo "***Testing Pure Javascript (binary)***"
2012-05-31 11:12:14 +08:00
@find test/integration -name "*-tests.js" | $(node-command) binary
test-pool:
@find test/integration/connection-pool -name "*.js" | $(node-command) binary
jshint:
@echo "***Starting jshint***"
@./node_modules/.bin/jshint lib