mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-02 15:24:01 +00:00
Refactor: remove .sh dependency for tests
This commit is contained in:
parent
1cf5e6694b
commit
3852c84841
BIN
build/all_tests
Executable file
BIN
build/all_tests
Executable file
Binary file not shown.
@ -1,9 +1,7 @@
|
|||||||
-p:"../src"
|
|
||||||
|
|
||||||
# TODO FIXME
|
# TODO FIXME
|
||||||
# Default compiler on Mac is Clang.
|
# Default compiler on Mac is Clang.
|
||||||
# Currently it does not compile due to "Flexible array member with non-trivial destruction"
|
# Currently it does not compile due to "Flexible array member with non-trivial destruction"
|
||||||
# See https://github.com/status-im/nimbus/issues/2
|
# See https://github.com/status-im/nimbus/issues/2 and https://github.com/status-im/nim-ttmath/issues/10
|
||||||
# As a workaround, forces GCC-7 on Mac
|
# As a workaround, forces GCC-7 on Mac
|
||||||
# GCC-7 is available through Homebrew
|
# GCC-7 is available through Homebrew
|
||||||
|
|
@ -7,10 +7,20 @@ description = "An Ethereum 2.0 Sharding Client for Resource-Restricted Devices
|
|||||||
license = "Apache License 2.0"
|
license = "Apache License 2.0"
|
||||||
skipDirs = @["tests"]
|
skipDirs = @["tests"]
|
||||||
|
|
||||||
requires "nim >= 0.17.0",
|
requires "nim >= 0.18.1",
|
||||||
"https://github.com/status-im/nim-keccak-tiny.git >= 0.1.0",
|
"https://github.com/status-im/nim-keccak-tiny.git >= 0.1.0",
|
||||||
"https://github.com/alehander42/nim-rlp.git#fix-ordinal",
|
"https://github.com/alehander42/nim-rlp#fix-ordinal", #TODO switching to the Status repo throws: "Error: undeclared identifier: 'Range'"
|
||||||
"https://github.com/status-im/nim-ttmath >= 0.5.0"
|
"https://github.com/status-im/nim-ttmath#master"
|
||||||
|
|
||||||
|
|
||||||
|
proc test(name: string, lang = "cpp") =
|
||||||
|
if not dirExists "build":
|
||||||
|
mkDir "build"
|
||||||
|
if not dirExists "nimcache":
|
||||||
|
mkDir "nimcache"
|
||||||
|
--run
|
||||||
|
--nimcache: "nimcache"
|
||||||
|
switch("out", ("./build/" & name))
|
||||||
|
setCommand lang, "tests/" & name & ".nim"
|
||||||
|
|
||||||
|
task test, "Run tests":
|
||||||
|
test "all_tests"
|
||||||
|
5
tests/all_tests.nim
Normal file
5
tests/all_tests.nim
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import ./test_code_stream,
|
||||||
|
./test_gas_meter,
|
||||||
|
./test_memory,
|
||||||
|
./test_stack
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
nim cpp tests/code_stream_test.nim
|
|
||||||
nim cpp tests/gas_meter_test.nim
|
|
||||||
nim cpp tests/memory_test.nim
|
|
||||||
nim cpp tests/stack_test.nim
|
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
./tests/code_stream_test
|
|
||||||
./tests/gas_meter_test
|
|
||||||
./tests/memory_test
|
|
||||||
./tests/stack_test
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
|||||||
import unittest, strutils, sequtils, opcode_values, vm / code_stream
|
import unittest, strutils, sequtils,
|
||||||
|
../src/opcode_values, ../src/vm/code_stream
|
||||||
|
|
||||||
suite "parse bytecode":
|
suite "parse bytecode":
|
||||||
test "accepts bytes":
|
test "accepts bytes":
|
@ -1,4 +1,6 @@
|
|||||||
import unittest, macros, strformat, strutils, sequtils, constants, opcode_values, errors, logging, vm / gas_meter, ttmath
|
import unittest, macros, strformat, strutils, sequtils,
|
||||||
|
ttmath,
|
||||||
|
../src/[constants, opcode_values, errors, logging, vm/gas_meter]
|
||||||
|
|
||||||
# TODO: quicktest
|
# TODO: quicktest
|
||||||
# PS: parametrize can be easily immitated, but still quicktests would be even more useful
|
# PS: parametrize can be easily immitated, but still quicktests would be even more useful
|
@ -1,4 +1,6 @@
|
|||||||
import unittest, macros, strformat, strutils, sequtils, constants, opcode_values, errors, vm / memory, ttmath
|
import unittest, macros, strformat, strutils, sequtils,
|
||||||
|
ttmath,
|
||||||
|
../src/[constants, opcode_values, errors, vm/memory]
|
||||||
|
|
||||||
proc memory32: Memory =
|
proc memory32: Memory =
|
||||||
result = newMemory()
|
result = newMemory()
|
@ -1,4 +1,7 @@
|
|||||||
import unittest, macros, strformat, strutils, sequtils, constants, opcode_values, errors, vm / [stack, value], ttmath, utils / [bytes, padding], utils_numeric
|
import unittest, macros, strformat, strutils, sequtils,
|
||||||
|
ttmath,
|
||||||
|
../src/[constants, opcode_values, errors, utils_numeric, vm/stack, vm/value, utils/bytes, utils/padding]
|
||||||
|
|
||||||
|
|
||||||
template testPush(value: untyped, expected: untyped): untyped =
|
template testPush(value: untyped, expected: untyped): untyped =
|
||||||
var stack = newStack()
|
var stack = newStack()
|
Loading…
x
Reference in New Issue
Block a user