Adding ETH_TEST macros to ABI and EndToEndTests

This commit is contained in:
Lefteris Karapetsas 2015-03-06 12:58:08 +01:00
parent 4cd659c51d
commit 4534ff8792
2 changed files with 5 additions and 21 deletions

View File

@ -20,7 +20,7 @@
* Unit tests for the solidity compiler JSON Interface output.
*/
#include <boost/test/unit_test.hpp>
#include "TestHelper.h"
#include <libsolidity/CompilerStack.h>
#include <json/json.h>
#include <libdevcore/Exceptions.h>
@ -39,15 +39,7 @@ public:
void checkInterface(std::string const& _code, std::string const& _expectedInterfaceString)
{
try
{
m_compilerStack.parse(_code);
}
catch(boost::exception const& _e)
{
auto msg = std::string("Parsing contract failed with: ") + boost::diagnostic_information(_e);
BOOST_FAIL(msg);
}
ETH_TEST_REQUIRE_NO_THROW(m_compilerStack.parse(_code), "Parsing contract failed");
std::string generatedInterfaceString = m_compilerStack.getMetadata("", DocumentationType::ABIInterface);
Json::Value generatedInterface;
m_reader.parse(generatedInterfaceString, generatedInterface);

View File

@ -25,7 +25,7 @@
#include <string>
#include <tuple>
#include <boost/test/unit_test.hpp>
#include "TestHelper.h"
#include <libethereum/State.h>
#include <libethereum/Executive.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 = "")
{
dev::solidity::CompilerStack compiler(m_addStandardSources);
try
{
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);
}
compiler.addSource("", _sourceCode);
ETH_TEST_REQUIRE_NO_THROW(compiler.compile(m_optimize), "Compiling contract failed");
bytes code = compiler.getBytecode(_contractName);
sendMessage(code, true, _value);