File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ PACKAGE = libgit2
2+ NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true") ,nodejs,node)
3+
4+ unittest :
5+ $(NODEJS ) ./test/index.js test
Original file line number Diff line number Diff line change @@ -19,6 +19,19 @@ framework installed.
1919Unit testing
2020------------
2121
22+ ##### New way #####
23+ Ensure the submodules ` nodeunit ` and ` rimraf ` are located in the ` /vendor ` subdirectory. If they are not, run:
24+ git submodule init
25+ git submodule update
26+
27+ Then simply run ` make unittest ` in the project root.
28+
29+ Example of new method:
30+ [ tim@thinkpad Projects] $ cd node-libgit2
31+ [ tim@thinkpad node-libgit2] $ node-waf configure build
32+ [ tim@thinkpad node-libgit2] $ make unittest
33+
34+ ##### Old way #####
2235node-libgit2 utilizes nodeunit ` npm install nodeunit ` or use ` /vendor/nodeunit ` to handle its tests in the
2336` /test ` folder. Example of running repo tests with vendor script:
2437 [ tim@thinkpad Projects] $ cd node-libgit2
Original file line number Diff line number Diff line change 1- require ( './test-repo.js' ) ;
1+ #!/usr/bin/env node
2+
3+ require . paths . unshift ( '../vendor' ) ;
4+
5+ try {
6+ var reporter = require ( '../vendor/nodeunit' ) . reporters . default ;
7+ }
8+ catch ( e ) {
9+ var sys = require ( 'sys' ) ;
10+ sys . puts ( "Cannot find nodeunit module." ) ;
11+ sys . puts ( "You can download submodules for this project by doing:" ) ;
12+ sys . puts ( "" ) ;
13+ sys . puts ( " git submodule init" ) ;
14+ sys . puts ( " git submodule update" ) ;
15+ sys . puts ( "" ) ;
16+ process . exit ( ) ;
17+ }
18+
19+ process . chdir ( './' ) ;
20+ reporter . run ( [ 'test' ] ) ;
You can’t perform that action at this time.
0 commit comments