Unverified Commit 6c147a78 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #8 from ethereum/export_assert_lib

Export assert lib
parents 170fd31b 45916fe9
module.exports = `
pragma solidity ^0.4.7; pragma solidity ^0.4.7;
library Assert { library Assert {
...@@ -99,4 +100,4 @@ library Assert { ...@@ -99,4 +100,4 @@ library Assert {
//} //}
} }
`;
...@@ -10,7 +10,8 @@ function compileFileOrFiles (filename, isDirectory, cb) { ...@@ -10,7 +10,8 @@ function compileFileOrFiles (filename, isDirectory, cb) {
let compiler, filepath let compiler, filepath
const sources = { const sources = {
'tests.sol': {content: fs.readFileSync('sol/tests.sol').toString()} 'tests.sol': {content: require('../sol/tests.sol.js') },
'remix_tests.sol': {content: require('../sol/tests.sol.js') }
} }
// TODO: for now assumes filepath dir contains all tests, later all this // TODO: for now assumes filepath dir contains all tests, later all this
...@@ -48,6 +49,10 @@ function compileFileOrFiles (filename, isDirectory, cb) { ...@@ -48,6 +49,10 @@ function compileFileOrFiles (filename, isDirectory, cb) {
function compileContractSources (sources, cb) { function compileContractSources (sources, cb) {
let compiler, filepath let compiler, filepath
if(!sources['remix_tests.sol']) {
sources['remix_tests.sol'] = {content: require('../sol/tests.sol.js')}
}
async.waterfall([ async.waterfall([
function loadCompiler (next) { function loadCompiler (next) {
compiler = new RemixCompiler() compiler = new RemixCompiler()
......
...@@ -188,5 +188,6 @@ var runTestFiles = function (filepath, isDirectory, web3) { ...@@ -188,5 +188,6 @@ var runTestFiles = function (filepath, isDirectory, web3) {
module.exports = { module.exports = {
runTestFiles: runTestFiles, runTestFiles: runTestFiles,
runTestSources: runTestSources, runTestSources: runTestSources,
runTest: TestRunner.runTest runTest: TestRunner.runTest,
assertLibCode: require('../sol/tests.sol.js')
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment