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
a4335049
Unverified
Commit
a4335049
authored
Oct 12, 2021
by
David Zagi
Committed by
GitHub
Oct 12, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into remixd_terminal
parents
8863733b
70f402b1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
config.yml
.circleci/config.yml
+1
-0
assert_ok_without_console_test.sol
...tests/tests/examples_0/assert_ok_without_console_test.sol
+13
-0
testRunner.cli.spec.ts
libs/remix-tests/tests/testRunner.cli.spec.ts
+11
-9
No files found.
.circleci/config.yml
View file @
a4335049
...
@@ -51,6 +51,7 @@ jobs:
...
@@ -51,6 +51,7 @@ jobs:
-
checkout
-
checkout
-
run
:
npm install
-
run
:
npm install
-
run
:
npm run build:libs
-
run
:
npm run build:libs
-
run
:
cd dist/libs/remix-tests && npm install
-
run
:
npm run test:libs
-
run
:
npm run test:libs
remix-ide-chrome-1
:
remix-ide-chrome-1
:
...
...
libs/remix-tests/tests/examples_0/assert_ok_without_console_test.sol
0 → 100644
View file @
a4335049
import "remix_tests.sol"; // this import is automatically injected by Remix.
contract AssertOkTest {
function okPassTest() public {
Assert.ok(true, "okPassTest passes");
}
function okFailTest() public {
Assert.ok(false, "okFailTest fails");
}
}
\ No newline at end of file
libs/remix-tests/tests/testRunner.cli.spec
_disabled
.ts
→
libs/remix-tests/tests/testRunner.cli.spec.ts
View file @
a4335049
...
@@ -10,7 +10,9 @@ describe('testRunner: remix-tests CLI', () => {
...
@@ -10,7 +10,9 @@ describe('testRunner: remix-tests CLI', () => {
if
(
result
)
{
if
(
result
)
{
const
dirContent
=
result
.
stdout
.
toString
()
const
dirContent
=
result
.
stdout
.
toString
()
// Install dependencies if 'node_modules' is not already present
// Install dependencies if 'node_modules' is not already present
if
(
!
dirContent
.
includes
(
'node_modules'
))
execSync
(
'npm install'
,
{
cwd
:
resolve
(
__dirname
+
'/../../../dist/libs/remix-tests'
)
})
if
(
!
dirContent
.
includes
(
'node_modules'
))
{
execSync
(
'npm install'
,
{
cwd
:
resolve
(
__dirname
+
'/../../../dist/libs/remix-tests'
)
})
}
}
}
...
@@ -40,7 +42,7 @@ Commands:
...
@@ -40,7 +42,7 @@ Commands:
})
})
test
(
'remix-tests running a test file'
,
()
=>
{
test
(
'remix-tests running a test file'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
const
res
=
spawnSync
(
executablePath
,
[
resolve
(
__dirname
+
'/examples_0/assert_ok_
without_console_
test.sol'
)])
// match initial lines
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/:: Running remix-tests - Unit testing for solidity ::/
)
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.../
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/creation of library remix_tests.sol:Assert pending.../
)
...
@@ -55,7 +57,7 @@ Commands:
...
@@ -55,7 +57,7 @@ Commands:
})
})
test
(
'remix-tests running a test file with custom compiler version'
,
()
=>
{
test
(
'remix-tests running a test file with custom compiler version'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--compiler'
,
'0.7.4'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
const
res
=
spawnSync
(
executablePath
,
[
'--compiler'
,
'0.7.4'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_
without_console_
test.sol'
)])
// match initial lines
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Compiler version set to 0.7.4. Latest version is'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Compiler version set to 0.7.4. Latest version is'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Loading remote solc version v0.7.4+commit.3f05b770 ...'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Loading remote solc version v0.7.4+commit.3f05b770 ...'
)).
toBeTruthy
()
...
@@ -69,13 +71,13 @@ Commands:
...
@@ -69,13 +71,13 @@ Commands:
})
})
test
(
'remix-tests running a test file with unavailable custom compiler version (should fail)'
,
()
=>
{
test
(
'remix-tests running a test file with unavailable custom compiler version (should fail)'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--compiler'
,
'1.10.4'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
const
res
=
spawnSync
(
executablePath
,
[
'--compiler'
,
'1.10.4'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_
without_console_
test.sol'
)])
// match initial lines
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'No compiler found in releases with version 1.10.4'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'No compiler found in releases with version 1.10.4'
)).
toBeTruthy
()
})
})
test
(
'remix-tests running a test file with custom EVM'
,
()
=>
{
test
(
'remix-tests running a test file with custom EVM'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--evm'
,
'petersburg'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
const
res
=
spawnSync
(
executablePath
,
[
'--evm'
,
'petersburg'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_
without_console_
test.sol'
)])
// match initial lines
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'EVM set to petersburg'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'EVM set to petersburg'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/:: Running remix-tests - Unit testing for solidity ::/
)
expect
(
res
.
stdout
.
toString
().
trim
()).
toMatch
(
/:: Running remix-tests - Unit testing for solidity ::/
)
...
@@ -88,7 +90,7 @@ Commands:
...
@@ -88,7 +90,7 @@ Commands:
})
})
test
(
'remix-tests running a test file by enabling optimization'
,
()
=>
{
test
(
'remix-tests running a test file by enabling optimization'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--optimize'
,
'true'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
const
res
=
spawnSync
(
executablePath
,
[
'--optimize'
,
'true'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_
without_console_
test.sol'
)])
// match initial lines
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Optimization is enabled'
)).
toBeTruthy
()
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
(
/:: Running remix-tests - Unit testing for solidity ::/
)
...
@@ -101,7 +103,7 @@ Commands:
...
@@ -101,7 +103,7 @@ Commands:
})
})
test
(
'remix-tests running a test file by enabling optimization and setting runs'
,
()
=>
{
test
(
'remix-tests running a test file by enabling optimization and setting runs'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--optimize'
,
'true'
,
'--runs'
,
'300'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
const
res
=
spawnSync
(
executablePath
,
[
'--optimize'
,
'true'
,
'--runs'
,
'300'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_
without_console_
test.sol'
)])
// match initial lines
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Optimization is enabled'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Optimization is enabled'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Runs set to 300'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Runs set to 300'
)).
toBeTruthy
()
...
@@ -115,13 +117,13 @@ Commands:
...
@@ -115,13 +117,13 @@ Commands:
})
})
test
(
'remix-tests running a test file without enabling optimization and setting runs (should fail)'
,
()
=>
{
test
(
'remix-tests running a test file without enabling optimization and setting runs (should fail)'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--runs'
,
'300'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
const
res
=
spawnSync
(
executablePath
,
[
'--runs'
,
'300'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_
without_console_
test.sol'
)])
// match initial lines
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Optimization should be enabled for runs'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Optimization should be enabled for runs'
)).
toBeTruthy
()
})
})
test
(
'remix-tests running a test file with all options'
,
()
=>
{
test
(
'remix-tests running a test file with all options'
,
()
=>
{
const
res
=
spawnSync
(
executablePath
,
[
'--compiler'
,
'0.7.5'
,
'--evm'
,
'istanbul'
,
'--optimize'
,
'true'
,
'--runs'
,
'250'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_test.sol'
)])
const
res
=
spawnSync
(
executablePath
,
[
'--compiler'
,
'0.7.5'
,
'--evm'
,
'istanbul'
,
'--optimize'
,
'true'
,
'--runs'
,
'250'
,
resolve
(
__dirname
+
'/examples_0/assert_ok_
without_console_
test.sol'
)])
// match initial lines
// match initial lines
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Compiler version set to 0.7.5. Latest version is'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Compiler version set to 0.7.5. Latest version is'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Loading remote solc version v0.7.5+commit.eb77ed08 ...'
)).
toBeTruthy
()
expect
(
res
.
stdout
.
toString
().
trim
().
includes
(
'Loading remote solc version v0.7.5+commit.eb77ed08 ...'
)).
toBeTruthy
()
...
...
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