Commit a55172d4 authored by yann300's avatar yann300

run each test in series

parent 0e96c32c
var yo = require('yo-yo')
var async = require('async')
var css = require('./styles/test-tab-styles')
var remixTests = require('remix-tests')
......@@ -28,7 +29,7 @@ function testTabView (api) {
cb()
}
let finalCallback = function (_err, result) {
let updateFinalResult = function (_err, result) {
if (result.totalPassing > 0) {
append(container, (' ' + result.totalPassing + ' passing ') + ('(' + result.totalTime + 's)'))
}
......@@ -43,13 +44,16 @@ function testTabView (api) {
})
}
function runTest (testFilePath) {
function runTest (testFilePath, callback) {
var provider = api.fileProviderOf(testFilePath)
provider.get(testFilePath, (error, content) => {
if (!error) {
var runningTest = {}
runningTest[testFilePath] = { content }
remixTests.runTestSources(runningTest, testCallback, resultsCallback, finalCallback, api.importFileCb)
remixTests.runTestSources(runningTest, testCallback, resultsCallback, (error, result) => {
updateFinalResult(error, result)
callback(error)
}, api.importFileCb)
}
})
}
......@@ -57,11 +61,13 @@ function testTabView (api) {
let runTests = function () {
container.innerHTML = ''
var path = api.currentPath()
var tests = []
api.filesFromPath(path, (error, files) => {
if (!error) {
for (var file in files) {
if (/.(_test.sol)$/.exec(file)) runTest(path + file)
if (/.(_test.sol)$/.exec(file)) tests.push(path + file)
}
async.eachOfSeries(tests, (value, key, callback) => { runTest(value, callback) })
}
})
}
......
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