parent
5ee149775f
commit
2c3a2248c8
@ -1,59 +1,61 @@ |
||||
var Web3 = require('web3'); |
||||
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); |
||||
|
||||
var shell = require('shelljs'); |
||||
var SolidityCoder = require("web3/lib/solidity/coder.js"); |
||||
var fs = require('fs'); |
||||
var path = require('path'); |
||||
var getInstrumentedVersion = require('./instrumentSolidity.js'); |
||||
var CoverageMap = require('./coverageMap.js'); |
||||
var coverage = new CoverageMap(); |
||||
var mkdirp = require('mkdirp'); |
||||
|
||||
var childprocess = require('child_process'); |
||||
|
||||
//PAtch our local testrpc if necessary
|
||||
if (!shell.test('-e','./node_modules/ethereumjs-vm/lib/opFns.js.orig')){ |
||||
console.log('patch local testrpc...') |
||||
shell.exec('patch -b ./node_modules/ethereumjs-vm/lib/opFns.js ./hookIntoEvents.patch') |
||||
const Web3 = require('web3'); |
||||
const shell = require('shelljs'); |
||||
const SolidityCoder = require('web3/lib/solidity/coder.js'); |
||||
const getInstrumentedVersion = require('./instrumentSolidity.js'); |
||||
const fs = require('fs'); |
||||
const path = require('path'); |
||||
const CoverageMap = require('./coverageMap.js'); |
||||
const mkdirp = require('mkdirp'); |
||||
const childprocess = require('child_process'); |
||||
|
||||
const coverage = new CoverageMap(); |
||||
const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545')); |
||||
|
||||
// Patch our local testrpc if necessary
|
||||
if (!shell.test('-e', './node_modules/ethereumjs-vm/lib/opFns.js.orig')) { |
||||
console.log('patch local testrpc...'); |
||||
shell.exec('patch -b ./node_modules/ethereumjs-vm/lib/opFns.js ./hookIntoEvents.patch'); |
||||
} |
||||
//Run the modified testrpc with large block limit
|
||||
var testrpcProcess = childprocess.exec('./node_modules/ethereumjs-testrpc/bin/testrpc --gasLimit 0xfffffffffffff --gasPrice 0x1') |
||||
|
||||
if (shell.test('-d','../originalContracts')){ |
||||
console.log("There is already an 'originalContracts' directory in your truffle directory.\nThis is probably due to a previous solcover failure.\nPlease make sure the ./contracts/ directory contains your contracts (perhaps by copying them from originalContracts), and then delete the originalContracts directory.") |
||||
process.exit(1); |
||||
// Run the modified testrpc with large block limit
|
||||
const testrpcProcess = childprocess.exec('./node_modules/ethereumjs-testrpc/bin/testrpc --gasLimit 0xfffffffffffff --gasPrice 0x1'); |
||||
|
||||
if (shell.test('-d', '../originalContracts')) { |
||||
console.log('There is already an "originalContracts" directory in your truffle directory.\n' + |
||||
'This is probably due to a previous solcover failure.\n' + |
||||
'Please make sure the ./contracts/ directory contains your contracts (perhaps by copying them from originalContracts), ' + |
||||
'and then delete the originalContracts directory.'); |
||||
process.exit(1); |
||||
} |
||||
|
||||
shell.mv('./../contracts/', './../originalContracts/'); |
||||
shell.mkdir('./../contracts/'); |
||||
//For each contract in originalContracts, get the instrumented version
|
||||
shell.ls('./../originalContracts/**/*.sol').forEach(function(file) { |
||||
if (file !== 'originalContracts/Migrations.sol') { |
||||
var canonicalContractPath = path.resolve(file); |
||||
|
||||
console.log("instrumenting ", canonicalContractPath); |
||||
var contract = fs.readFileSync(canonicalContractPath).toString(); |
||||
var instrumentedContractInfo = getInstrumentedVersion(contract, canonicalContractPath, true); |
||||
mkdirp.sync(path.dirname(canonicalContractPath.replace('originalContracts', 'contracts'))); |
||||
fs.writeFileSync(canonicalContractPath.replace('originalContracts','contracts'), instrumentedContractInfo.contract); |
||||
coverage.addContract(instrumentedContractInfo, canonicalContractPath); |
||||
} |
||||
// For each contract in originalContracts, get the instrumented version
|
||||
shell.ls('./../originalContracts/**/*.sol').forEach(file => { |
||||
if (file !== 'originalContracts/Migrations.sol') { |
||||
const canonicalContractPath = path.resolve(file); |
||||
|
||||
console.log('instrumenting ', canonicalContractPath); |
||||
const contract = fs.readFileSync(canonicalContractPath).toString(); |
||||
const instrumentedContractInfo = getInstrumentedVersion(contract, canonicalContractPath, true); |
||||
mkdirp.sync(path.dirname(canonicalContractPath.replace('originalContracts', 'contracts'))); |
||||
fs.writeFileSync(canonicalContractPath.replace('originalContracts', 'contracts'), instrumentedContractInfo.contract); |
||||
coverage.addContract(instrumentedContractInfo, canonicalContractPath); |
||||
} |
||||
}); |
||||
shell.cp("./../originalContracts/Migrations.sol", "./../contracts/Migrations.sol"); |
||||
shell.cp('./../originalContracts/Migrations.sol', './../contracts/Migrations.sol'); |
||||
|
||||
shell.rm('./allFiredEvents'); //Delete previous results
|
||||
shell.rm('./allFiredEvents'); // Delete previous results
|
||||
shell.exec('truffle test --network test'); |
||||
|
||||
events = fs.readFileSync('./allFiredEvents').toString().split('\n') |
||||
const events = fs.readFileSync('./allFiredEvents').toString().split('\n'); |
||||
events.pop(); |
||||
//The pop here isn't a bug - there is an empty line at the end of this file, so we
|
||||
//don't want to include it as an event.
|
||||
// The pop here isn't a bug - there is an empty line at the end of this file, so we
|
||||
// don't want to include it as an event.
|
||||
coverage.generate(events, './../originalContracts/'); |
||||
|
||||
fs.writeFileSync('./coverage.json', JSON.stringify(coverage.coverage)); |
||||
|
||||
shell.exec("./node_modules/istanbul/lib/cli.js report lcov") |
||||
shell.exec('./node_modules/istanbul/lib/cli.js report lcov'); |
||||
testrpcProcess.kill(); |
||||
shell.rm('-rf', './../contracts'); |
||||
shell.mv('./../originalContracts', './../contracts'); |
||||
|
@ -1,39 +1,40 @@ |
||||
var solc = require('solc'); |
||||
var getInstrumentedVersion = require('./../instrumentSolidity.js'); |
||||
var util = require('./util/util.js'); |
||||
/* eslint-env node, mocha */ |
||||
|
||||
const solc = require('solc'); |
||||
const getInstrumentedVersion = require('./../instrumentSolidity.js'); |
||||
const util = require('./util/util.js'); |
||||
|
||||
/** |
||||
* NB: passing '1' to solc as an option activates the optimiser |
||||
* NB: solc will throw if there is a compilation error, causing the test to fail |
||||
* and passing the error to mocha. |
||||
*/ |
||||
describe('function declarations', function(){ |
||||
|
||||
it('should compile after instrumenting an ordinary function declaration', function(){ |
||||
var contract = util.getCode('function/function.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
describe('function declarations', () => { |
||||
it('should compile after instrumenting an ordinary function declaration', () => { |
||||
const contract = util.getCode('function/function.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}); |
||||
|
||||
it('should compile after instrumenting an abstract function declaration', function(){ |
||||
var contract = util.getCode('function/abstract.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
it('should compile after instrumenting an abstract function declaration', () => { |
||||
const contract = util.getCode('function/abstract.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}); |
||||
|
||||
it('should compile after instrumenting a function declaration with an empty body', function(){ |
||||
var contract = util.getCode('function/empty-body.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
it('should compile after instrumenting a function declaration with an empty body', () => { |
||||
const contract = util.getCode('function/empty-body.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}); |
||||
|
||||
it('should compile after instrumenting lots of declarations in row', function(){ |
||||
var contract = util.getCode('function/multiple.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
it('should compile after instrumenting lots of declarations in row', () => { |
||||
const contract = util.getCode('function/multiple.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}) |
||||
}); |
||||
}); |
||||
|
@ -1,20 +1,21 @@ |
||||
var solc = require('solc'); |
||||
var getInstrumentedVersion = require('./../instrumentSolidity.js'); |
||||
var util = require('./util/util.js'); |
||||
/* eslint-env node, mocha */ |
||||
|
||||
describe('return statements', function(){ |
||||
const solc = require('solc'); |
||||
const getInstrumentedVersion = require('./../instrumentSolidity.js'); |
||||
const util = require('./util/util.js'); |
||||
|
||||
it('should compile after instrumenting function that returns true',function(){ |
||||
var contract = util.getCode('return/return.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
util.report(output.errors);
|
||||
}) |
||||
describe('return statements', () => { |
||||
it('should compile after instrumenting function that returns true', () => { |
||||
const contract = util.getCode('return/return.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
|
||||
it('should compile after instrumenting function that returns without specifying val (null)',function(){ |
||||
var contract = util.getCode('return/return-null.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
it('should compile after instrumenting function that returns without specifying val (null)', () => { |
||||
const contract = util.getCode('return/return-null.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}) |
||||
}); |
||||
}); |
||||
|
@ -1,188 +1,189 @@ |
||||
var solc = require('solc'); |
||||
var getInstrumentedVersion = require('./../instrumentSolidity.js'); |
||||
var util = require('./util/util.js'); |
||||
/* eslint-env node, mocha */ |
||||
|
||||
describe('Battery test of production contracts: OpenZeppelin', function(){ |
||||
const solc = require('solc'); |
||||
const getInstrumentedVersion = require('./../instrumentSolidity.js'); |
||||
const util = require('./util/util.js'); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/Bounty.sol',function(){ |
||||
var contract = util.getCode('zeppelin/Bounty.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var inputs = { |
||||
describe('Battery test of production contracts: OpenZeppelin', () => { |
||||
it('should compile after instrumenting zeppelin-solidity/Bounty.sol', () => { |
||||
const contract = util.getCode('zeppelin/Bounty.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const inputs = { |
||||
'PullPayment.sol': util.getCode('zeppelin/PullPayment.sol'), |
||||
'Killable.sol': util.getCode('zeppelin/Killable.sol'), |
||||
'Bounty.sol': info.contract |
||||
'Bounty.sol': info.contract, |
||||
}; |
||||
var output = solc.compile(inputs, 1);
|
||||
const output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/Claimable.sol',function(){
|
||||
var contract = util.getCode('zeppelin/Claimable.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var inputs = { |
||||
it('should compile after instrumenting zeppelin-solidity/Claimable.sol', () => { |
||||
const contract = util.getCode('zeppelin/Claimable.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const inputs = { |
||||
'Ownable.sol': util.getCode('zeppelin/Ownable.sol'), |
||||
'Claimable.sol': info.contract |
||||
'Claimable.sol': info.contract, |
||||
}; |
||||
var output = solc.compile(inputs, 1);
|
||||
const output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/DayLimit.sol',function(){
|
||||
var contract = util.getCode('zeppelin/DayLimit.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var inputs = { |
||||
it('should compile after instrumenting zeppelin-solidity/DayLimit.sol', () => { |
||||
const contract = util.getCode('zeppelin/DayLimit.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const inputs = { |
||||
'Ownable.sol': util.getCode('zeppelin/Shareable.sol'), |
||||
'DayLimit.sol': info.contract |
||||
'DayLimit.sol': info.contract, |
||||
}; |
||||
var output = solc.compile(inputs, 1);
|
||||
const output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/Killable.sol',function(){ |
||||
var contract = util.getCode('zeppelin/Killable.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var inputs = { |
||||
it('should compile after instrumenting zeppelin-solidity/Killable.sol', () => { |
||||
const contract = util.getCode('zeppelin/Killable.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const inputs = { |
||||
'Ownable.sol': util.getCode('zeppelin/Ownable.sol'), |
||||
'Killable.sol': info.contract |
||||
'Killable.sol': info.contract, |
||||
}; |
||||
var output = solc.compile(inputs, 1);
|
||||
util.report(output.errors);
|
||||
}) |
||||
const output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/LimitBalance.sol',function(){ |
||||
var contract = util.getCode('zeppelin/LimitBalance.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
it('should compile after instrumenting zeppelin-solidity/LimitBalance.sol', () => { |
||||
const contract = util.getCode('zeppelin/LimitBalance.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/Migrations.sol',function(){ |
||||
var contract = util.getCode('zeppelin/Migrations.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var inputs = { |
||||
it('should compile after instrumenting zeppelin-solidity/Migrations.sol', () => { |
||||
const contract = util.getCode('zeppelin/Migrations.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const inputs = { |
||||
'Ownable.sol': util.getCode('zeppelin/Ownable.sol'), |
||||
'Migrations.sol': info.contract |
||||
'Migrations.sol': info.contract, |
||||
}; |
||||
var output = solc.compile(inputs, 1);
|
||||
const output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/Multisig.sol',function(){ |
||||
var contract = util.getCode('zeppelin/Multisig.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
it('should compile after instrumenting zeppelin-solidity/Multisig.sol', () => { |
||||
const contract = util.getCode('zeppelin/Multisig.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/MultisigWallet.sol',function(){ |
||||
var contract = util.getCode('zeppelin/MultisigWallet.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var inputs = { |
||||
it('should compile after instrumenting zeppelin-solidity/MultisigWallet.sol', () => { |
||||
const contract = util.getCode('zeppelin/MultisigWallet.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const inputs = { |
||||
'Multisig.sol': util.getCode('zeppelin/Multisig.sol'), |
||||
'Shareable.sol': util.getCode('zeppelin/Shareable.sol'), |
||||
'DayLimit.sol': util.getCode('zeppelin/DayLimit.sol'), |
||||
'MultisigWallet.sol': info.contract |
||||
'MultisigWallet.sol': info.contract, |
||||
}; |
||||
var output = solc.compile(inputs, 1); |
||||
util.report(output.errors);
|
||||
}) |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/Ownable.sol',function(){ |
||||
var contract = util.getCode('zeppelin/Ownable.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
util.report(output.errors);
|
||||
}) |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/PullPayment.sol',function(){ |
||||
var contract = util.getCode('zeppelin/PullPayment.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
util.report(output.errors);
|
||||
}) |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/SafeMath.sol',function(){ |
||||
var contract = util.getCode('zeppelin/SafeMath.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
util.report(output.errors); |
||||
}) |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/Shareable.sol',function(){ |
||||
var contract = util.getCode('zeppelin/Shareable.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
util.report(output.errors);
|
||||
}) |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/Stoppable.sol',function(){ |
||||
var contract = util.getCode('zeppelin/Stoppable.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var inputs = { |
||||
const output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/Ownable.sol', () => { |
||||
const contract = util.getCode('zeppelin/Ownable.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/PullPayment.sol', () => { |
||||
const contract = util.getCode('zeppelin/PullPayment.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/SafeMath.sol', () => { |
||||
const contract = util.getCode('zeppelin/SafeMath.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/Shareable.sol', () => { |
||||
const contract = util.getCode('zeppelin/Shareable.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/Stoppable.sol', () => { |
||||
const contract = util.getCode('zeppelin/Stoppable.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const inputs = { |
||||
'Ownable.sol': util.getCode('zeppelin/Ownable.sol'), |
||||
'Stoppable.sol': info.contract |
||||
'Stoppable.sol': info.contract, |
||||
}; |
||||
var output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
//--- Tokens ---
|
||||
it('should compile after instrumenting zeppelin-solidity/BasicToken.sol',function(){ |
||||
var contract = util.getCode('zeppelin/token/BasicToken.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var inputs = { |
||||
const output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
// --- Tokens ---
|
||||
it('should compile after instrumenting zeppelin-solidity/BasicToken.sol', () => { |
||||
const contract = util.getCode('zeppelin/token/BasicToken.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const inputs = { |
||||
'ERC20Basic.sol': util.getCode('zeppelin/token/ERC20Basic.sol'), |
||||
'SafeMath.sol': util.getCode('zeppelin/SafeMath.sol'), |
||||
'BasicToken.sol': info.contract |
||||
'BasicToken.sol': info.contract, |
||||
}; |
||||
var output = solc.compile(inputs, 1);
|
||||
const output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/CrowdsaleToken.sol',function(){ |
||||
var contract = util.getCode('zeppelin/token/CrowdsaleToken.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var inputs = { |
||||
it('should compile after instrumenting zeppelin-solidity/CrowdsaleToken.sol', () => { |
||||
const contract = util.getCode('zeppelin/token/CrowdsaleToken.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const inputs = { |
||||
'StandardToken.sol': util.getCode('zeppelin/token/StandardToken.sol'), |
||||
'CrowdsaleToken.sol': info.contract |
||||
};
|
||||
var output = solc.compile(inputs, 1); |
||||
util.report(output.errors);
|
||||
}) |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/ERC20.sol',function(){ |
||||
var contract = util.getCode('zeppelin/token/ERC20.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
util.report(output.errors);
|
||||
}) |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/ERC20Basic.sol',function(){ |
||||
var contract = util.getCode('zeppelin/token/ERC20Basic.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var output = solc.compile(info.contract, 1);
|
||||
util.report(output.errors);
|
||||
}) |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/SimpleToken.sol',function(){ |
||||
var contract = util.getCode('zeppelin/token/SimpleToken.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var inputs = { |
||||
'CrowdsaleToken.sol': info.contract, |
||||
}; |
||||
const output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/ERC20.sol', () => { |
||||
const contract = util.getCode('zeppelin/token/ERC20.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/ERC20Basic.sol', () => { |
||||
const contract = util.getCode('zeppelin/token/ERC20Basic.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const output = solc.compile(info.contract, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/SimpleToken.sol', () => { |
||||
const contract = util.getCode('zeppelin/token/SimpleToken.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const inputs = { |
||||
'StandardToken.sol': util.getCode('zeppelin/token/StandardToken.sol'), |
||||
'SimpleToken.sol': info.contract |
||||
};
|
||||
var output = solc.compile(inputs, 1); |
||||
util.report(output.errors);
|
||||
}) |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/StandardToken.sol',function(){ |
||||
var contract = util.getCode('zeppelin/token/StandardToken.sol'); |
||||
var info = getInstrumentedVersion(contract, "test.sol", true); |
||||
var inputs = { |
||||
'SimpleToken.sol': info.contract, |
||||
}; |
||||
const output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}); |
||||
|
||||
it('should compile after instrumenting zeppelin-solidity/StandardToken.sol', () => { |
||||
const contract = util.getCode('zeppelin/token/StandardToken.sol'); |
||||
const info = getInstrumentedVersion(contract, 'test.sol', true); |
||||
const inputs = { |
||||
'ERC20Basic.sol': util.getCode('zeppelin/token/ERC20Basic.sol'), |
||||
'SafeMath.sol': util.getCode('zeppelin/SafeMath.sol'), |
||||
'StandardToken.sol': info.contract |
||||
'StandardToken.sol': info.contract, |
||||
}; |
||||
var output = solc.compile(inputs, 1);
|
||||
const output = solc.compile(inputs, 1); |
||||
util.report(output.errors); |
||||
}) |
||||
}) |
||||
}); |
||||
}); |
||||
|
Loading…
Reference in new issue