Add support for SPDX license identifiers.

This commit is contained in:
chriseth
2020-05-13 18:16:59 +02:00
parent e9446475bb
commit 3872a1f000
19 changed files with 119 additions and 29 deletions
+6 -6
View File
@@ -64,8 +64,8 @@ TestCase::TestResult SMTCheckerJSONTest::run(ostream& _stream, string const& _li
StandardCompiler compiler;
// Run the compiler and retrieve the smtlib2queries (1st run)
string versionPragma = "pragma solidity >=0.0;\n";
Json::Value input = buildJson(versionPragma);
string preamble = "pragma solidity >=0.0;\n// SPDX-License-Identifier: GPL-3.0\n";
Json::Value input = buildJson(preamble);
Json::Value result = compiler.compile(input);
// This is the list of query hashes requested by the 1st run
@@ -121,10 +121,10 @@ TestCase::TestResult SMTCheckerJSONTest::run(ostream& _stream, string const& _li
std::string sourceName;
if (location.isMember("source") && location["source"].isString())
sourceName = location["source"].asString();
if (start >= static_cast<int>(versionPragma.size()))
start -= versionPragma.size();
if (end >= static_cast<int>(versionPragma.size()))
end -= versionPragma.size();
if (start >= static_cast<int>(preamble.size()))
start -= preamble.size();
if (end >= static_cast<int>(preamble.size()))
end -= preamble.size();
m_errorList.emplace_back(SyntaxTestError{
error["type"].asString(),
error["message"].asString(),