Skip to content
This repository
Browse code

added a Makefile for running tests and installing or uninstalling the…

… command-line tool
  • Loading branch information...
commit e144ede4ff5fa8f0f65be8b394398de03d52b034 1 parent 24a92b6
Caolan McMahon authored September 18, 2010
14  Makefile
... ...
@@ -0,0 +1,14 @@
  1
+PREFIX ?= /usr/local
  2
+
  3
+test:
  4
+	./bin/nodeunit test
  5
+
  6
+install:
  7
+	cp -r ./ $(PREFIX)/lib/nodeunit
  8
+	ln -s $(PREFIX)/lib/nodeunit/bin/nodeunit $(PREFIX)/bin/nodeunit
  9
+
  10
+uninstall:
  11
+	rm -rf $(PREFIX)/lib/nodeunit
  12
+	rm -f $(PREFIX)/bin/nodeunit
  13
+
  14
+.PHONY: test install uninstall
24  README.md
Source Rendered
@@ -248,6 +248,26 @@ However, the module test-base.js first does some basic tests using the assert
248 248
 module to ensure that test functions are actually run, and a basic level of
249 249
 nodeunit functionality is available.
250 250
 
251  
-To run the nodeunit tests do: node test.js
  251
+To run the nodeunit tests do:
  252
+    
  253
+    make test
252 254
 
253  
-__Note:__ The tests hang when using node v0.2.0, upgrading to v0.2.1 fixes this.
  255
+__Note:__ There was a bug in node v0.2.0 causing the tests to hang, upgrading
  256
+to v0.2.1 fixes this.
  257
+
  258
+
  259
+Installing the command-line tool
  260
+--------------------------------
  261
+
  262
+If you have installed nodeunit via npm, the command line tool should already be
  263
+available. Otherwise you can do:
  264
+
  265
+    make install
  266
+
  267
+to install nodeunit to /usr/local. You can then use nodeunit on the command-line:
  268
+
  269
+    nodeunit PATH
  270
+
  271
+To uninstall nodeunit, do:
  272
+
  273
+    make uninstall
11  bin/nodeunit
... ...
@@ -1,8 +1,3 @@
1  
-#!/usr/bin/env node
2  
-
3  
-var path = require('path');
4  
-var fs = require('fs');
5  
-var lib = path.join(__dirname, '../lib');
6  
-
7  
-var testrunner = require(lib + '/testrunner.js');
8  
-testrunner.run(process.argv.slice(2));
  1
+#!/bin/sh
  2
+REALPATH=`readlink -f $0`
  3
+node `dirname $REALPATH`/../lib/testrunner.js $@
2  package.json
@@ -13,5 +13,5 @@
13 13
     , "url" : "http://github.com/caolan/nodeunit/raw/master/LICENSE"
14 14
     }
15 15
   ]
16  
- , "bin" : { "nodeunit" : "./bin/nodeunit" }
  16
+ , "bin" : { "nodeunit" : "./lib/testrunner" }
17 17
 }
6  test.js
... ...
@@ -1,6 +0,0 @@
1  
-#!/usr/bin/env node
2  
-
3  
-var testrunner = require('./lib/nodeunit').testrunner;
4  
-
5  
-process.chdir(__dirname);
6  
-testrunner.run(['test']);

0 notes on commit e144ede

Please sign in to comment.
Something went wrong with that request. Please try again.