Skip to content

Commit

Permalink
added nodeunit and 1 test
Browse files Browse the repository at this point in the history
  • Loading branch information
xdenser committed Dec 16, 2010
1 parent b8d642d commit 862af26
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "tools/nodeunit"]
path = tools/nodeunit
url = git://github.com/caolan/nodeunit.git
15 changes: 14 additions & 1 deletion package.json
@@ -1,7 +1,20 @@
{ "name" : "firebird"
, "version" : "0.0.1"
, "description" : "very basic libfbclient binding to node"
, "author": "Denys Khanzhiyev aka XDenSer"
, "author": "Denys Khanzhiyev"
, "main": "./firebird"
, "scripts": { "install": "node-waf configure build" }
, "maintainers" :
[ { "name": "Denys Khanzhiyev"
, "email": "xdenser@gmail.com"
}
]
, "bugs" : { "web" : "http://github.com/xdenser/node-firebird-libfbclient/issues" }
, "licenses" : [ { "type" : "MIT" } ]
, "repositories" :
[ { "type" : "git"
, "url" : "http://github.com/xdenser/node-firebird-libfbclient.git"
}
]

}
14 changes: 14 additions & 0 deletions tests/config.js
@@ -0,0 +1,14 @@
/*
Copyright by Denys Khanzhiyev
See license text in LICENSE file
*/

exports.cfg = {
// Database connection settings
db: "test.fdb",
user: "sysdba",
password: "masterkey",
role: ""
};

19 changes: 19 additions & 0 deletions tests/def/test-binding.js
@@ -0,0 +1,19 @@
/*
Copyright by Denys Khanzhiyev
See license text in LICENSE file
*/

// Load configuration
var cfg = require("../config").cfg;

// Require modules
var
fb_binding = require("../../build/default/binding");

exports.Connect = function (test) {
test.expect(1);
var conn = new fb_binding.Connection;
test.ok(conn, "Connection inited");
test.done();
};

1 change: 1 addition & 0 deletions tools/nodeunit
Submodule nodeunit added at 8a31df
10 changes: 9 additions & 1 deletion wscript
@@ -1,4 +1,4 @@
import Options
import Options, Utils
from os import unlink, symlink, popen
from os.path import exists

Expand Down Expand Up @@ -26,3 +26,11 @@ def build(bld):
obj.source = "binding.cc"
obj.uselib = "FB"

def test(tst):
node_binary = 'node'

if not exists('./tools/nodeunit/bin/nodeunit'):
print("\033[31mNodeunit doesn't exists.\033[39m\nYou should run `git submodule update --init` before run tests.")
exit(1)
else:
Utils.exec_command(node_binary + ' ./tools/nodeunit/bin/nodeunit tests/def')

0 comments on commit 862af26

Please sign in to comment.