Browse Source

Add gulp task to generate refs.

Brendan Dahl 8 years ago
parent
commit
8be4db1c34
  1. 53
      gulpfile.js

53
gulpfile.js

@ -332,6 +332,33 @@ function createTestSource(testsName) {
return source; return source;
} }
function makeRef(done, noPrompts) {
console.log();
console.log('### Creating reference images');
var PDF_BROWSERS = process.env['PDF_BROWSERS'] ||
'resources/browser_manifests/browser_manifest.json';
if (!checkFile('test/' + PDF_BROWSERS)) {
console.log('Browser manifest file test/' + PDF_BROWSERS +
' does not exist.');
console.log('Copy and adjust the example in ' +
'test/resources/browser_manifests.');
done(new Error('Missing manifest file'));
return;
}
var args = ['test.js', '--masterMode'];
if (noPrompts) {
args.push('--noPrompts');
}
args.push('--browserManifestFile=' + PDF_BROWSERS);
var testProcess = spawn('node', args, {cwd: TEST_DIR, stdio: 'inherit'});
testProcess.on('close', function (code) {
done();
});
}
gulp.task('default', function() { gulp.task('default', function() {
console.log('Available tasks:'); console.log('Available tasks:');
var tasks = Object.keys(gulp.tasks); var tasks = Object.keys(gulp.tasks);
@ -949,28 +976,12 @@ gulp.task('fonttest', function () {
return createTestSource('font'); return createTestSource('font');
}); });
gulp.task('botmakeref', function (done) { gulp.task('makeref', function (done) {
console.log(); makeRef(done);
console.log('### Creating reference images'); });
var PDF_BROWSERS = process.env['PDF_BROWSERS'] ||
'resources/browser_manifests/browser_manifest.json';
if (!checkFile('test/' + PDF_BROWSERS)) {
console.log('Browser manifest file test/' + PDF_BROWSERS +
' does not exist.');
console.log('Copy and adjust the example in ' +
'test/resources/browser_manifests.');
done(new Error('Missing manifest file'));
return;
}
var args = ['test.js', '--masterMode', '--noPrompts', gulp.task('botmakeref', function (done) {
'--browserManifestFile=' + PDF_BROWSERS]; makeRef(done, true);
var testProcess = spawn('node', args, {cwd: TEST_DIR, stdio: 'inherit'});
testProcess.on('close', function (code) {
done();
});
}); });
gulp.task('baseline', function (done) { gulp.task('baseline', function (done) {

Loading…
Cancel
Save