jsdoc/lib/rhino-shim.js
Jannon 2d73440b3d Testing Framework Upgrade Part I
This first part of the testing framework upgrade:

- enhances the jsdoc script to allow switching to debug mode from the command line
- uses Jasmine to run tests
- adds flexibility to run tests from multiple root directories
- does automatic test discovery, so test files can just be created, dropped in an appropriate folder, and run without having to explicity add it to the test runner
- cleans up the test directory layout
- incorporates env.rhino.js which should make it easier to test templates
- is incomplete: this is just a savepoint.  About 1/3 of the tests have been converted.  The rest are still run through the old testrunner
2012-04-30 17:39:50 -07:00

36 lines
886 B
JavaScript

/**
@overview A minimal emulation of the standard features of nodejs necessary
to get jsdoc to run.
*/
/**
Emulate nodejs console functions.
@see http://nodejs.org/docs/v0.4.8/api/stdio.html
*/
console = {
log: function(/*...*/) {
var args = Array.prototype.slice.call(arguments, 0),
dumper = dumper || require('jsdoc/util/dumper');
for (var i = 0, len = args.length; i < len; i++) {
if (typeof args[i] !== 'string') {
args[i] = dumper.dump(args[i]);
}
}
print( args.join(' ') );
}
};
/**
Emulate nodejs process functions.
@see http://nodejs.org/docs/v0.4.8/api/process.html
*/
process = {
exit: function(n) {
n = n || 0;
java.lang.System.exit(n);
},
argv: [__dirname + '/jsdoc.js'].concat(Array.prototype.slice.call(arguments, 0))
};