From 61e94940bc6dd916408a73b0510a81ac2c75c932 Mon Sep 17 00:00:00 2001 From: chriseth Date: Sat, 6 Aug 2016 13:27:29 +0200 Subject: Show compilation errors in tests. --- test/libsolidity/SolidityExecutionFramework.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/libsolidity/SolidityExecutionFramework.h b/test/libsolidity/SolidityExecutionFramework.h index 5764784a..c34b00ec 100644 --- a/test/libsolidity/SolidityExecutionFramework.h +++ b/test/libsolidity/SolidityExecutionFramework.h @@ -33,6 +33,7 @@ #include #include +#include namespace dev { @@ -68,7 +69,17 @@ public: { m_compiler.reset(false, m_addStandardSources); m_compiler.addSource("", _sourceCode); - ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed"); + if (!m_compiler.compile(m_optimize, m_optimizeRuns)) + { + for (auto const& error: m_compiler.errors()) + SourceReferenceFormatter::printExceptionInformation( + std::cerr, + *error, + (error->type() == Error::Type::Warning) ? "Warning" : "Error", + [&](std::string const& _sourceName) -> solidity::Scanner const& { return m_compiler.scanner(_sourceName); } + ); + BOOST_ERROR("Compiling contract failed"); + } eth::LinkerObject obj = m_compiler.object(_contractName); obj.link(_libraryAddresses); BOOST_REQUIRE(obj.linkReferences.empty()); -- cgit