Display unimplemented errors in Yul codegen testing

i.e. do not hide exceptions
This commit is contained in:
Alex Beregszaszi 2021-01-14 15:21:14 +00:00
parent f9bfceccd1
commit 4491a290e2

View File

@ -151,44 +151,28 @@ TestCase::TestResult SemanticTest::runTest(ostream& _stream, string const& _line
for (auto& test: m_tests) for (auto& test: m_tests)
{ {
if (constructed)
try
{ {
if (constructed) soltestAssert(test.call().kind != FunctionCall::Kind::Library, "Libraries have to be deployed before any other call.");
{ soltestAssert(
soltestAssert(test.call().kind != FunctionCall::Kind::Library, "Libraries have to be deployed before any other call."); test.call().kind != FunctionCall::Kind::Constructor,
soltestAssert( "Constructor has to be the first function call expect for library deployments.");
test.call().kind != FunctionCall::Kind::Constructor, }
"Constructor has to be the first function call expect for library deployments."); else if (test.call().kind == FunctionCall::Kind::Library)
} {
else if (test.call().kind == FunctionCall::Kind::Library) soltestAssert(
{ deploy(test.call().signature, 0, {}, libraries) && m_transactionSuccessful,
soltestAssert( "Failed to deploy library " + test.call().signature);
deploy(test.call().signature, 0, {}, libraries) && m_transactionSuccessful, libraries[test.call().signature] = m_contractAddress;
"Failed to deploy library " + test.call().signature); continue;
libraries[test.call().signature] = m_contractAddress; }
continue; else
} {
if (test.call().kind == FunctionCall::Kind::Constructor)
deploy("", test.call().value.value, test.call().arguments.rawBytes(), libraries);
else else
{ soltestAssert(deploy("", 0, bytes(), libraries), "Failed to deploy contract.");
if (test.call().kind == FunctionCall::Kind::Constructor) constructed = true;
deploy("", test.call().value.value, test.call().arguments.rawBytes(), libraries);
else
soltestAssert(deploy("", 0, bytes(), libraries), "Failed to deploy contract.");
constructed = true;
}
}
catch (langutil::UnimplementedFeatureError const&)
{
// ignore unimplemented feature errors when forcibly trying to compile via yul.
if (!_compileViaYul || m_runWithYul)
throw;
}
catch (langutil::Error const& _error)
{
// ignore unimplemented feature errors when forcibly trying to compile via yul.
if (_error.errorId() != 1834_error || !_compileViaYul || m_runWithYul)
throw;
} }
if (test.call().kind == FunctionCall::Kind::Storage) if (test.call().kind == FunctionCall::Kind::Storage)