add command line arguments for the shell, -e for echo tests, -p for parse tests
This commit is contained in:
parent
455c646206
commit
4a5794e705
23
pdf.js
23
pdf.js
@ -1101,13 +1101,6 @@ var CanvasGraphics = (function() {
|
|||||||
//var PostscriptGraphics
|
//var PostscriptGraphics
|
||||||
//var SVGGraphics
|
//var SVGGraphics
|
||||||
|
|
||||||
// XXX temporary testing code
|
|
||||||
var inJSShell = false;
|
|
||||||
try {
|
|
||||||
putstr("");
|
|
||||||
inJSShell = true;
|
|
||||||
} catch (e) { }
|
|
||||||
|
|
||||||
var MockParser = (function() {
|
var MockParser = (function() {
|
||||||
function constructor(objs) {
|
function constructor(objs) {
|
||||||
this.objs = objs.slice(0);
|
this.objs = objs.slice(0);
|
||||||
@ -1231,5 +1224,17 @@ function runEchoTests() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inJSShell)
|
function runParseTests() {
|
||||||
runEchoTests();
|
}
|
||||||
|
|
||||||
|
if ("arguments" in this) {
|
||||||
|
const cmds = {
|
||||||
|
"-e": runEchoTests,
|
||||||
|
"-p": runParseTests
|
||||||
|
}
|
||||||
|
for (n in arguments) {
|
||||||
|
var fn = cmds[arguments[n]];
|
||||||
|
if (fn)
|
||||||
|
fn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user