aboutsummaryrefslogtreecommitdiffstats
path: root/test/TestHelper.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-23 18:42:53 +0800
committerchriseth <chris@ethereum.org>2018-03-02 00:19:35 +0800
commitdc317a44e031d45ebf745b47248bf06bc92d58bf (patch)
treed03753c0d0ff0672669e0e8ecb70db84f73f6a7f /test/TestHelper.cpp
parenta53d6b499d5cc5c45fc096cea6393dc285581f90 (diff)
downloaddexon-solidity-dc317a44e031d45ebf745b47248bf06bc92d58bf.tar.gz
dexon-solidity-dc317a44e031d45ebf745b47248bf06bc92d58bf.tar.zst
dexon-solidity-dc317a44e031d45ebf745b47248bf06bc92d58bf.zip
Provide EVM version to assembly analysis.
Diffstat (limited to 'test/TestHelper.cpp')
-rw-r--r--test/TestHelper.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp
index fbf2dc90..e0d4423d 100644
--- a/test/TestHelper.cpp
+++ b/test/TestHelper.cpp
@@ -47,7 +47,7 @@ Options::Options()
optimize = true;
else if (string(suite.argv[i]) == "--evm-version")
{
- evmVersion = i + 1 < suite.argc ? suite.argv[i + 1] : "INVALID";
+ evmVersionString = i + 1 < suite.argc ? suite.argv[i + 1] : "INVALID";
++i;
}
else if (string(suite.argv[i]) == "--show-messages")
@@ -61,3 +61,17 @@ Options::Options()
if (auto path = getenv("ETH_TEST_IPC"))
ipcPath = path;
}
+
+dev::solidity::EVMVersion Options::evmVersion() const
+{
+ if (!evmVersionString.empty())
+ {
+ // We do this check as opposed to in the constructor because the BOOST_REQUIRE
+ // macros cannot yet be used in the constructor.
+ auto version = solidity::EVMVersion::fromString(evmVersionString);
+ BOOST_REQUIRE_MESSAGE(version, "Invalid EVM version: " + evmVersionString);
+ return *version;
+ }
+ else
+ return dev::solidity::EVMVersion();
+}