Skip to content

Commit

Permalink
output filter info when no transaction is executed because of filter
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Nov 26, 2019
1 parent 7fdbe6c commit ac3f4cb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
8 changes: 4 additions & 4 deletions retesteth/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ class Options
std::string singleTestName; // A test name (usually a file.json test)
std::string singleSubTestName; // A test name inside a file.json (for blockchain tests)
std::string singleTestNet;
int trDataIndex; ///< GeneralState data
int trGasIndex; ///< GeneralState gas
int trValueIndex; ///< GeneralState value
bool all = false; ///< Running every test, including time consuming ones.
int trDataIndex; ///< GeneralState data
int trGasIndex; ///< GeneralState gas
int trValueIndex; ///< GeneralState value
bool all = false; ///< Running every test, including time consuming ones.
bool nonetwork = false;///< For libp2p
/// @}

Expand Down
6 changes: 3 additions & 3 deletions retesteth/TestOutputHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ namespace test

struct TestInfo
{
TestInfo(std::string const& _fork, size_t _trD, size_t _trG, size_t _trV)
: m_sFork(_fork), m_trD(_trD), m_trG(_trG), m_trV(_trV)
TestInfo(std::string const& _fork, int _trD, int _trG, int _trV)
: m_sFork(_fork), m_trD(_trD), m_trG(_trG), m_trV(_trV)
{
m_isStateTransactionInfo = true;
}
Expand All @@ -45,7 +45,7 @@ struct TestInfo

private:
std::string m_sFork;
size_t m_trD, m_trG, m_trV;
int m_trD, m_trG, m_trV;
size_t m_blockNumber;
bool m_isStateTransactionInfo = false;
bool m_isBlockchainTestInfo = false;
Expand Down
7 changes: 7 additions & 0 deletions retesteth/ethObjects/stateTest/scheme_stateTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ void scheme_stateTestBase::checkUnexecutedTransactions()
if (!transactionExecutedOrSkipped || atLeastOneWithoutExpectSection)
ETH_MARK_ERROR("Test has transaction uncovered with expect section!");
}
if (!atLeastOneExecuted)
{
Options const& opt = Options::get();
TestInfo errorInfo(opt.singleTestNet.empty() ? "N/A" : opt.singleTestNet, opt.trDataIndex,
opt.trGasIndex, opt.trValueIndex);
TestOutputHelper::get().setCurrentTestInfo(errorInfo);
}
ETH_ERROR_REQUIRE_MESSAGE(atLeastOneExecuted, "Specified filter did not run a single transaction! ");
}

Expand Down

0 comments on commit ac3f4cb

Please sign in to comment.