Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

testeth print test suite suggestions #5588

Merged
merged 3 commits into from
May 29, 2019
Merged

testeth print test suite suggestions #5588

merged 3 commits into from
May 29, 2019

Conversation

winsvega
Copy link
Contributor

@winsvega winsvega commented May 1, 2019

when typing ./testeth -t <TestSuiteName>/<TestCaseName>
in case of typo testeth will look on available test suites and print a suggestion

@winsvega winsvega requested a review from gumb0 May 1, 2019 15:14
Copy link
Member

@gumb0 gumb0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows build doesn't like the huge string literal, any ideas how to fix?

@gumb0 gumb0 requested a review from chfast May 2, 2019 15:39
@winsvega
Copy link
Contributor Author

winsvega commented May 2, 2019

split into multiple lines?

@gumb0
Copy link
Member

gumb0 commented May 2, 2019

Not sure if making it like

std::string boostall_unit_tests = "suite1/test1""suite1/test2""suite1/test3"; // etc.

will help, maybe not.
But it's a simple thing to try, just delimit with "" instead of space.

(I think I would try to do it at runtime with a visitor like here https://stackoverflow.com/a/8560992 seems simple enough)

@winsvega
Copy link
Contributor Author

winsvega commented May 2, 2019

visitor requires global fixture that does not work if we use auto_test_fixture

@gumb0
Copy link
Member

gumb0 commented May 3, 2019

You could also make it an array of strings instead of one string, and concatenate or do anything you want with it at runtime, it should work.

@codecov-io
Copy link

codecov-io commented May 4, 2019

Codecov Report

Merging #5588 into master will increase coverage by 0.08%.
The diff coverage is 90.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5588      +/-   ##
==========================================
+ Coverage   62.43%   62.51%   +0.08%     
==========================================
  Files         350      350              
  Lines       29548    29648     +100     
  Branches     3326     3335       +9     
==========================================
+ Hits        18448    18535      +87     
- Misses       9898     9905       +7     
- Partials     1202     1208       +6

test/CMakeLists.txt Outdated Show resolved Hide resolved
test/CMakeLists.txt Outdated Show resolved Hide resolved
hunter_add_package(yaml-cpp)
find_package(yaml-cpp CONFIG REQUIRED)

add_executable(testeth ${sources})
target_include_directories(testeth PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this add a directory to which configure_file(tools/libtesteth/cmakeAllTests.h.in tools/libtesteth/cmakeAllTests.h) file is generated as include. its generated into build directory

test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/cmakeAllTests.h.in Outdated Show resolved Hide resolved
test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/TestHelper.cpp Outdated Show resolved Hide resolved
@winsvega winsvega force-pushed the testeth branch 2 times, most recently from 484e23f to 6ed646c Compare May 8, 2019 15:52
@winsvega
Copy link
Contributor Author

winsvega commented May 8, 2019

updated the test name suggestion even better now

ideally we could do a search in test name strings and increase the weight of a test name if there is search match. so for example if I type -t shanghai I would get shanghai test suggestion event if the actual test name and shanghai string are too different for levenshteinDistance.

@winsvega winsvega requested a review from gumb0 May 8, 2019 20:31
test/CMakeLists.txt Outdated Show resolved Hide resolved
test/tools/libtesteth/cmakeAllTests.h.in Outdated Show resolved Hide resolved
@gumb0
Copy link
Member

gumb0 commented May 9, 2019

I'm lost now in the cmake magic, what does c_allTests exactly contains now? Does it contain duplicates?

@chfast
Copy link
Member

chfast commented May 9, 2019

I'm lost now in the cmake magic, what does c_allTests exactly contains now? Does it contain duplicates?

It will be an array of string literals with names. They might be duplicated.

@gumb0
Copy link
Member

gumb0 commented May 9, 2019

I tried it and this is what it generates

#pragma once

char const* c_allTests[] = 
{
   "BlockchainTests/bcStateTests",
   "BlockchainTests",
   "BlockchainTests/bcBlockGasLimitTest",
   "BlockchainTests/bcGasPricerTest",
   "BlockchainTests/bcInvalidHeaderTest",
   "BlockchainTests/bcUncleHeaderValidity",
   "BlockchainTests/bcUncleTest",
   "BlockchainTests/bcValidBlockTest",
   "BlockchainTests/bcWalletTest",
   "BlockchainTests/bcTotalDifficultyTest",
   "BlockchainTests/bcMultiChainTest",
   "BlockchainTests/bcForkStressTest",
   "BlockchainTests/bcForgedTest",
   "BlockchainTests/bcRandomBlockhashTest",
   "BlockchainTests/bcExploitTest",
   "BlockchainTests/bcUncleSpecialTests",
   "TransitionTests/bcFrontierToHomestead",
   "TransitionTests",
   "TransitionTests/bcHomesteadToDao",
   "TransitionTests/bcHomesteadToEIP150",
   "TransitionTests/bcEIP158ToByzantium",
   "TransitionTests/bcByzantiumToConstantinopleFix",
   "BCGeneralStateTests/stCallCodes",
   "BCGeneralStateTests",
   "BCGeneralStateTests/stCallCreateCallCodeTest",
   "BCGeneralStateTests/stExample",
   "BCGeneralStateTests/stInitCodeTest",
   "BCGeneralStateTests/stLogTests",
   "BCGeneralStateTests/stMemoryTest",
   "BCGeneralStateTests/stPreCompiledContracts",
   "BCGeneralStateTests/stPreCompiledContracts2",
   "BCGeneralStateTests/stRandom",
   "BCGeneralStateTests/stRandom2",
   "BCGeneralStateTests/stRecursiveCreate",
   "BCGeneralStateTests/stRefundTest",
   "BCGeneralStateTests/stSolidityTest",
   "BCGeneralStateTests/stSpecialTest",
   "BCGeneralStateTests/stSystemOperationsTest",
   "BCGeneralStateTests/stTransactionTest",
   "BCGeneralStateTests/stTransitionTest",
   "BCGeneralStateTests/stWalletTest",
   "BCGeneralStateTests/stCallDelegateCodesCallCodeHomestead",
   "BCGeneralStateTests/stCallDelegateCodesHomestead",
   "BCGeneralStateTests/stHomesteadSpecific",
   "BCGeneralStateTests/stDelegatecallTestHomestead",
   "BCGeneralStateTests/stChangedEIP150",
   "BCGeneralStateTests/stEIP150singleCodeGasPrices",
   "BCGeneralStateTests/stMemExpandingEIP150Calls",
   "BCGeneralStateTests/stEIP150Specific",
   "BCGeneralStateTests/stEIP158Specific",
   "BCGeneralStateTests/stNonZeroCallsTest",
   "BCGeneralStateTests/stZeroCallsTest",
   "BCGeneralStateTests/stZeroCallsRevert",
   "BCGeneralStateTests/stCodeSizeLimit",
   "BCGeneralStateTests/stCreateTest",
   "BCGeneralStateTests/stRevertTest",
   "BCGeneralStateTests/stStackTests",
   "BCGeneralStateTests/stStaticCall",
   "BCGeneralStateTests/stReturnDataTest",
   "BCGeneralStateTests/stZeroKnowledge",
   "BCGeneralStateTests/stZeroKnowledge2",
   "BCGeneralStateTests/stBugs",
   "BCGeneralStateTests/stShift",
   "BCGeneralStateTests/stCreate2",
   "BCGeneralStateTests/stExtCodeHash",
   "BCGeneralStateTests/stSStoreTest",
   "BCGeneralStateTests/stAttackTest",
   "BCGeneralStateTests/stMemoryStressTest",
   "BCGeneralStateTests/stQuadraticComplexityTest",
   "BCGeneralStateTests/stBadOpcode",
   "BCGeneralStateTests/stArgsZeroOneBalance",
   "BCGeneralStateTests/stTimeConsuming",
   "RlpTests/invalidRLPtest",
   "RlpTests",
   "RlpTests/rlptest",
   "RlpTests/rlpRandom",
   "GeneralStateTests/stCallCodes",
   "GeneralStateTests",
   "GeneralStateTests/stCallCreateCallCodeTest",
   "GeneralStateTests/stExample",
   "GeneralStateTests/stInitCodeTest",
   "GeneralStateTests/stLogTests",
   "GeneralStateTests/stMemoryTest",
   "GeneralStateTests/stPreCompiledContracts",
   "GeneralStateTests/stPreCompiledContracts2",
   "GeneralStateTests/stRandom",
   "GeneralStateTests/stRandom2",
   "GeneralStateTests/stRecursiveCreate",
   "GeneralStateTests/stRefundTest",
   "GeneralStateTests/stSolidityTest",
   "GeneralStateTests/stSpecialTest",
   "GeneralStateTests/stSystemOperationsTest",
   "GeneralStateTests/stTransactionTest",
   "GeneralStateTests/stTransitionTest",
   "GeneralStateTests/stWalletTest",
   "GeneralStateTests/stCallDelegateCodesCallCodeHomestead",
   "GeneralStateTests/stCallDelegateCodesHomestead",
   "GeneralStateTests/stHomesteadSpecific",
   "GeneralStateTests/stDelegatecallTestHomestead",
   "GeneralStateTests/stChangedEIP150",
   "GeneralStateTests/stEIP150singleCodeGasPrices",
   "GeneralStateTests/stMemExpandingEIP150Calls",
   "GeneralStateTests/stEIP150Specific",
   "GeneralStateTests/stEIP158Specific",
   "GeneralStateTests/stNonZeroCallsTest",
   "GeneralStateTests/stZeroCallsTest",
   "GeneralStateTests/stZeroCallsRevert",
   "GeneralStateTests/stCodeSizeLimit",
   "GeneralStateTests/stCreateTest",
   "GeneralStateTests/stRevertTest",
   "GeneralStateTests/stStackTests",
   "GeneralStateTests/stStaticCall",
   "GeneralStateTests/stReturnDataTest",
   "GeneralStateTests/stZeroKnowledge",
   "GeneralStateTests/stZeroKnowledge2",
   "GeneralStateTests/stCodeCopyTest",
   "GeneralStateTests/stBugs",
   "GeneralStateTests/stShift",
   "GeneralStateTests/stCreate2",
   "GeneralStateTests/stExtCodeHash",
   "GeneralStateTests/stSStoreTest",
   "GeneralStateTests/stAttackTest",
   "GeneralStateTests/stMemoryStressTest",
   "GeneralStateTests/stQuadraticComplexityTest",
   "GeneralStateTests/stBadOpcode",
   "GeneralStateTests/stArgsZeroOneBalance",
   "GeneralStateTests/stEWASMTests",
   "GeneralStateTests/stTimeConsuming",
   "TransactionTests/ttAddress",
   "TransactionTests",
   "TransactionTests/ttData",
   "TransactionTests/ttGasLimit",
   "TransactionTests/ttGasPrice",
   "TransactionTests/ttNonce",
   "TransactionTests/ttRSValue",
   "TransactionTests/ttValue",
   "TransactionTests/ttVValue",
   "TransactionTests/ttSignature",
   "TransactionTests/ttWrongRLP",
   "VMTests/vmArithmeticTest",
   "VMTests",
   "VMTests/vmBitwiseLogicOperation",
   "VMTests/vmBlockInfoTest",
   "VMTests/vmEnvironmentalInfo",
   "VMTests/vmIOandFlowOperations",
   "VMTests/vmLogTest",
   "VMTests/vmPerformance",
   "VMTests/vmPushDupSwapTest",
   "VMTests/vmRandomTest",
   "VMTests/vmSha3Test",
   "VMTests/vmSystemOperations",
   "VMTests/vmTests",
   "LibSnark/ecadd",
   "LibSnark",
   "LibSnark/fieldPointInvalid",
   "LibSnark/invalid",
   "LibSnark/ecmul_add",
   "LibSnark/pairing",
   "LibSnark/pairingNullInput",
   "LibSnark/generateRandomPoints",
   "LibSnark/benchECADD",
   "LibSnark/benchECMULRand",
   "LibSnark/benchECMULWorstCase1",
   "LibSnark/benchECMULWorstCase2",
   "LibSnark/benchECMULIdentity",
   "LibSnark/ECMULuseCaseFromRopsten",
   "Crypto/KeyStore/basic_tests",
   "Crypto/KeyStore",
   "Crypto/KeyStore/import_key_from_file",
   "Crypto/KeyStore/import_secret",
   "Crypto/KeyStore/import_secret_bytesConstRef",
   "Crypto/KeyStore/wrong_password",
   "Crypto/KeyStore/recode",
   "Crypto/KeyStore/keyImport_PBKDF2SHA256",
   "Crypto/KeyStore/keyImport_Scrypt",
   "Crypto/KeyStore/keyImport__ScryptV2",
   "Crypto/devcrypto/sha3general",
   "Crypto/devcrypto",
   "Crypto/devcrypto/emptySHA3Types",
   "Crypto/devcrypto/pubkeyOfZero",
   "Crypto/devcrypto/KeyPairMix",
   "Crypto/devcrypto/keypairs",
   "Crypto/devcrypto/KeyPairVerifySecret",
   "Crypto/devcrypto/SignAndRecover",
   "Crypto/devcrypto/SignAndRecoverLoop",
   "Crypto/devcrypto/cryptopp_patch",
   "Crypto/devcrypto/verify_secert",
   "Crypto/devcrypto/verifyWithPublicCompressed",
   "Crypto/devcrypto/signAndVerify",
   "Crypto/devcrypto/common_encrypt_decrypt",
   "Crypto/devcrypto/sha3_norestart",
   "Crypto/devcrypto/ecies_kdf",
   "Crypto/devcrypto/ecdh_agree_invalid_pubkey",
   "Crypto/devcrypto/ecdh_agree_invalid_seckey",
   "Crypto/devcrypto/ecies_standard",
   "Crypto/devcrypto/ecies_sharedMacData",
   "Crypto/devcrypto/ecies_eckeypair",
   "Crypto/devcrypto/ecdhCryptopp",
   "Crypto/devcrypto/ecdhe",
   "Crypto/devcrypto/ecdhAgree",
   "Crypto/devcrypto/handshakeNew",
   "Crypto/devcrypto/ecies_aes128_ctr_unaligned",
   "Crypto/devcrypto/ecies_aes128_ctr",
   "Crypto/devcrypto/cryptopp_aes128_ctr",
   "Crypto/devcrypto/cryptopp_aes128_cbc",
   "Crypto/devcrypto/recoverVgt3",
   "Crypto/devcrypto/PerfSHA256_32",
   "Crypto/devcrypto/PerfSHA256_4000",
   "Crypto/Basic/hexPrefix_test",
   "Crypto/Basic",
   "Crypto/Basic/base64",
   "Crypto/Trie/fat_trie",
   "Crypto/Trie",
   "Crypto/Trie/hex_encoded_securetrie_test",
   "Crypto/Trie/trie_test_anyorder",
   "Crypto/Trie/trie_tests_ordered",
   "Crypto/Trie/moreTrieTests",
   "Crypto/Trie/trieLowerBound",
   "Crypto/Trie/hashedLowerBound",
   "Crypto/Trie/trieStess",
   "Crypto/Trie/triePerf",
   "PrecompiledTests/modexpFermatTheorem",
   "PrecompiledTests",
   "PrecompiledTests/modexpZeroBase",
   "PrecompiledTests/modexpExtraByteIgnored",
   "PrecompiledTests/modexpRightPadding",
   "PrecompiledTests/modexpMissingValues",
   "PrecompiledTests/modexpEmptyValue",
   "PrecompiledTests/modexpZeroPowerZero",
   "PrecompiledTests/modexpZeroPowerZeroModZero",
   "PrecompiledTests/modexpModLengthZero",
   "PrecompiledTests/modexpCostFermatTheorem",
   "PrecompiledTests/modexpCostTooLarge",
   "PrecompiledTests/modexpCostEmptyExponent",
   "PrecompiledTests/modexpCostZeroExponent",
   "PrecompiledTests/modexpCostApproximated",
   "PrecompiledTests/modexpCostApproximatedPartialByte",
   "PrecompiledTests/modexpCostApproximatedGhost",
   "PrecompiledTests/modexpCostMidRange",
   "PrecompiledTests/modexpCostHighRange",
   "PrecompiledTests/bench_ecrecover",
   "PrecompiledTests/bench_modexp",
   "PrecompiledTests/bench_bn256Add",
   "PrecompiledTests/bench_bn256ScalarMul",
   "PrecompiledTests/bench_bn256Pairing",
   "SealEngineTests/UnsignedTransactionTests/UnsignedTransactionIsValidBeforeExperimental",
   "SealEngineTests/UnsignedTransactionTests",
   "SealEngineTests/UnsignedTransactionTests/UnsignedTransactionIsValidInExperimental",
   "DifficultyTests/difficultyTestsFrontier",
   "DifficultyTests",
   "DifficultyTests/difficultyTestsRopsten",
   "DifficultyTests/difficultyTestsHomestead",
   "DifficultyTests/difficultyByzantium",
   "DifficultyTests/difficultyConstantinople",
   "DifficultyTests/difficultyTestsMainNetwork",
   "DifficultyTests/difficultyTestsCustomMainNetwork",
   "DifficultyTests/basicDifficultyTest",
   "BlockSuite/FrontierBlockSuite/bStates",
   "BlockSuite/FrontierBlockSuite",
   "BlockSuite/FrontierBlockSuite/bCopyOperator",
   "BlockSuite/bGasPricer",
   "BlockSuite",
   "BlockSuite/bGetReceiptOverflow",
   "BlockSuite/ByzantiumBlockSuite/bByzantiumBlockReward",
   "BlockSuite/ByzantiumBlockSuite",
   "BlockSuite/ConstantinopleBlockSuite/bConstantinopleBlockReward",
   "BlockSuite/ConstantinopleBlockSuite",
   "BlockSuite/ExperimentalBlockSuite/bBlockhashContractIsCreated",
   "BlockSuite/ExperimentalBlockSuite",
   "BlockSuite/ExperimentalBlockSuite/bBlockhashContractIsUpdated",
   "BlockChainFrontierSuite/output",
   "BlockChainFrontierSuite",
   "BlockChainFrontierSuite/opendb",
   "BlockChainFrontierSuite/Mining_1_mineBlockWithTransaction",
   "BlockChainFrontierSuite/Mining_2_mineUncles",
   "BlockChainFrontierSuite/insertWithoutParent",
   "BlockChainMainNetworkSuite/Mining_5_BlockFutureTime",
   "BlockChainMainNetworkSuite",
   "BlockChainMainNetworkSuite/attemptImport",
   "BlockChainMainNetworkSuite/insert",
   "BlockChainMainNetworkSuite/insertException",
   "BlockChainMainNetworkSuite/rescue",
   "BlockChainMainNetworkSuite/updateStats",
   "BlockChainMainNetworkSuite/invalidJsonThrows",
   "BlockChainMainNetworkSuite/unknownFieldThrows",
   "BlockChainInsertTests/bcBasicInsert",
   "BlockChainInsertTests",
   "ClientBase/blocks",
   "ClientBase",
   "ClientTestSuite/ClientTest_setChainParamsAuthor",
   "ClientTestSuite",
   "ExtVmSuite/BlockhashOutOfBoundsRetunsZero",
   "ExtVmSuite",
   "ExtVmSuite/BlockhashBeforeExperimentalReliesOnLastHashes",
   "ExtVmSuite/BlockhashDoesntNeedLastHashesInExperimental",
   "GasPricer/trivialGasPricer",
   "GasPricer",
   "GasPricer/basicGasPricerNoUpdate",
   "GasPricer/basicGasPricer_RPC_API_Test_Frontier",
   "GasPricer/basicGasPricer_RPC_API_Test_Homestead",
   "GasPricer/basicGasPricer_bcValidBlockTest",
   "GasPricer/basicGasPricer_bcUncleTest_Frontier",
   "GasPricer/basicGasPricer_bcUncleTest_Homestead",
   "GasPricer/basicGasPricer_bcUncleHeaderValidity_Frontier",
   "GasPricer/basicGasPricer_bcUncleHeaderValidity_Homestead",
   "GasPricer/basicGasPricer_notxs_frontier",
   "GasPricer/basicGasPricer_notxs_homestead",
   "GasPricer/basicGasPricer_highGasUsage_LowestPrio",
   "GasPricer/basicGasPricer_highGasUsage_LowPrio",
   "GasPricer/basicGasPricer_highGasUsage_MediumPrio",
   "GasPricer/basicGasPricer_highGasUsage_HighPrio",
   "GasPricer/basicGasPricer_highGasUsage_HighestPrio",
   "BasicTests/emptySHA3Types",
   "BasicTests",
   "BasicTests/genesis_tests",
   "SnapshotImporterSuite/SnapshotImporterSuite_importChecksManifestVersion",
   "SnapshotImporterSuite",
   "SnapshotImporterSuite/SnapshotImporterSuite_importNonsplittedAccount",
   "SnapshotImporterSuite/SnapshotImporterSuite_importSplittedAccount",
   "SnapshotImporterSuite/SnapshotImporterSuite_importAccountWithCode",
   "SnapshotImporterSuite/SnapshotImporterSuite_importAccountsWithEqualCode",
   "SnapshotImporterSuite/SnapshotImporterSuite_commitStateOnceEveryChunk",
   "SnapshotImporterSuite/SnapshotImporterSuite_importEmptyBlock",
   "SnapshotImporterSuite/SnapshotImporterSuite_importBlockWithTransactions",
   "StateUnitTests/Basic",
   "StateUnitTests",
   "StateUnitTests/LoadAccountCode",
   "StateUnitTests/StateAddressRangeTests/addressesReturnsAllAddresses",
   "StateUnitTests/StateAddressRangeTests",
   "StateUnitTests/StateAddressRangeTests/addressesReturnsNoMoreThanRequested",
   "StateUnitTests/StateAddressRangeTests/addressesDoesntReturnDeletedInCache",
   "StateUnitTests/StateAddressRangeTests/addressesReturnsCreatedInCache",
   "libethereum/TransactionGasRequired",
   "libethereum",
   "libethereum/ExecutionResultOutput",
   "libethereum/transactionExceptionOutput",
   "libethereum/toTransactionExceptionConvert",
   "libethereum/GettingSenderForUnsignedTransactionThrows",
   "libethereum/GettingSignatureForUnsignedTransactionThrows",
   "libethereum/StreamRLPWithSignatureForUnsignedTransactionThrows",
   "libethereum/CheckLowSForUnsignedTransactionThrows",
   "TransactionQueueSuite/TransactionEIP86",
   "TransactionQueueSuite",
   "TransactionQueueSuite/tqMaxNonce",
   "TransactionQueueSuite/tqPriority",
   "TransactionQueueSuite/tqFuture",
   "TransactionQueueSuite/tqLimits",
   "TransactionQueueSuite/tqImport",
   "TransactionQueueSuite/tqDrop",
   "TransactionQueueSuite/tqLimit",
   "TransactionQueueSuite/tqEqueue",
   "LegacyVMSuite/LegacyVMCreate2Suite/LegacyVMCreate2worksInConstantinople",
   "LegacyVMSuite/LegacyVMCreate2Suite",
   "LegacyVMSuite/LegacyVMCreate2Suite/LegacyVMCreate2isInvalidBeforeConstantinople",
   "LegacyVMSuite/LegacyVMCreate2Suite/LegacyVMCreate2succeedsIfAddressHasEther",
   "LegacyVMSuite/LegacyVMCreate2Suite/LegacyVMCreate2doesntChangeContractIfAddressExists",
   "LegacyVMSuite/LegacyVMCreate2Suite/LegacyVMCreate2isForbiddenInStaticCall",
   "LegacyVMSuite/LegacyVMCreate2Suite/LegacyVMCreate2collisionWithNonEmptyStorage",
   "LegacyVMSuite/LegacyVMCreate2Suite/LegacyVMCreate2collisionWithNonEmptyStorageEmptyInitCode",
   "LegacyVMSuite/LegacyVMCreate2Suite/LegacyVMCreate2costIncludesInitCodeHashing",
   "LegacyVMSuite/LegacyVMExtcodehashSuite/LegacyVMExtcodehashWorksInConstantinople",
   "LegacyVMSuite/LegacyVMExtcodehashSuite",
   "LegacyVMSuite/LegacyVMExtcodehashSuite/LegacyVMExtcodehashHasCorrectCost",
   "LegacyVMSuite/LegacyVMExtcodehashSuite/LegacyVMExtcodehashIsInvalidConstantinople",
   "LegacyVMSuite/LegacyVMExtcodehashSuite/LegacyVMExtCodeHashOfNonContractAccount",
   "LegacyVMSuite/LegacyVMExtcodehashSuite/LegacyVMExtCodeHashOfNonExistentAccount",
   "LegacyVMSuite/LegacyVMExtcodehashSuite/LegacyVMExtCodeHashOfPrecomileZeroBalance",
   "LegacyVMSuite/LegacyVMExtcodehashSuite/LegacyVMExtCodeHashOfPrecomileNonZeroBalance",
   "LegacyVMSuite/LegacyVMExtcodehashSuite/LegacyVMExtcodehashIgnoresHigh12Bytes",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case1",
   "LegacyVMSuite/LegacyVMSstoreSuite",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case2",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case3",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case4",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case5",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case6",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case7",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case8",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case9",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case10",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case11",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case12",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case13",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case14",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case15",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case16",
   "LegacyVMSuite/LegacyVMSstoreSuite/LegacyVMSstoreEip1283Case17",
   "AlethInterpreterSuite/AlethInterpreterCreate2Suite/AlethInterpreterCreate2worksInConstantinople",
   "AlethInterpreterSuite/AlethInterpreterCreate2Suite",
   "AlethInterpreterSuite/AlethInterpreterCreate2Suite/AlethInterpreterCreate2isInvalidBeforeConstantinople",
   "AlethInterpreterSuite/AlethInterpreterCreate2Suite/AlethInterpreterCreate2succeedsIfAddressHasEther",
   "AlethInterpreterSuite/AlethInterpreterCreate2Suite/AlethInterpreterCreate2doesntChangeContractIfAddressExists",
   "AlethInterpreterSuite/AlethInterpreterCreate2Suite/AlethInterpreterCreate2isForbiddenInStaticCall",
   "AlethInterpreterSuite/AlethInterpreterCreate2Suite/AlethInterpreterCreate2collisionWithNonEmptyStorage",
   "AlethInterpreterSuite/AlethInterpreterCreate2Suite/AlethInterpreterCreate2collisionWithNonEmptyStorageEmptyInitCode",
   "AlethInterpreterSuite/AlethInterpreterExtcodehashSuite/AlethInterpreterExtcodehashWorksInConstantinople",
   "AlethInterpreterSuite/AlethInterpreterExtcodehashSuite",
   "AlethInterpreterSuite/AlethInterpreterExtcodehashSuite/AlethInterpreterExtcodehashIsInvalidConstantinople",
   "AlethInterpreterSuite/AlethInterpreterExtcodehashSuite/AlethInterpreterExtCodeHashOfNonContractAccount",
   "AlethInterpreterSuite/AlethInterpreterExtcodehashSuite/AlethInterpreterExtCodeHashOfNonExistentAccount",
   "AlethInterpreterSuite/AlethInterpreterExtcodehashSuite/AlethInterpreterExtCodeHashOfPrecomileZeroBalance",
   "AlethInterpreterSuite/AlethInterpreterExtcodehashSuite/AlethInterpreterExtCodeHashOfPrecomileNonZeroBalance",
   "AlethInterpreterSuite/AlethInterpreterExtcodehashSuite/AlethInterpreterExtCodeHashIgnoresHigh12Bytes",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case1",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case2",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case3",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case4",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case5",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case6",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case7",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case8",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case9",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case10",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case11",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case12",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case13",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case14",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case15",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case16",
   "AlethInterpreterSuite/AlethInterpreterSstoreSuite/AlethInterpreterSstoreEip1283Case17",
   "network/net/isIPAddressType",
   "network/net",
   "network/net/neighboursPacketLength",
   "network/net/neighboursPacket",
   "network/net/kademlia",
   "network/net/hostNoCapsNoTcpListener",
   "network/net/udpOnce",
   "network/net/noteActiveNodeAppendsNewNode",
   "network/net/noteActiveNodeUpdatesKnownNode",
   "network/net/noteActiveNodeEvictsTheNodeWhenBucketIsFull",
   "network/net/nearestNodeEntriesOneNode",
   "network/net/nearestNodeEntriesOneDistantNode",
   "network/net/nearestNodeEntriesManyNodes",
   "network/net/unexpectedPong",
   "network/net/invalidPong",
   "network/net/validPong",
   "network/net/pongWithChangedNodeID",
   "network/net/pingTimeout",
   "network/net/invalidPing",
   "network/net/neighboursSentAfterFindNode",
   "network/net/unexpectedFindNode",
   "network/net/evictionWithOldNodeAnswering",
   "network/net/evictionWithOldNodeDropped",
   "network/net/pingFromLocalhost",
   "network/net/addSelf",
   "network/net/findNodeIsSentAfterPong",
   "network/net/pingNotSentAfterPongForKnownNode",
   "network/net/addNodePingsNodeOnlyOnce",
   "network/net/packetsWithChangedEndpointSuite/addNode",
   "network/net/packetsWithChangedEndpointSuite",
   "network/net/packetsWithChangedEndpointSuite/findNode",
   "network/net/packetsWithChangedEndpointSuite/neighbours",
   "network/netTypes/unspecifiedNode",
   "network/netTypes",
   "network/netTypes/nodeTableReturnsUnspecifiedNode",
   "libp2p/p2p/host",
   "libp2p/p2p",
   "libp2p/p2p/attemptNetworkRestart",
   "libp2p/p2p/networkConfig",
   "libp2p/p2p/registerCapabilityAfterNetworkStart",
   "libp2p/p2p/saveNodes",
   "libp2p/p2p/saveENR",
   "libp2p/p2pPeer/requirePeer",
   "libp2p/p2pPeer",
   "libp2p/p2pPeer/requirePeerNoNetwork",
   "libp2p/peerTypes/emptySharedPeer",
   "libp2p/peerTypes",
   "BlockChainTestSuite/fillingExpectationOnMultipleNetworks",
   "BlockChainTestSuite",
   "BlockChainTestSuite/fillingExpectationOnSingleNetwork",
   "BlockChainTestSuite/fillingWithWrongExpectation",
   "TestHelperSuite/translateNetworks_gtConstantinople",
   "TestHelperSuite",
   "TestHelperSuite/translateNetworks_gtHomestead",
   "TestHelperSuite/translateNetworks_geHomestead",
   "TestHelperSuite/translateNetworks_ltHomestead",
   "TestHelperSuite/translateNetworks_ltTest",
   "TestHelperSuite/translateNetworks_leHomestead",
   "TestHelperSuite/translateNetworks_leFrontier",
   "ClientTests/Personal",
   "ClientTests",
   "JsonRpcSuite/jsonrpc_gasPrice",
   "JsonRpcSuite",
   "JsonRpcSuite/jsonrpc_isListening",
   "JsonRpcSuite/jsonrpc_accounts",
   "JsonRpcSuite/jsonrpc_number",
   "JsonRpcSuite/jsonrpc_peerCount",
   "JsonRpcSuite/jsonrpc_setMining",
   "JsonRpcSuite/jsonrpc_stateAt",
   "JsonRpcSuite/eth_coinbase",
   "JsonRpcSuite/eth_sendTransaction",
   "JsonRpcSuite/eth_sendRawTransaction_validTransaction",
   "JsonRpcSuite/eth_sendRawTransaction_errorZeroBalance",
   "JsonRpcSuite/eth_sendRawTransaction_errorInvalidNonce",
   "JsonRpcSuite/eth_sendRawTransaction_errorInsufficientGas",
   "JsonRpcSuite/eth_sendRawTransaction_errorDuplicateTransaction",
   "JsonRpcSuite/eth_signTransaction",
   "JsonRpcSuite/simple_contract",
   "JsonRpcSuite/contract_storage",
   "JsonRpcSuite/eth_getCode_emptyAccount",
   "JsonRpcSuite/web3_sha3",
   "JsonRpcSuite/debugAccountRangeAtFinalBlockState",
   "JsonRpcSuite/debugStorageRangeAtFinalBlockState",
   "JsonRpcSuite/debugTraceTransaction",
   "JsonRpcSuite/adminEthVmTrace",
   "JsonRpcSuite/test_setChainParams",
   "JsonRpcSuite/test_importRawBlock",
   "JsonRpcSuite/call_from_parameter",
};

@gumb0
Copy link
Member

gumb0 commented May 9, 2019

I don't really see duplicates there... Maybe if we put files with tests of the same test suite into different folders, test suite would be duplicated, not sure.

test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
test/tools/libtesteth/boostTest.cpp Outdated Show resolved Hide resolved
@chfast
Copy link
Member

chfast commented May 9, 2019

They might be duplicated.

Sorry for confusing comment. I meant that the CMake script generating this do not handle duplicates. But if they are full boost test names there should not be any as Boost would not allow to register 2 tests with the same name. Moreover, if you put all in a CMake list there is a builtin instruction to remove duplicates.

@winsvega
Copy link
Contributor Author

winsvega commented May 9, 2019

cmake list now contain all tests and all test suites combined together.

@gumb0
Copy link
Member

gumb0 commented May 10, 2019

I think it would be great to have a command that displays all test names, too (like testeth --list-tests)

@winsvega
Copy link
Contributor Author

there is boost cmd option list_content
https://www.boost.org/doc/libs/1_66_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/list_content.html

@winsvega winsvega requested a review from chfast May 12, 2019 17:16
@winsvega
Copy link
Contributor Author

Are those codecoves critical?
How to make it green? Add test coverage for new lines?

@chfast
Copy link
Member

chfast commented May 15, 2019

BOOST_CHECK_EQUAL(distance, 6);
}

BOOST_AUTO_TEST_CASE(getTestSuggestions)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not actually great unit tests because it depends on what tests are registered in other part of the project. I can leave with it, except this test does not pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it does not pass it means different behaviour depending on the build

@@ -131,6 +132,7 @@ json_spirit::mObject fillJsonWithStateChange(eth::State const& _stateOrig, eth::
json_spirit::mObject fillJsonWithState(eth::State const& _state);
json_spirit::mObject fillJsonWithState(eth::State const& _state, eth::AccountMaskMap const& _map);
json_spirit::mObject fillJsonWithTransaction(eth::Transaction const& _txn);
std::vector<std::string> getTestSuggestions(std::string const& _sMinusTArg);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::vector<std::string> getTestSuggestions(std::string const& _sMinusTArg);
std::vector<std::string> testSuggestions(std::string const& _sMinusTArg);


BOOST_AUTO_TEST_CASE(getTestSuggestions2)
{
// this return might change by more new tests get added
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is maintenance pain. Instead of using c_allTestNames in getTestSuggestions directly, you could pass it as a parameter, then pass the fake "all tests" here in tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would actually like to test that cmake constructed a valid test list array.
stExample2. Must find and suggest stExample test. I am planning to make it irrelevant with the order. Which somehow is different on the build

@gumb0
Copy link
Member

gumb0 commented May 21, 2019

Also please add an item to CHANGELOG

@winsvega winsvega force-pushed the testeth branch 4 times, most recently from f28504b to a69cfff Compare May 25, 2019 21:07
@winsvega
Copy link
Contributor Author

I have tried Andrey's suggestion to use tests list as a parametr. And found out that auto loop does not actually work with const char * (when its declared in the function arguments)
But it did work when I include it from header. Thus might have been the cause of test failures.

@winsvega winsvega requested a review from gumb0 May 27, 2019 12:58
Copy link
Member

@gumb0 gumb0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing C array to a function implicitly converts it to just a pointer without array size information. Surely there are ways to work around this and keep it as an array type, but I'm fine with changing it to vector here.

#include <test/tools/jsontests/BlockChainTests.h>
#include <test/tools/jsontests/StateTests.h>
#include <test/tools/jsontests/TransactionTests.h>
#include <test/tools/jsontests/vm.h>
#include <test/tools/libtesteth/TestHelper.h>
#include <boost/test/included/unit_test.hpp>
#include <boost/tokenizer.hpp>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need it?


void printTestSuiteSuggestions(string const& _sMinusTArg)
{
auto testList = test::testSuggestions(c_allTestNames, _sMinusTArg);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be const

vector<string> const testList = {
"test1", "test2", "BlockSuite", "BlockSuite/TestCase", "GeneralBlockchainTests"};
auto list = test::testSuggestions(testList, "blocksuit");
BOOST_CHECK_EQUAL(test::inArray(list, string("BlockSuite")), true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just BOOST_CHECK(inArray(list, string("BlockSuite"));

(also we have contains(...) in libdevcore/CommonData.h

"GeneralBlockchainTests", "GeneralStateTests/stExample", "BCGeneralStateTests/stExample"};

auto list = test::testSuggestions(testList, "GeneralStateTests/stExample2");
BOOST_CHECK_EQUAL(test::inArray(list, string("GeneralStateTests/stExample")), true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BOOST_CHECK

CHANGELOG.md Outdated
@@ -9,6 +9,7 @@
- Added: [#5575](https://github.com/ethereum/aleth/pull/5575) Log active peer count and peer list every 30 seconds.
- Added: [#5580](https://github.com/ethereum/aleth/pull/5580) Enable syncing from ETC nodes for blocks < dao hard fork block.
- Added: [#5591](https://github.com/ethereum/aleth/pull/5591) Network logging bugfixes and improvements and add p2pcap log channel.
- Added: [#5588](https://github.com/ethereum/aleth/pull/5588) Testeth print test suggestions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Added: [#5588](https://github.com/ethereum/aleth/pull/5588) Testeth print test suggestions
- Added: [#5588](https://github.com/ethereum/aleth/pull/5588) Testeth prints similar test suite name suggestions, when the name passed in `-t` argument is not found.

@gumb0
Copy link
Member

gumb0 commented May 28, 2019

Hint: when modifying PR, that has already been reviewed, don't overwrite commits, but add new ones - this way it's easier for reviewers to see what you have changed.

@winsvega
Copy link
Contributor Author

Fixed

@chfast chfast merged commit de06503 into master May 29, 2019
@chfast chfast deleted the testeth branch May 29, 2019 09:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants