fixes test_block_witness

This commit is contained in:
jangko 2021-01-06 18:47:44 +07:00
parent 8037a563ea
commit 69787ed96a
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 9 additions and 3 deletions

View File

@ -101,12 +101,18 @@ proc testFixtureGST(node: JsonNode, testStatusIMPL: var TestStatus) =
fixture["pre"].testBlockWitness(emptyRlpHash, testStatusIMPL)
proc blockWitnessMain*(debugMode = false) =
const
legacyGSTFolder = "eth_tests" / "LegacyTests" / "Constantinople" / "GeneralStateTests"
newGSTFolder = "eth_tests" / "GeneralStateTests"
legacyBCFolder = "eth_tests" / "LegacyTests" / "Constantinople" / "BlockchainTests"
newBCFolder = "eth_tests" / "BlockChainTests"
if paramCount() == 0 or not debugMode:
# run all test fixtures
suite "Block Witness":
jsonTest("newBlockChainTests", "witnessBuilderBC", testFixtureBC)
jsonTest(newBCFolder, "witnessBuilderBC", testFixtureBC)
suite "Block Witness":
jsonTest("GeneralStateTests", "witnessBuilderGST", testFixtureGST)
jsonTest(newGSTFolder, "witnessBuilderGST", testFixtureGST)
else:
# execute single test in debug mode
let config = getConfiguration()
@ -114,7 +120,7 @@ proc blockWitnessMain*(debugMode = false) =
echo "missing test subject"
quit(QuitFailure)
let folder = if config.legacy: "GeneralStateTests" else: "newGeneralStateTests"
let folder = if config.legacy: legacyGSTFolder else: newGSTFolder
let path = "tests" / "fixtures" / folder
let n = json.parseFile(path / config.testSubject)
var testStatusIMPL: TestStatus