Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
fb6bfc83
Commit
fb6bfc83
authored
Sep 30, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mips regression tests
parent
2fe59f43
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
test_evm.yml
.github/workflows/test_evm.yml
+21
-0
evm.sh
mipsevm/evm.sh
+1
-1
main.go
mipsevm/main.go
+7
-3
No files found.
.github/workflows/test_evm.yml
0 → 100644
View file @
fb6bfc83
name
:
Test EVM
on
:
[
push
,
pull_request
]
jobs
:
unit
:
name
:
Test EVM
runs-on
:
ubuntu-latest
steps
:
-
name
:
Checkout Code
uses
:
actions/checkout@v2
-
name
:
Install Go + Node
run
:
|
sudo apt-get update
sudo apt-get -y --no-install-recommends install golang-1.16 nodejs npm
-
name
:
Install yarn
run
:
|
npm install --global yarn
yarn install
-
name
:
Test MIPS on EVM
run
:
cd mipsevm && ./evm.sh
mipsevm/evm.sh
View file @
fb6bfc83
#!/bin/bash
#!/bin/bash
-e
(
cd
../
&&
npx hardhat compile
)
&&
go build
&&
./mipsevm
$1
(
cd
../
&&
npx hardhat compile
)
&&
go build
&&
./mipsevm
$1
mipsevm/main.go
View file @
fb6bfc83
...
@@ -179,7 +179,7 @@ func runMinigeth(fn string, interpreter *vm.EVMInterpreter, bytecode []byte) {
...
@@ -179,7 +179,7 @@ func runMinigeth(fn string, interpreter *vm.EVMInterpreter, bytecode []byte) {
}
}
}
}
func
runTest
(
fn
string
,
steps
int
,
interpreter
*
vm
.
EVMInterpreter
,
bytecode
[]
byte
,
gas
uint64
)
{
func
runTest
(
fn
string
,
steps
int
,
interpreter
*
vm
.
EVMInterpreter
,
bytecode
[]
byte
,
gas
uint64
)
uint32
{
ram
=
make
(
map
[
uint64
](
uint32
))
ram
=
make
(
map
[
uint64
](
uint32
))
ram
[
0xC000007C
]
=
0xDEAD0000
ram
[
0xC000007C
]
=
0xDEAD0000
//fmt.Println("starting", fn)
//fmt.Println("starting", fn)
...
@@ -210,6 +210,7 @@ func runTest(fn string, steps int, interpreter *vm.EVMInterpreter, bytecode []by
...
@@ -210,6 +210,7 @@ func runTest(fn string, steps int, interpreter *vm.EVMInterpreter, bytecode []by
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
err
)
log
.
Fatal
(
err
)
}
}
return
ram
[
0xbffffff4
]
&
ram
[
0xbffffff8
]
}
}
func
main
()
{
func
main
()
{
...
@@ -270,9 +271,12 @@ func main() {
...
@@ -270,9 +271,12 @@ func main() {
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
err
)
log
.
Fatal
(
err
)
}
}
good
:=
true
for
_
,
f
:=
range
files
{
for
_
,
f
:=
range
files
{
runTest
(
"test/bin/"
+
f
.
Name
(),
100
,
interpreter
,
bytecode
,
1000000
)
good
=
good
&&
(
runTest
(
"test/bin/"
+
f
.
Name
(),
100
,
interpreter
,
bytecode
,
1000000
)
==
1
)
}
if
!
good
{
panic
(
"some tests failed"
)
}
}
}
}
}
}
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