From 7104c18b83806688b0e68e5cf29d968565b320ee Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Wed, 17 Oct 2018 12:50:59 -0400 Subject: [PATCH] Only disable optimizations with coverage. This means that any test runs without coverage will run optimized Solidity code instead. --- lib/tests/run_tests.js | 2 +- lib/tests/test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tests/run_tests.js b/lib/tests/run_tests.js index 0c119e238..c3027bafb 100644 --- a/lib/tests/run_tests.js +++ b/lib/tests/run_tests.js @@ -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); diff --git a/lib/tests/test.js b/lib/tests/test.js index 434a0112a..d62aa0e8d 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -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);