mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +00:00
tests: add BAL specific tests
This commit is contained in:
parent
111e7b8b48
commit
6bf8f4fccb
3 changed files with 34 additions and 6 deletions
18
build/ci.go
18
build/ci.go
|
|
@ -160,6 +160,9 @@ var (
|
||||||
|
|
||||||
// This is where the tests should be unpacked.
|
// This is where the tests should be unpacked.
|
||||||
executionSpecTestsDir = "tests/spec-tests"
|
executionSpecTestsDir = "tests/spec-tests"
|
||||||
|
|
||||||
|
// This is where the bal-specific release of the tests should be unpacked.
|
||||||
|
executionSpecTestsBALDir = "tests/spec-tests-bal"
|
||||||
)
|
)
|
||||||
|
|
||||||
var GOBIN, _ = filepath.Abs(filepath.Join("build", "bin"))
|
var GOBIN, _ = filepath.Abs(filepath.Join("build", "bin"))
|
||||||
|
|
@ -398,6 +401,7 @@ func doTest(cmdline []string) {
|
||||||
// Get test fixtures.
|
// Get test fixtures.
|
||||||
if !*short {
|
if !*short {
|
||||||
downloadSpecTestFixtures(csdb, *cachedir)
|
downloadSpecTestFixtures(csdb, *cachedir)
|
||||||
|
downloadBALSpecTestFixtures(csdb, *cachedir)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure the toolchain.
|
// Configure the toolchain.
|
||||||
|
|
@ -463,6 +467,20 @@ func downloadSpecTestFixtures(csdb *download.ChecksumDB, cachedir string) string
|
||||||
return filepath.Join(cachedir, base)
|
return filepath.Join(cachedir, base)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// downloadBALSpecTestFixtures downloads and extracts the bal-specific execution-spec-tests fixtures.
|
||||||
|
func downloadBALSpecTestFixtures(csdb *download.ChecksumDB, cachedir string) string {
|
||||||
|
ext := ".tar.gz"
|
||||||
|
base := "fixtures_bal"
|
||||||
|
archivePath := filepath.Join(cachedir, base+ext)
|
||||||
|
if err := csdb.DownloadFileFromKnownURL(archivePath); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if err := build.ExtractArchive(archivePath, executionSpecTestsBALDir); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
return filepath.Join(cachedir, base)
|
||||||
|
}
|
||||||
|
|
||||||
// doCheckGenerate ensures that re-generating generated files does not cause
|
// doCheckGenerate ensures that re-generating generated files does not cause
|
||||||
// any mutations in the source file tree.
|
// any mutations in the source file tree.
|
||||||
func doCheckGenerate() {
|
func doCheckGenerate() {
|
||||||
|
|
|
||||||
|
|
@ -82,8 +82,17 @@ func TestBlockchain(t *testing.T) {
|
||||||
|
|
||||||
// TestExecutionSpecBlocktests runs the test fixtures from execution-spec-tests.
|
// TestExecutionSpecBlocktests runs the test fixtures from execution-spec-tests.
|
||||||
func TestExecutionSpecBlocktests(t *testing.T) {
|
func TestExecutionSpecBlocktests(t *testing.T) {
|
||||||
if !common.FileExist(executionSpecBlockchainTestDir) {
|
testExecutionSpecBlocktests(t, executionSpecBlockchainTestDir)
|
||||||
t.Skipf("directory %s does not exist", executionSpecBlockchainTestDir)
|
}
|
||||||
|
|
||||||
|
// TestExecutionSpecBlocktestsBAL runs the BAL release test fixtures from execution-spec-tests.
|
||||||
|
func TestExecutionSpecBlocktestsBAL(t *testing.T) {
|
||||||
|
testExecutionSpecBlocktests(t, executionSpecBALBlockchainTestDir)
|
||||||
|
}
|
||||||
|
|
||||||
|
func testExecutionSpecBlocktests(t *testing.T, testDir string) {
|
||||||
|
if !common.FileExist(testDir) {
|
||||||
|
t.Skipf("directory %s does not exist", testDir)
|
||||||
}
|
}
|
||||||
bt := new(testMatcher)
|
bt := new(testMatcher)
|
||||||
|
|
||||||
|
|
@ -96,7 +105,7 @@ func TestExecutionSpecBlocktests(t *testing.T) {
|
||||||
bt.skipLoad(`.*eip7610_create_collision/revert_in_create/.*`)
|
bt.skipLoad(`.*eip7610_create_collision/revert_in_create/.*`)
|
||||||
bt.skipLoad(`.*stRandom2/random_statetest642/.*`)
|
bt.skipLoad(`.*stRandom2/random_statetest642/.*`)
|
||||||
|
|
||||||
bt.walk(t, executionSpecBlockchainTestDir, func(t *testing.T, name string, test *BlockTest) {
|
bt.walk(t, testDir, func(t *testing.T, name string, test *BlockTest) {
|
||||||
execBlockTest(t, bt, test)
|
execBlockTest(t, bt, test)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,10 @@ var (
|
||||||
transactionTestDir = filepath.Join(baseDir, "TransactionTests")
|
transactionTestDir = filepath.Join(baseDir, "TransactionTests")
|
||||||
rlpTestDir = filepath.Join(baseDir, "RLPTests")
|
rlpTestDir = filepath.Join(baseDir, "RLPTests")
|
||||||
difficultyTestDir = filepath.Join(baseDir, "BasicTests")
|
difficultyTestDir = filepath.Join(baseDir, "BasicTests")
|
||||||
executionSpecBlockchainTestDir = filepath.Join(".", "spec-tests", "fixtures", "blockchain_tests")
|
executionSpecBlockchainTestDir = filepath.Join(".", "spec-tests", "fixtures", "blockchain_tests")
|
||||||
executionSpecStateTestDir = filepath.Join(".", "spec-tests", "fixtures", "state_tests")
|
executionSpecBALBlockchainTestDir = filepath.Join(".", "spec-tests-bal", "fixtures", "blockchain_tests")
|
||||||
executionSpecTransactionTestDir = filepath.Join(".", "spec-tests", "fixtures", "transaction_tests")
|
executionSpecStateTestDir = filepath.Join(".", "spec-tests", "fixtures", "state_tests")
|
||||||
|
executionSpecTransactionTestDir = filepath.Join(".", "spec-tests", "fixtures", "transaction_tests")
|
||||||
benchmarksDir = filepath.Join(".", "evm-benchmarks", "benchmarks")
|
benchmarksDir = filepath.Join(".", "evm-benchmarks", "benchmarks")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue