Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
52b2e468
Commit
52b2e468
authored
Sep 03, 2021
by
aniket-engg
Committed by
Aniket
Sep 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save compiler artifacts to show data on debugging
parent
6edbb46b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
4 deletions
+87
-4
test-tab.js
apps/remix-ide/src/app/tabs/test-tab.js
+12
-3
compiler-artefacts.ts
libs/remix-core-plugin/src/lib/compiler-artefacts.ts
+5
-0
compiler.ts
libs/remix-tests/src/compiler.ts
+1
-0
index.ts
libs/remix-tests/src/index.ts
+1
-1
eventManager.ts
libs/remix-tests/src/lib/eventManager.ts
+68
-0
runTestSources.ts
libs/remix-tests/src/runTestSources.ts
+0
-0
No files found.
apps/remix-ide/src/app/tabs/test-tab.js
View file @
52b2e468
...
@@ -7,7 +7,7 @@ var async = require('async')
...
@@ -7,7 +7,7 @@ var async = require('async')
var
tooltip
=
require
(
'../ui/tooltip'
)
var
tooltip
=
require
(
'../ui/tooltip'
)
var
Renderer
=
require
(
'../ui/renderer'
)
var
Renderer
=
require
(
'../ui/renderer'
)
var
css
=
require
(
'./styles/test-tab-styles'
)
var
css
=
require
(
'./styles/test-tab-styles'
)
var
remixTests
=
require
(
'@remix-project/remix-tests'
)
var
{
UnitTestRunner
}
=
require
(
'@remix-project/remix-tests'
)
const
TestTabLogic
=
require
(
'./testTab/testTab'
)
const
TestTabLogic
=
require
(
'./testTab/testTab'
)
...
@@ -33,6 +33,7 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -33,6 +33,7 @@ module.exports = class TestTab extends ViewPlugin {
this
.
data
=
{}
this
.
data
=
{}
this
.
appManager
=
appManager
this
.
appManager
=
appManager
this
.
renderer
=
new
Renderer
(
this
)
this
.
renderer
=
new
Renderer
(
this
)
this
.
testRunner
=
new
UnitTestRunner
()
this
.
hasBeenStopped
=
false
this
.
hasBeenStopped
=
false
this
.
runningTestsNumber
=
0
this
.
runningTestsNumber
=
0
this
.
readyTestsNumber
=
0
this
.
readyTestsNumber
=
0
...
@@ -95,6 +96,14 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -95,6 +96,14 @@ module.exports = class TestTab extends ViewPlugin {
this
.
setCurrentPath
(
this
.
defaultPath
)
this
.
setCurrentPath
(
this
.
defaultPath
)
})
})
this
.
testRunner
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
if
(
success
)
{
// forwarding the event to the appManager infra
// This is listened by compilerArtefacts to show data while debugging
this
.
emit
(
'compilationFinished'
,
source
.
target
,
source
,
'soljson'
,
data
)
}
})
this
.
fileManager
.
events
.
on
(
'noFileSelected'
,
()
=>
{
this
.
fileManager
.
events
.
on
(
'noFileSelected'
,
()
=>
{
})
})
...
@@ -462,7 +471,7 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -462,7 +471,7 @@ module.exports = class TestTab extends ViewPlugin {
usingWorker
:
canUseWorker
(
currentVersion
),
usingWorker
:
canUseWorker
(
currentVersion
),
runs
runs
}
}
remixTests
.
runTestSources
(
runningTest
,
compilerConfig
,
()
=>
{},
()
=>
{},
(
error
,
result
)
=>
{
this
.
testRunner
.
runTestSources
(
runningTest
,
compilerConfig
,
()
=>
{},
()
=>
{},
(
error
,
result
)
=>
{
if
(
error
)
return
reject
(
error
)
if
(
error
)
return
reject
(
error
)
resolve
(
result
)
resolve
(
result
)
},
(
url
,
cb
)
=>
{
},
(
url
,
cb
)
=>
{
...
@@ -489,7 +498,7 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -489,7 +498,7 @@ module.exports = class TestTab extends ViewPlugin {
usingWorker
:
canUseWorker
(
currentVersion
),
usingWorker
:
canUseWorker
(
currentVersion
),
runs
runs
}
}
remixTests
.
runTestSources
(
this
.
testRunner
.
runTestSources
(
runningTests
,
runningTests
,
compilerConfig
,
compilerConfig
,
(
result
)
=>
this
.
testCallback
(
result
,
runningTests
),
(
result
)
=>
this
.
testCallback
(
result
,
runningTests
),
...
...
libs/remix-core-plugin/src/lib/compiler-artefacts.ts
View file @
52b2e468
...
@@ -52,6 +52,11 @@ export class CompilerArtefacts extends Plugin {
...
@@ -52,6 +52,11 @@ export class CompilerArtefacts extends Plugin {
this
.
compilersArtefacts
.
__last
=
new
CompilerAbstract
(
languageVersion
,
data
,
source
)
this
.
compilersArtefacts
.
__last
=
new
CompilerAbstract
(
languageVersion
,
data
,
source
)
saveCompilationPerFileResult
(
file
,
source
,
languageVersion
,
data
)
saveCompilationPerFileResult
(
file
,
source
,
languageVersion
,
data
)
})
})
this
.
on
(
'solidityUnitTesting'
,
'compilationFinished'
,
(
file
,
source
,
languageVersion
,
data
)
=>
{
this
.
compilersArtefacts
.
__last
=
new
CompilerAbstract
(
languageVersion
,
data
,
source
)
saveCompilationPerFileResult
(
file
,
source
,
languageVersion
,
data
)
})
}
}
getAllContractDatas
()
{
getAllContractDatas
()
{
...
...
libs/remix-tests/src/compiler.ts
View file @
52b2e468
...
@@ -205,6 +205,7 @@ export function compileContractSources (sources: SrcIfc, compilerConfig: Compile
...
@@ -205,6 +205,7 @@ export function compileContractSources (sources: SrcIfc, compilerConfig: Compile
function
doCompilation
(
next
)
{
function
doCompilation
(
next
)
{
// @ts-ignore
// @ts-ignore
compiler
.
event
.
register
(
'compilationFinished'
,
this
,
(
success
,
data
,
source
)
=>
{
compiler
.
event
.
register
(
'compilationFinished'
,
this
,
(
success
,
data
,
source
)
=>
{
if
(
opts
&&
opts
.
event
)
opts
.
event
.
trigger
(
'compilationFinished'
,
[
success
,
data
,
source
])
next
(
null
,
data
)
next
(
null
,
data
)
})
})
compiler
.
compile
(
sources
,
filepath
)
compiler
.
compile
(
sources
,
filepath
)
...
...
libs/remix-tests/src/index.ts
View file @
52b2e468
export
{
runTestFiles
}
from
'./runTestFiles'
export
{
runTestFiles
}
from
'./runTestFiles'
export
{
runTestSources
}
from
'./runTestSources'
export
{
UnitTestRunner
}
from
'./runTestSources'
export
{
runTest
}
from
'./testRunner'
export
{
runTest
}
from
'./testRunner'
export
*
from
'./types'
export
*
from
'./types'
export
const
assertLibCode
=
require
(
'../sol/tests.sol'
)
export
const
assertLibCode
=
require
(
'../sol/tests.sol'
)
libs/remix-tests/src/lib/eventManager.ts
0 → 100644
View file @
52b2e468
'use strict'
export
default
class
EventManager
{
registered
:
any
=
{}
// eslint-disable-line
anonymous
:
any
=
{}
// eslint-disable-line
/*
* Unregister a listener.
* Note that if obj is a function. the unregistration will be applied to the dummy obj {}.
*
* @param {String} eventName - the event name
* @param {Object or Func} obj - object that will listen on this event
* @param {Func} func - function of the listeners that will be executed
*/
unregister
(
eventName
:
any
,
obj
:
any
,
func
:
any
):
void
{
// eslint-disable-line
if
(
!
this
.
registered
[
eventName
])
{
return
}
if
(
obj
instanceof
Function
)
{
func
=
obj
obj
=
this
.
anonymous
}
for
(
const
reg
in
this
.
registered
[
eventName
])
{
if
(
this
.
registered
[
eventName
][
reg
].
obj
===
obj
&&
this
.
registered
[
eventName
][
reg
].
func
===
func
)
{
this
.
registered
[
eventName
].
splice
(
reg
,
1
)
}
}
}
/*
* Register a new listener.
* Note that if obj is a function, the function registration will be associated with the dummy object {}
*
* @param {String} eventName - the event name
* @param {Object or Func} obj - object that will listen on this event
* @param {Func} func - function of the listeners that will be executed
*/
register
(
eventName
:
any
,
obj
:
any
,
func
:
any
):
void
{
// eslint-disable-line
if
(
!
this
.
registered
[
eventName
])
{
this
.
registered
[
eventName
]
=
[]
}
if
(
obj
instanceof
Function
)
{
func
=
obj
obj
=
this
.
anonymous
}
this
.
registered
[
eventName
].
push
({
obj
:
obj
,
func
:
func
})
}
/*
* trigger event.
* Every listener have their associated function executed
*
* @param {String} eventName - the event name
* @param {Array}j - argument that will be passed to the executed function.
*/
trigger
(
eventName
:
any
,
args
:
any
):
void
{
// eslint-disable-line
if
(
!
this
.
registered
[
eventName
])
{
return
}
for
(
const
listener
in
this
.
registered
[
eventName
])
{
const
l
=
this
.
registered
[
eventName
][
listener
]
if
(
l
.
func
)
l
.
func
.
apply
(
l
.
obj
===
this
.
anonymous
?
{}
:
l
.
obj
,
args
)
}
}
}
libs/remix-tests/src/runTestSources.ts
View file @
52b2e468
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment