Add error IDs to console output

This commit is contained in:
a3d4
2020-06-10 13:27:25 +02:00
parent b17915a6ba
commit 51e64fe0b1
17 changed files with 77 additions and 31 deletions
+1
View File
@@ -121,6 +121,7 @@ function test_solc_behaviour()
rm "$stdout_path.bak"
else
sed -i.bak -e '/^Warning: This is a pre-release compiler version, please do not use it in production./d' "$stderr_path"
sed -i.bak -e '/^Warning (3805): This is a pre-release compiler version, please do not use it in production./d' "$stderr_path"
sed -i.bak -e 's/\(^[ ]*auxdata: \)0x[0-9a-f]*$/\1AUXDATA REMOVED/' "$stdout_path"
sed -i.bak -e 's/ Consider adding "pragma .*$//' "$stderr_path"
# Remove trailing empty lines. Needs a line break to make OSX sed happy.
+1
View File
@@ -0,0 +1 @@
--error-codes
+26
View File
@@ -0,0 +1,26 @@
Error (4937): No visibility specified. Did you intend to add "public"?
--> error_codes/input.sol:4:5:
|
4 | function f() {
| ^ (Relevant source part starts here and spans across multiple lines).
Warning (3420): Source file does not specify required compiler version!
--> error_codes/input.sol
Error (4247): Expression has to be an lvalue.
--> error_codes/input.sol:5:9:
|
5 | 2=0;
| ^
Error (7407): Type int_const 0 is not implicitly convertible to expected type int_const 2.
--> error_codes/input.sol:5:11:
|
5 | 2=0;
| ^
Error (2614): Indexed expression has to be a type, mapping or array (is literal_string "")
--> error_codes/input.sol:6:9:
|
6 | ""[2];
| ^^
+1
View File
@@ -0,0 +1 @@
1
+8
View File
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: GPL-3.0
contract C {
function f() {
2=0;
""[2];
}
}
+1 -1
View File
@@ -134,7 +134,7 @@ TestCase::TestResult ASTJSONTest::run(ostream& _stream, string const& _linePrefi
c.analyze();
else
{
SourceReferenceFormatterHuman formatter(_stream, _formatted);
SourceReferenceFormatterHuman formatter(_stream, _formatted, false);
for (auto const& error: c.errors())
formatter.printErrorInformation(*error);
return TestResult::FatalError;
+1 -1
View File
@@ -118,7 +118,7 @@ TestCase::TestResult GasTest::run(ostream& _stream, string const& _linePrefix, b
if (!compiler().parseAndAnalyze() || !compiler().compile())
{
SourceReferenceFormatterHuman formatter(_stream, _formatted);
SourceReferenceFormatterHuman formatter(_stream, _formatted, false);
for (auto const& error: compiler().errors())
formatter.printErrorInformation(*error);
return TestResult::FatalError;