Skip to content

Commit

Permalink
added a Makefile for running tests and installing or uninstalling the…
Browse files Browse the repository at this point in the history
… command-line tool
  • Loading branch information
Caolan McMahon committed Sep 18, 2010
1 parent 24a92b6 commit e144ede
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 17 deletions.
14 changes: 14 additions & 0 deletions Makefile
@@ -0,0 +1,14 @@
PREFIX ?= /usr/local

test:
./bin/nodeunit test

install:
cp -r ./ $(PREFIX)/lib/nodeunit
ln -s $(PREFIX)/lib/nodeunit/bin/nodeunit $(PREFIX)/bin/nodeunit

uninstall:
rm -rf $(PREFIX)/lib/nodeunit
rm -f $(PREFIX)/bin/nodeunit

.PHONY: test install uninstall
24 changes: 22 additions & 2 deletions README.md
Expand Up @@ -248,6 +248,26 @@ However, the module test-base.js first does some basic tests using the assert
module to ensure that test functions are actually run, and a basic level of
nodeunit functionality is available.

To run the nodeunit tests do: node test.js
To run the nodeunit tests do:

make test

__Note:__ The tests hang when using node v0.2.0, upgrading to v0.2.1 fixes this.
__Note:__ There was a bug in node v0.2.0 causing the tests to hang, upgrading
to v0.2.1 fixes this.


Installing the command-line tool
--------------------------------

If you have installed nodeunit via npm, the command line tool should already be
available. Otherwise you can do:

make install

to install nodeunit to /usr/local. You can then use nodeunit on the command-line:

nodeunit PATH

To uninstall nodeunit, do:

make uninstall
11 changes: 3 additions & 8 deletions bin/nodeunit
@@ -1,8 +1,3 @@
#!/usr/bin/env node

var path = require('path');
var fs = require('fs');
var lib = path.join(__dirname, '../lib');

var testrunner = require(lib + '/testrunner.js');
testrunner.run(process.argv.slice(2));
#!/bin/sh
REALPATH=`readlink -f $0`
node `dirname $REALPATH`/../lib/testrunner.js $@
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -13,5 +13,5 @@
, "url" : "http://github.com/caolan/nodeunit/raw/master/LICENSE"
}
]
, "bin" : { "nodeunit" : "./bin/nodeunit" }
, "bin" : { "nodeunit" : "./lib/testrunner" }
}
6 changes: 0 additions & 6 deletions test.js

This file was deleted.

0 comments on commit e144ede

Please sign in to comment.