Commit fb6bfc83 authored by George Hotz's avatar George Hotz

mips regression tests

parent 2fe59f43
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
#!/bin/bash
#!/bin/bash -e
(cd ../ && npx hardhat compile) && go build && ./mipsevm $1
......@@ -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[0xC000007C] = 0xDEAD0000
//fmt.Println("starting", fn)
......@@ -210,6 +210,7 @@ func runTest(fn string, steps int, interpreter *vm.EVMInterpreter, bytecode []by
if err != nil {
log.Fatal(err)
}
return ram[0xbffffff4] & ram[0xbffffff8]
}
func main() {
......@@ -270,9 +271,12 @@ func main() {
if err != nil {
log.Fatal(err)
}
good := true
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")
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment