You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
node-postgres/Makefile

71 lines
1.8 KiB

SHELL := /bin/bash
connectionString=pg://
params := $(connectionString)
14 years ago
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
help:
@echo "make prepare-test-db [connectionString=pg://<your connection string>]"
@echo "make test-all [connectionString=pg://<your connection string>]"
14 years ago
test: test-unit
test-all: jshint test-unit test-integration test-native test-binary
test-travis: test-all upgrade-pg
@make test-all connectionString=pg://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
14 years ago
test-unit:
@find test/unit -name "*-tests.js" | $(node-command)
test-connection:
@echo "***Testing connection***"
14 years ago
@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
14 years ago
@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
14 years ago
@echo "***Testing Pure Javascript***"
14 years ago
@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