aboutsummaryrefslogtreecommitdiffstats
path: root/test/TestHelper.cpp
diff options
context:
space:
mode:
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();
+}