[Pkg-javascript-commits] [pdf.js] 52/157: Add --downloadOnly flag to test.js

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 06:46:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit c7a5da332cf8ff948495993639fa4cc4227817a1
Author: Rob Wu <rob at robwu.nl>
Date:   Mon Jul 6 17:17:11 2015 +0200

    Add --downloadOnly flag to test.js
---
 test/test.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/test/test.js b/test/test.js
index 8430412..f82a53d 100644
--- a/test/test.js
+++ b/test/test.js
@@ -38,7 +38,7 @@ function parseOptions() {
   var yargs = require('yargs')
     .usage('Usage: $0')
     .boolean(['help', 'masterMode', 'reftest', 'unitTest', 'fontTest',
-              'noPrompts', 'noDownload'])
+              'noPrompts', 'noDownload', 'downloadOnly'])
     .string(['manifestFile', 'browser', 'browserManifestFile',
              'port', 'statsFile', 'statsDelay'])
     .alias('browser', 'b').alias('help', 'h').alias('masterMode', 'm')
@@ -59,6 +59,7 @@ function parseOptions() {
     .describe('unitTest', 'Run the unit tests.')
     .describe('fontTest', 'Run the font tests.')
     .describe('noDownload', 'Skips test PDFs downloading.')
+    .describe('downloadOnly', 'Download test PDFs without running the tests.')
     .describe('statsFile', 'The file where to store stats.')
     .describe('statsDelay', 'The amount of time in milliseconds the browser ' +
       'should wait before starting stats.')
@@ -69,6 +70,9 @@ function parseOptions() {
     }, '--reftest, --unitTest, --fontTest and --masterMode must not be ' +
       'specified at the same time.'))
     .check(describeCheck(function (argv) {
+      return !argv.noDownload || !argv.downloadOnly;
+    }, '--noDownload and --downloadOnly cannot be used together.'))
+    .check(describeCheck(function (argv) {
       return !argv.masterMode || argv.manifestFile === 'test_manifest.json';
     }, 'when --masterMode is specified --manifestFile shall be equal ' +
       'test_manifest.json'))
@@ -692,7 +696,9 @@ function main() {
     stats = [];
   }
 
-  if (!options.browser && !options.browserManifestFile) {
+  if (options.downloadOnly) {
+    ensurePDFsDownloaded(function() {});
+  } else if (!options.browser && !options.browserManifestFile) {
     startServer();
   } else if (options.unitTest) {
     startUnitTest('/test/unit/unit_test.html', 'unit');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list