Skip to content

Commit

Permalink
Merge pull request #6181 from Rob--W/test-downloadOnly
Browse files Browse the repository at this point in the history
Add --downloadOnly flag to test.js
  • Loading branch information
timvandermeij committed Jul 6, 2015
2 parents 8e59528 + c7a5da3 commit 31976b9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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.')
Expand All @@ -68,6 +69,9 @@ function parseOptions() {
argv.masterMode <= 1;
}, '--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 ' +
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 31976b9

Please sign in to comment.