mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Use test.py for unit tests too.
This commit is contained in:
parent
cec7a92a99
commit
e18a2c512e
17 changed files with 1115 additions and 658 deletions
29
make.js
29
make.js
|
@ -358,8 +358,9 @@ target.chrome = function() {
|
|||
// make test
|
||||
//
|
||||
target.test = function() {
|
||||
target.browsertest();
|
||||
target.unittest();
|
||||
target.unittest({}, function() {
|
||||
target.browsertest();
|
||||
});
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -367,8 +368,10 @@ target.test = function() {
|
|||
// (Special tests for the Github bot)
|
||||
//
|
||||
target.bottest = function() {
|
||||
target.browsertest({noreftest: true});
|
||||
// target.unittest();
|
||||
target.unittest();
|
||||
target.browsertest({noreftest: true}, function() {
|
||||
target.browsertest();
|
||||
});
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -398,18 +401,22 @@ target.browsertest = function(options) {
|
|||
//
|
||||
// make unittest
|
||||
//
|
||||
target.unittest = function() {
|
||||
target.unittest = function(options, callback) {
|
||||
cd(ROOT_DIR);
|
||||
echo();
|
||||
echo('### Running unit tests');
|
||||
|
||||
if (!which('make')) {
|
||||
echo('make not found. Skipping unit tests...');
|
||||
return;
|
||||
}
|
||||
var PDF_BROWSERS = env['PDF_BROWSERS'] || 'resources/browser_manifests/browser_manifest.json';
|
||||
|
||||
cd('test/unit');
|
||||
exec('make', {async: true});
|
||||
if (!test('-f', 'test/' + PDF_BROWSERS)) {
|
||||
echo('Browser manifest file test/' + PDF_BROWSERS + ' does not exist.');
|
||||
echo('Try copying one of the examples in test/resources/browser_manifests/');
|
||||
exit(1);
|
||||
}
|
||||
callback = callback || function() {};
|
||||
cd('test');
|
||||
exec(PYTHON_BIN + ' -u test.py --unitTest --browserManifestFile=' + PDF_BROWSERS,
|
||||
{async: true}, callback);
|
||||
};
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue