Merge pull request #1374 from ethereum/fixCurrentPath

Fix currentPath()
pull/3094/head
yann300 6 years ago committed by GitHub
commit 42ca36ddfc
  1. 12
      .circleci/config.yml
  2. 2
      src/app/files/fileManager.js
  3. 4
      src/app/panels/righthand-panel.js
  4. 2
      src/app/tabs/run-tab.js
  5. 8
      src/app/tabs/test-tab.js

@ -7,7 +7,7 @@ jobs:
remix-ide:
docker:
# specify the version you desire here
- image: circleci/node:7.10
- image: circleci/node:9.11.2
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
@ -26,10 +26,10 @@ jobs:
- checkout
- restore_cache:
keys:
- dep-bundle-12-{{ checksum "package.json" }}
- dep-bundle-13-{{ checksum "package.json" }}
- run: npm install
- save_cache:
key: dep-bundle-12-{{ checksum "package.json" }}
key: dep-bundle-13-{{ checksum "package.json" }}
paths:
- ~/repo/node_modules
- run: npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build
@ -38,7 +38,7 @@ jobs:
remix-debugger:
docker:
# specify the version you desire here
- image: circleci/node:7.10
- image: circleci/node:9.11.2
working_directory: ~/repo
@ -46,10 +46,10 @@ jobs:
- checkout
- restore_cache:
keys:
- dep-bundle-7-{{ checksum "package.json" }}
- dep-bundle-8-{{ checksum "package.json" }}
- run: npm install
- save_cache:
key: dep-bundle-7-{{ checksum "package.json" }}
key: dep-bundle-8-{{ checksum "package.json" }}
paths:
- ~/repo/node_modules
- run: npm run build_debugger

@ -74,7 +74,7 @@ class FileManager {
currentPath () {
var self = this
var currentFile = self._deps.config.get('currentFile')
var reg = /(.*\/).*/
var reg = /(.*)(\/).*/
var path = reg.exec(currentFile)
return path ? path[1] : null
}

@ -111,14 +111,14 @@ module.exports = class RighthandPanel {
</div>
</div>`
const { compile, run, settings, analysis, debug, support } = self._components
const { compile, run, settings, analysis, debug, support, test } = self._components
self._components.tabbedMenu.addTab('Compile', 'compileView', compile.render())
self._components.tabbedMenu.addTab('Run', 'runView', run.render())
self._components.tabbedMenu.addTab('Settings', 'settingsView', settings.render())
self._components.tabbedMenu.addTab('Analysis', 'staticanalysisView', analysis.render())
self._components.tabbedMenu.addTab('Debugger', 'debugView', debug.render())
self._components.tabbedMenu.addTab('Support', 'supportView', support.render())
// self._components.tabbedMenu.addTab('Test', 'testView', test.render())
self._components.tabbedMenu.addTab('Test', 'testView', test.render())
self._components.tabbedMenu.selectTabByTitle('Compile')
}
// showDebugger () {

@ -266,7 +266,7 @@ function makeRecorder (registry, runTabEvent, self) {
modalDialogCustom.prompt(null, 'Transactions will be saved in a file under ' + path, 'scenario.json', input => {
var fileProvider = fileManager.fileProviderOf(path)
if (fileProvider) {
var newFile = path + input
var newFile = path + '/' + input
helper.createNonClashingName(newFile, fileProvider, (error, newFile) => {
if (error) return modalDialogCustom.alert('Failed to create file. ' + newFile + ' ' + error)
if (!fileProvider.set(newFile, txJSON)) {

@ -68,8 +68,7 @@ module.exports = class TestTab {
})
}
function runTest (testFilePath, callback) {
var provider = this._deps.fileManager.fileProviderOf(testFilePath)
function runTest (testFilePath, provider, callback) {
provider.get(testFilePath, (error, content) => {
if (!error) {
var runningTest = {}
@ -85,13 +84,14 @@ module.exports = class TestTab {
let runTests = function () {
container.innerHTML = ''
var path = this._deps.fileManager.currentPath()
var provider = this._deps.fileManager.fileProviderOf(path)
var tests = []
self._deps.fileManager.filesFromPath(path, (error, files) => {
if (!error) {
for (var file in files) {
if (/.(_test.sol)$/.exec(file)) tests.push(path + file)
if (/.(_test.sol)$/.exec(file)) tests.push(provider.type + '/' + file)
}
async.eachOfSeries(tests, (value, key, callback) => { runTest(value, callback) })
async.eachOfSeries(tests, (value, key, callback) => { runTest(value, provider, callback) })
}
})
}

Loading…
Cancel
Save