]> git.parisson.com Git - pdf.js.git/commitdiff
add command line arguments for the shell, -e for echo tests, -p for parse tests
authorAndreas Gal <andreas.gal@gmail.com>
Fri, 6 May 2011 08:44:17 +0000 (01:44 -0700)
committerAndreas Gal <andreas.gal@gmail.com>
Fri, 6 May 2011 08:44:17 +0000 (01:44 -0700)
pdf.js

diff --git a/pdf.js b/pdf.js
index 0f23ab777aafe3a8f258703c7064e0e17689cb93..36a09d9bc98adcb5cf8c74eceb2f30420a4dab0d 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -1101,13 +1101,6 @@ var CanvasGraphics = (function() {
 //var PostscriptGraphics
 //var SVGGraphics
 
-// XXX temporary testing code
-var inJSShell = false;
-try {
-    putstr("");
-    inJSShell = true;
-} catch (e) { }
-
 var MockParser = (function() {
     function constructor(objs) {
         this.objs = objs.slice(0);
@@ -1231,5 +1224,17 @@ function runEchoTests() {
     });
 }
 
-if (inJSShell)
-    runEchoTests();
+function runParseTests() {
+}
+
+if ("arguments" in this) {
+    const cmds = {
+        "-e": runEchoTests,
+        "-p": runParseTests
+    }
+    for (n in arguments) {
+        var fn = cmds[arguments[n]];
+        if (fn)
+            fn();
+    }
+}