From edea8967d27692c8fa22766e60cc1ceb0ddd294a Mon Sep 17 00:00:00 2001 From: brianc Date: Tue, 22 Feb 2011 22:48:51 -0600 Subject: [PATCH] stage up the ability to run libpg based client integration tests --- Makefile | 3 +++ test/cli.js | 2 ++ test/test-helper.js | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e9c4cc0e..98f4dd31 100644 --- a/Makefile +++ b/Makefile @@ -25,5 +25,8 @@ test-unit: test-connection: @node script/test-connection.js $(params) +test-libpg: test-unit + @find test/integration/client -name "*-tests.js" | $(node-command) --libpg true + test-integration: test-connection @find test/integration -name "*-tests.js" | $(node-command) diff --git a/test/cli.js b/test/cli.js index 99490b16..3b3700ae 100644 --- a/test/cli.js +++ b/test/cli.js @@ -38,6 +38,8 @@ for(var i = 0; i < args.length; i++) { case '-t': case '--test': config.test = args[++i]; + case '--libpg': + config.libpg = (args[++i] == "true"); default: break; } diff --git a/test/test-helper.js b/test/test-helper.js index 0250dfc4..62511698 100644 --- a/test/test-helper.js +++ b/test/test-helper.js @@ -1,6 +1,5 @@ require.paths.unshift(__dirname + '/../lib/'); -Client = require('client'); EventEmitter = require('events').EventEmitter; sys = require('sys'); @@ -10,6 +9,12 @@ buffers = require(__dirname + '/test-buffers'); Connection = require('connection'); var args = require(__dirname + '/cli'); +if(args.libpg) { +} else { + Client = require('client'); +} + + process.on('uncaughtException', function(d) { if ('stack' in d && 'message' in d) { console.log("Message: " + d.message);