Only disable optimizations with coverage.

This means that any test runs without coverage will run optimized
Solidity code instead.
This commit is contained in:
Andre Medeiros 2018-10-17 12:50:59 -04:00 committed by Pascal Precht
parent 27973461b1
commit 7104c18b83
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ function runJSTests(files, options, cb) {
async.waterfall([
function setupGlobalNamespace(next) {
// TODO put default config
const test = new Test({loglevel, node: options.node});
const test = new Test({loglevel, node: options.node, coverage: options.coverage});
global.embark = test;
global.assert = assert;
global.config = test.config.bind(test);

View File

@ -154,7 +154,7 @@ class Test {
this.engine.startService("deployment", {
trackContracts: false,
compileOnceOnly: true,
disableOptimizations: true
disableOptimizations: this.options.coverage
});
this.gasLimit = 6000000;
this.engine.events.request('deploy:setGasLimit', this.gasLimit);