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
02c68046
Commit
02c68046
authored
Jan 19, 2021
by
aniket-engg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for custom optimize option
parent
8d59edf1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
compiler.ts
libs/remix-tests/src/compiler.ts
+8
-3
run.ts
libs/remix-tests/src/run.ts
+0
-0
testRunner.cli.spec.ts
libs/remix-tests/tests/testRunner.cli.spec.ts
+14
-0
No files found.
libs/remix-tests/src/compiler.ts
View file @
02c68046
...
...
@@ -126,10 +126,11 @@ export function compileFileOrFiles(filename: string, isDirectory: boolean, opts:
async
.
waterfall
([
function
loadCompiler
(
next
)
{
compiler
=
new
RemixCompiler
()
if
(
compilerConfig
)
{
const
{
currentCompilerUrl
,
evmVersion
,
optimize
,
runs
}
=
compilerConfig
evmVersion
?
compiler
.
set
(
'evmVersion'
,
evmVersion
)
:
optimize
?
compiler
.
set
(
'optimize'
,
optimize
)
:
runs
?
compiler
.
set
(
'runs'
,
runs
)
:
''
evmVersion
?
compiler
.
set
(
'evmVersion'
,
evmVersion
)
:
null
optimize
?
compiler
.
set
(
'optimize'
,
optimize
)
:
null
runs
?
compiler
.
set
(
'runs'
,
runs
)
:
null
if
(
currentCompilerUrl
)
{
compiler
.
loadRemoteVersion
(
currentCompilerUrl
)
compiler
.
event
.
register
(
'compilerLoaded'
,
this
,
function
(
version
)
{
...
...
@@ -139,6 +140,10 @@ export function compileFileOrFiles(filename: string, isDirectory: boolean, opts:
compiler
.
onInternalCompilerLoaded
()
next
()
}
}
else
{
compiler
.
onInternalCompilerLoaded
()
next
()
}
},
function
doCompilation
(
next
)
{
// @ts-ignore
...
...
libs/remix-tests/src/run.ts
View file @
02c68046
libs/remix-tests/tests/testRunner.cli.spec.ts
View file @
02c68046
...
...
@@ -77,5 +77,18 @@ Commands:
// macth fail test details
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
})
test
(
'remix-tests running a test file by enabling optimization'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--optimize'
,
'true'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Optimization is enabled'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/:: Running remix-tests - Unit testing for solidity ::/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/creation of library remix_tests.sol:Assert pending.../
)
// match test result
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok pass test/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/Ok fail test/
)
// macth fail test details
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/error: okFailTest fails/
)
})
})
})
\ No newline at end of file
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