fix error in solc-tests

This commit is contained in:
Jonathan Rainville 2018-10-12 10:17:16 -04:00 committed by Pascal Precht
parent c6aa19a772
commit e450c0484a
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
3 changed files with 11 additions and 9 deletions

View File

@ -65,7 +65,7 @@ class TestRunner {
if (err) { if (err) {
return next(err); return next(err);
} }
self.logger.info(`Coverage report created. You can find it here: ${fs.dappPath('coverage/__root__/index.html')}\n`); console.info(`Coverage report created. You can find it here: ${fs.dappPath('coverage/__root__/index.html')}\n`);
const opn = require('opn'); const opn = require('opn');
const _next = () => { next(null, results); }; const _next = () => { next(null, results); };
if (options.noBrowser) { if (options.noBrowser) {
@ -86,7 +86,7 @@ class TestRunner {
if (totalFailures) { if (totalFailures) {
return cb(` > Total number of failures: ${totalFailures}`.red.bold); return cb(` > Total number of failures: ${totalFailures}`.red.bold);
} }
self.logger.info(' > All tests passed'.green.bold); console.info(' > All tests passed'.green.bold);
cb(); cb();
}); });
} }
@ -133,7 +133,7 @@ class TestRunner {
let deprecatedWarning = function () { let deprecatedWarning = function () {
self.logger.error(__('%s are not supported anymore', 'EmbarkSpec & deployAll').red); self.logger.error(__('%s are not supported anymore', 'EmbarkSpec & deployAll').red);
self.logger.info(__('You can learn about the new revamped tests here: %s', 'https://embark.status.im/docs/testing.html'.underline)); self.logger.error(__('You can learn about the new revamped tests here: %s', 'https://embark.status.im/docs/testing.html'.underline));
process.exit(); process.exit();
}; };
@ -200,7 +200,7 @@ class TestRunner {
} }
runSolidityTests(files, options, cb) { runSolidityTests(files, options, cb) {
this.logger.info('Running solc tests'); console.info('Running solc tests');
const loglevel = options.loglevel || 'warn'; const loglevel = options.loglevel || 'warn';
let solcTest = new SolcTest({loglevel, node: options.node, events: this.events, logger: this.logger, let solcTest = new SolcTest({loglevel, node: options.node, events: this.events, logger: this.logger,

View File

@ -70,7 +70,7 @@ class SolcTest extends Test {
runTests(file, cb) { runTests(file, cb) {
const self = this; const self = this;
self.logger.info('Running tests'.cyan); console.info('Running tests'.cyan);
const forwardSlashFile = file.replace(/\\/g, '/'); const forwardSlashFile = file.replace(/\\/g, '/');
async.waterfall([ async.waterfall([
@ -124,13 +124,13 @@ class SolcTest extends Test {
_prettyPrint(obj) { _prettyPrint(obj) {
if (obj.type === 'contract') { if (obj.type === 'contract') {
this.logger.info(color('suite', '%s'), obj.value); console.info(color('suite', '%s'), obj.value);
} else if(obj.type === 'testPass') { } else if(obj.type === 'testPass') {
let fmt = color('checkmark', ' ' + Base.symbols.ok) + color('pass', ' %s'); let fmt = color('checkmark', ' ' + Base.symbols.ok) + color('pass', ' %s');
this.logger.info(fmt, obj.value); console.info(fmt, obj.value);
} else if(obj.type === 'testFailure') { } else if(obj.type === 'testFailure') {
let fmt = color('fail', ' %s %s'); let fmt = color('fail', ' %s %s');
this.logger.info(fmt, Base.symbols.err, obj.value); console.info(fmt, Base.symbols.err, obj.value);
} }
} }
} }

View File

@ -24,6 +24,8 @@ class Test {
init(callback) { init(callback) {
this.gasLimit = 6000000;
this.events.request('deploy:setGasLimit', this.gasLimit);
this.events.request('blockchain:object', (connector) => { this.events.request('blockchain:object', (connector) => {
this.blockchainConnector = connector; this.blockchainConnector = connector;
if (this.options.node !== 'embark') { if (this.options.node !== 'embark') {
@ -186,7 +188,7 @@ class Test {
if (!self.firstDeployment) { if (!self.firstDeployment) {
return next(); return next();
} }
self.logger.info('Compiling contracts'.cyan); console.info('Compiling contracts'.cyan);
self.events.request("contracts:build", false, (err) => { self.events.request("contracts:build", false, (err) => {
self.firstDeployment = false; self.firstDeployment = false;
next(err); next(err);