From 03bed0251291bfe142400bc4312a32c174de32d6 Mon Sep 17 00:00:00 2001 From: jangko Date: Thu, 14 Jan 2021 21:33:18 +0700 Subject: [PATCH] split legacy and new test to save time --- tests/test_blockchain_json.nim | 14 ++++++++------ tests/test_generalstate_json.nim | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/tests/test_blockchain_json.nim b/tests/test_blockchain_json.nim index 78eec7be9..7558bfb74 100644 --- a/tests/test_blockchain_json.nim +++ b/tests/test_blockchain_json.nim @@ -763,15 +763,17 @@ proc blockchainJsonMain*(debugMode = false) = legacyFolder = "eth_tests" / "LegacyTests" / "Constantinople" / "BlockchainTests" newFolder = "eth_tests" / "BlockChainTests" - if paramCount() == 0 or not debugMode: + let config = test_config.getConfiguration() + if config.testSubject == "" or not debugMode: # run all test fixtures - suite "block chain json tests": - jsonTest(legacyFolder, "BlockchainTests", testFixture, skipBCTests) - suite "new block chain json tests": - jsonTest(newFolder, "newBlockchainTests", testFixture, skipNewBCTests) + if config.legacy: + suite "block chain json tests": + jsonTest(legacyFolder, "BlockchainTests", testFixture, skipBCTests) + else: + suite "new block chain json tests": + jsonTest(newFolder, "newBlockchainTests", testFixture, skipNewBCTests) else: # execute single test in debug mode - let config = test_config.getConfiguration() if config.testSubject.len == 0: echo "missing test subject" quit(QuitFailure) diff --git a/tests/test_generalstate_json.nim b/tests/test_generalstate_json.nim index b23392a81..f58513943 100644 --- a/tests/test_generalstate_json.nim +++ b/tests/test_generalstate_json.nim @@ -197,15 +197,17 @@ proc generalStateJsonMain*(debugMode = false) = legacyFolder = "eth_tests" / "LegacyTests" / "Constantinople" / "GeneralStateTests" newFolder = "eth_tests" / "GeneralStateTests" - if paramCount() == 0 or not debugMode: + let config = getConfiguration() + if config.testSubject == "" or not debugMode: # run all test fixtures - suite "generalstate json tests": - jsonTest(legacyFolder , "GeneralStateTests", testFixture, skipGSTTests) - suite "new generalstate json tests": - jsonTest(newFolder, "newGeneralStateTests", testFixture, skipNewGSTTests) + if config.legacy: + suite "generalstate json tests": + jsonTest(legacyFolder , "GeneralStateTests", testFixture, skipGSTTests) + else: + suite "new generalstate json tests": + jsonTest(newFolder, "newGeneralStateTests", testFixture, skipNewGSTTests) else: # execute single test in debug mode - let config = getConfiguration() if config.testSubject.len == 0: echo "missing test subject" quit(QuitFailure)