mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adding ETH_TEST macros to ABI and EndToEndTests
This commit is contained in:
parent
4cd659c51d
commit
4534ff8792
@ -20,7 +20,7 @@
|
|||||||
* Unit tests for the solidity compiler JSON Interface output.
|
* Unit tests for the solidity compiler JSON Interface output.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <boost/test/unit_test.hpp>
|
#include "TestHelper.h"
|
||||||
#include <libsolidity/CompilerStack.h>
|
#include <libsolidity/CompilerStack.h>
|
||||||
#include <json/json.h>
|
#include <json/json.h>
|
||||||
#include <libdevcore/Exceptions.h>
|
#include <libdevcore/Exceptions.h>
|
||||||
@ -39,15 +39,7 @@ public:
|
|||||||
|
|
||||||
void checkInterface(std::string const& _code, std::string const& _expectedInterfaceString)
|
void checkInterface(std::string const& _code, std::string const& _expectedInterfaceString)
|
||||||
{
|
{
|
||||||
try
|
ETH_TEST_REQUIRE_NO_THROW(m_compilerStack.parse(_code), "Parsing contract failed");
|
||||||
{
|
|
||||||
m_compilerStack.parse(_code);
|
|
||||||
}
|
|
||||||
catch(boost::exception const& _e)
|
|
||||||
{
|
|
||||||
auto msg = std::string("Parsing contract failed with: ") + boost::diagnostic_information(_e);
|
|
||||||
BOOST_FAIL(msg);
|
|
||||||
}
|
|
||||||
std::string generatedInterfaceString = m_compilerStack.getMetadata("", DocumentationType::ABIInterface);
|
std::string generatedInterfaceString = m_compilerStack.getMetadata("", DocumentationType::ABIInterface);
|
||||||
Json::Value generatedInterface;
|
Json::Value generatedInterface;
|
||||||
m_reader.parse(generatedInterfaceString, generatedInterface);
|
m_reader.parse(generatedInterfaceString, generatedInterface);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <boost/test/unit_test.hpp>
|
#include "TestHelper.h"
|
||||||
#include <libethereum/State.h>
|
#include <libethereum/State.h>
|
||||||
#include <libethereum/Executive.h>
|
#include <libethereum/Executive.h>
|
||||||
#include <libsolidity/CompilerStack.h>
|
#include <libsolidity/CompilerStack.h>
|
||||||
@ -46,16 +46,8 @@ public:
|
|||||||
bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "")
|
bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "")
|
||||||
{
|
{
|
||||||
dev::solidity::CompilerStack compiler(m_addStandardSources);
|
dev::solidity::CompilerStack compiler(m_addStandardSources);
|
||||||
try
|
compiler.addSource("", _sourceCode);
|
||||||
{
|
ETH_TEST_REQUIRE_NO_THROW(compiler.compile(m_optimize), "Compiling contract failed");
|
||||||
compiler.addSource("", _sourceCode);
|
|
||||||
compiler.compile(m_optimize);
|
|
||||||
}
|
|
||||||
catch(boost::exception const& _e)
|
|
||||||
{
|
|
||||||
auto msg = std::string("Compiling contract failed with: ") + boost::diagnostic_information(_e);
|
|
||||||
BOOST_FAIL(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
bytes code = compiler.getBytecode(_contractName);
|
bytes code = compiler.getBytecode(_contractName);
|
||||||
sendMessage(code, true, _value);
|
sendMessage(code, true, _value);
|
||||||
|
Loading…
Reference in New Issue
Block a user