From 08effa0af54647971415cb66dc9181afad9642ee Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 28 Sep 2017 10:59:15 +0200 Subject: More verbose error messages. --- test/libsolidity/AnalysisFramework.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/libsolidity/AnalysisFramework.h') diff --git a/test/libsolidity/AnalysisFramework.h b/test/libsolidity/AnalysisFramework.h index 07e28f2b..a566ba1d 100644 --- a/test/libsolidity/AnalysisFramework.h +++ b/test/libsolidity/AnalysisFramework.h @@ -57,7 +57,8 @@ protected: bool success(std::string const& _source); Error expectError(std::string const& _source, bool _warning = false, bool _allowMultiple = false); - void printErrors(); + std::string formatErrors(); + std::string formatError(Error const& _error); static ContractDefinition const* retrieveContractByName(SourceUnit const& _source, std::string const& _name); static FunctionTypePointer retrieveFunctionBySignature( @@ -105,7 +106,10 @@ CHECK_ERROR_OR_WARNING(text, Warning, substring, true, true) do \ { \ auto sourceAndError = parseAnalyseAndReturnError((text), true); \ - BOOST_CHECK(sourceAndError.second == nullptr); \ + std::string message; \ + if (sourceAndError.second) \ + message = formatError(*sourceAndError.second); \ + BOOST_CHECK_MESSAGE(!sourceAndError.second, message); \ } \ while(0) -- cgit v1.2.3