node-postgres/Makefile

74 lines
1.9 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 \
2013-06-04 00:42:49 +08:00
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
2013-04-22 18:52:41 +08:00
test-travis: test-all upgrade-pg
2013-11-21 13:01:31 +08:00
#@make test-all connectionString=postgres://postgres@localhost:5433/postgres
2013-04-22 18:18:13 +08:00
upgrade-pg:
2013-11-21 13:01:31 +08:00
#@chmod 755 script/travis-pg-9.2-install.sh
#@./script/travis-pg-9.2-install.sh
2013-04-22 18:18:13 +08:00
2010-12-31 11:26:23 +08:00
bench:
@find benchmark -name "*-bench.js" | $(node-command)
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:
@echo "***Testing connection***"
2010-12-25 10:22:15 +08:00
@node script/test-connection.js $(params)
test-connection-binary:
@echo "***Testing binary connection***"
2012-05-31 11:12:14 +08:00
@node script/test-connection.js $(params) binary
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***"
@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
test-integration: test-connection build/default/binding.node
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-binary
@echo "***Testing Pure Javascript (binary)***"
2012-05-31 11:12:14 +08:00
@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
2013-06-04 00:42:49 +08:00
publish:
@rm -r build || (exit 0)
@npm publish